diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9a964c4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Embedded Markdown must retain identical bytes on Windows and Unix. +*.md text eol=lf diff --git a/AGENTS.md b/AGENTS.md index 00153ca..94764c0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,6 +10,26 @@ - Update API contracts, OpenAPI documentation and tests together when parameters change. - Include validation evidence and remaining limitations in PR descriptions. +## Official API rules and Agent usability + +- Review the actual official page for each affected endpoint, using the browser when requested. Follow linked request/response models and relevant appendices; an endpoint list or a URL alone does not establish a verified contract. +- Preserve browser-read documentation in `pkg/domain/reference/`, including parameter tables, notes, examples, source paragraph URLs and the review date. Keep the capture process reproducible with `scripts/browser-capture-reference.mjs`; preserve merged table cells so device-specific rules retain their context. +- Expose reviewed documentation through endpoint discovery and `agc --docs --pretty`. Include relevant supplemental models and appendices so an Agent can resolve prerequisites without guessing. +- Encode verified parameter locations, types, requiredness, nested objects, array item types, enums and explicit bounds in domain contracts. Update CLI serialization, REST validation, OpenAPI and independent regression tests together. +- Follow nested model links recursively. Validate child fields with their full paths (for example, `body.languages[0].appDesc`), including conditional child requirements and per-item limits. A valid parent object or array does not establish that its contents satisfy the API contract. +- Preserve the documented wire type when a string contains encoded JSON. Validate its decoded structure locally, but serialize it as a string when the API requires one. Encode form values exactly once, preserve integer precision and reject unsupported repeated scalar parameters. +- When official tables, examples or notes conflict, retain the source evidence and identify the unresolved rule. Do not silently choose an array/object shape, wrapper, required field or mutually exclusive branch. Separate documented requirements from locally verified behavior and implementation limitations. +- Distinguish unconditional requirements from conditional requirements and alternative authentication or application-identification branches. Do not require every authentication header at once. Do not interpret `Integer(32)` as a numeric range, dynamic map examples such as `additionalPropX` as literal required keys, or logical request-model names as JSON wrapper properties without checking the actual request example. +- Preserve transport semantics from the official examples: JSON, form data, multipart files and signed binary uploads require different handling. Respect returned upload methods, signed headers, URL expiry, file length and upload/parse prerequisites. +- Treat `inbound-callback` endpoints as callbacks to the developer's server. Do not automatically load Huawei credentials or forward an AGC Bearer token to that server. Preserve the documented form/JSON encoding and signatures; a simulated callback transport test does not prove Huawei signature verification or a real game transaction succeeded. +- Preserve ordered repeated query keys when the reference shows array query parameters. CLI callers repeat `--query key=value`; REST callers can use `queryValues` arrays alongside scalar `query` entries. Keep paired filters and values aligned, validate documented date formats and interval limits, and keep OpenAPI required-field alternatives consistent with both input forms. +- File rules depend on asset kind, language, device and application kind. Check the official file appendix and linked `LangFileInfo`/`FileInfo` models; a top-level array limit does not replace per-device asset counts, formats, sizes, resolutions or video/poster ordering. Do not guess missing application context or pretend a remote object ID proves local file properties. +- Reject invalid inputs before authentication or network calls when the rule can be checked locally. Return machine-readable CLI/REST errors with a stable code, endpoint, affected field path, source URL, concrete correction suggestion and documentation command. Nested violations must identify the array index and child field. Keep JSON stdout parseable and never include credentials or raw credential responses in feedback. +- Separate input violations, authentication failures, transport failures and upstream business errors. Preserve upstream error codes. Guide the Agent to the documented role, application state or prerequisite instead of suggesting blind retries or silently changing business resources. +- Test meaningful documented examples and failure cases before fixing behavior. Use independent source-based assertions for requiredness, encoding and nested shapes; registry-generated smoke fixtures alone cannot prove the registry is correct. Offline tests must not use the user's Huawei authorization. +- Report documentation review, implemented rules, offline verification and live verification accurately. Do not claim every official rule or real-app operation is supported merely because documentation was captured or generic transport tests passed. Continue toward a usable CLI rather than producing a report in place of the requested implementation. +- Rebuild the CLI after source changes and verify the binary actually invoked by the Agent. Distinguish the workspace binary from an installed package; a successful source test does not prove that an older installed CLI contains the fix. + ## Version releases and package managers - Ordinary branch pushes and PR updates run CI. To publish a stable version, push a new `vMAJOR.MINOR.PATCH` tag on the intended, tested commit from the merged main branch. Check existing tags first; do not move or reuse a published tag. diff --git a/CHANGELOG.md b/CHANGELOG.md index b2e816d..15e7efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ User-visible changes are listed here. Published binaries and versions are available in [GitHub Releases](https://github.com/Createitv/agc-cli/releases). +## [0.3.2] - 2026-10-26 + +- Add reviewed cloud development management, schema, cache, function resources and create-only SAM deployment. +- Expand local contract validation, offline documentation discovery and regression coverage. +- Preserve account identity, Agent Skills installation and package publication workflows. +- Live Huawei write operations remain unverified; documented unsupported operations remain explicit. + ## Unreleased ### Added diff --git a/Makefile b/Makefile index 15acc1b..951c6ee 100644 --- a/Makefile +++ b/Makefile @@ -14,23 +14,30 @@ test: # 离线测试:不读取真实华为授权,不调用华为服务器。 test-scripts: + python3 scripts/test_npm_package.py + node --test packaging/npm/test/agc.test.cjs + python3 scripts/test_coverage_isolation.py python3 scripts/test_ci_report.py python3 scripts/test_api_suite.py python3 scripts/test_live_lifecycle.py - python3 scripts/test_npm_package.py - node --test packaging/npm/test/agc.test.cjs + python3 scripts/test_live_package.py + python3 scripts/test_certificate_fingerprint.py + python3 scripts/test_live_multipart.py + python3 scripts/test_goal_progress.py + python3 scripts/test_publishing_audit.py + python3 scripts/test_publishing_models.py # 每个注册接口验证真实本地 HTTP 收发,8 路并发。 test-api-transport: $(GO) test ./cmd/agc/command -run TestEveryEndpointHTTPTransport -count=1 -parallel=8 +COVERAGE_RUNNER := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))scripts/check-coverage.py + coverage: - $(GO) test ./... -coverprofile=coverage.out - $(GO) tool cover -func=coverage.out + python3 "$(COVERAGE_RUNNER)" --go "$(GO)" -coverage-check: coverage - @total=$$($(GO) tool cover -func=coverage.out | awk '/^total:/ { gsub("%","",$$3); print $$3 }'); \ - awk -v total="$$total" -v min="$(COVERAGE_MIN)" 'BEGIN { if (total + 0 < min + 0) { printf("coverage %.1f%% is below %.1f%%\n", total, min); exit 1 } printf("coverage %.1f%% >= %.1f%%\n", total, min) }' +coverage-check: + python3 "$(COVERAGE_RUNNER)" --go "$(GO)" --minimum "$(COVERAGE_MIN)" lint: $(GO) vet ./... @@ -40,6 +47,7 @@ web-install: web-test: $(NPM) --prefix apps/web test -- --run + node --test scripts/test_browser_capture.mjs web-build: $(NPM) --prefix apps/web run build diff --git a/README.en.md b/README.en.md index d3314b5..6b3c1df 100644 --- a/README.en.md +++ b/README.en.md @@ -85,3 +85,7 @@ If agc-cli saves you time in development or automation, you can support ongoing ## License [MIT](LICENSE). + +## Cloud development management + +The CLI exposes 102 cloud-development operations, including reviewed management contracts. See [management usage and limitations](docs/SERVERLESS_MANAGEMENT.md). Huawei live write validation remains pending. diff --git a/README.md b/README.md index 509ef7b..0b1659e 100644 --- a/README.md +++ b/README.md @@ -85,3 +85,7 @@ agc publishing app-info-query --invoke --query appId=YOUR_APP_ID --query lang=zh ## 许可证 [MIT](LICENSE)。 + +## Cloud development management + +The CLI exposes 102 cloud-development operations, including reviewed management contracts. See [management usage and limitations](docs/SERVERLESS_MANAGEMENT.md). Huawei live write validation remains pending. diff --git a/apps/web/src/App.test.tsx b/apps/web/src/App.test.tsx index 4cb0c1e..a69697c 100644 --- a/apps/web/src/App.test.tsx +++ b/apps/web/src/App.test.tsx @@ -91,4 +91,12 @@ describe('App', () => { expect(document.documentElement).toHaveAttribute('lang', 'en'); expect(document.querySelectorAll('.endpointEntry')).toHaveLength(12); }); + + it('selects the bundled cache family when the API is unavailable', () => { + window.history.replaceState({}, '', '/en/reference/cache'); + render(); + expect(screen.getAllByText(/Cloud Cache/).length).toBeGreaterThan(0); + expect(screen.getAllByText(/286/).length).toBeGreaterThan(0); + }); + }); diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 0acac41..8d0a870 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -54,7 +54,7 @@ const skillSourceURL = (skill: string) => `https://github.com/Createitv/agc-cli/ const skillDownloadURL = (skill: string) => `https://raw.githubusercontent.com/Createitv/agc-cli/main/skills/${skill}/SKILL.md`; const fallbackCapabilities: Capability[] = [ - { id: 'publishing', name: 'Publishing API', description: 'Release metadata, package state, submissions, review withdrawal, and release timing.', command: 'agc publishing', restPath: '/api/v1/publishing', status: 'registered', endpointCount: 14 }, + { id: 'publishing', name: 'Publishing API', description: 'Release metadata, package state, submissions, review withdrawal, and release timing.', command: 'agc publishing', restPath: '/api/v1/publishing', status: 'registered', endpointCount: 42 }, { id: 'upload', name: 'Upload Management', description: 'APP packages, icons, screenshots, videos, PDFs, and multipart binary uploads.', command: 'agc upload', restPath: '/api/v1/upload', status: 'registered', endpointCount: 6 }, { id: 'provisioning', name: 'Provisioning', description: 'Certificates, profiles, ACLs, devices, and fingerprints for release workflows.', command: 'agc provisioning', restPath: '/api/v1/provisioning', status: 'registered', endpointCount: 17 }, { id: 'domains', name: 'Domain Management', description: 'Inspect, precheck, download, and update atomic service domain configuration.', command: 'agc domains', restPath: '/api/v1/domains', status: 'registered', endpointCount: 5 }, @@ -67,7 +67,15 @@ const fallbackCapabilities: Capability[] = [ { id: 'game-items', name: 'Game Item Mall', description: 'Inbound role query and order callbacks configured in AGC.', command: 'agc game-items', restPath: '/api/v1/game-items', status: 'registered', endpointCount: 2 }, { id: 'resources', name: 'Resource Predownload', description: 'Coordinate resource package versions, files, upload confirmation, and publishing.', command: 'agc resources', restPath: '/api/v1/resources', status: 'registered', endpointCount: 8 }, { id: 'cicd', name: 'CI/CD Platform', description: 'Connect local Hvigor builds to the same command surface.', command: 'agc cicd', restPath: '/api/v1/cicd', status: 'registered', endpointCount: 1 }, -]; + { id: 'functions', name: 'Cloud Functions', description: 'Native function creation, code/config updates, publishing and invocation; explicit user OAuth session.', command: 'agc functions', restPath: '/api/v1/functions', status: 'registered', endpointCount: 9 }, + { id: 'cloud-auth', name: 'Cloud Authentication', description: 'Application user sign-in and server user management; separate credential branches.', command: 'agc cloud-auth', restPath: '/api/v1/cloud-auth', status: 'registered', endpointCount: 17 }, + { id: 'clouddb', name: 'Cloud DB for Object', description: 'Object data queries, writes and deletion using existing zones and schemas.', command: 'agc clouddb', restPath: '/api/v1/clouddb', status: 'registered', endpointCount: 5 }, + { id: 'storage', name: 'Cloud Storage', description: 'File upload/download, metadata and listing with server REST.', command: 'agc storage', restPath: '/api/v1/storage', status: 'registered', endpointCount: 6 }, + { id: 'hosting', name: 'Cloud Hosting', description: 'Website sites, environments, signed ZIP uploads, archive and release.', command: 'agc hosting', restPath: '/api/v1/hosting', status: 'registered', endpointCount: 16 }, + { id: 'templates', name: 'Serverless Templates', description: 'Developer-hosted user authentication callbacks; no AGC bearer forwarding.', command: 'agc templates', restPath: '/api/v1/templates', status: 'registered', endpointCount: 2 }, + { id: 'cache', name: 'Cloud Cache', description: 'Manage cache resources using an explicit management session.', command: 'agc cache', restPath: '/api/v1/cache', status: 'registered' }, + { id: 'prefetch', name: 'Prefetch', description: 'Simulate developer callbacks and inspect an explicitly selected device.', command: 'agc prefetch', restPath: '/api/v1/prefetch', status: 'registered' }, +].map(capability => ({ ...capability, endpointCount: bundledEndpoints.filter(endpoint => endpoint.familyId === capability.id).length })); const capabilityTranslations: Record> = { en: Object.fromEntries(fallbackCapabilities.map(({ id, name, description }) => [id, { name, description }])), @@ -84,6 +92,14 @@ const capabilityTranslations: Record('npm'); const [capabilities, setCapabilities] = useState(fallbackCapabilities); - const [endpointCount, setEndpointCount] = useState(156); + const [endpointCount, setEndpointCount] = useState(bundledEndpoints.length); const [endpoints, setEndpoints] = useState(bundledEndpoints); const [mode, setMode] = useState<'demo' | 'live'>('demo'); const [selected, setSelected] = useState(() => renderFamily ?? (typeof window !== 'undefined' ? familyFromPath(window.location.pathname) : undefined) ?? 'publishing'); @@ -413,7 +429,7 @@ export function App({ renderLanguage, renderFamily }: { renderLanguage?: Languag setEndpointCount(body.data.length); } }) - .catch(() => setEndpointCount(156)); + .catch(() => setEndpointCount(bundledEndpoints.length)); }, []); useEffect(() => { @@ -531,7 +547,7 @@ export function App({ renderLanguage, renderFamily }: { renderLanguage?: Languag {text.hero.browse}
- 13 {text.hero.families} + {capabilities.length} {text.hero.families} {endpointCount} {text.hero.interfaces} 3 {text.hero.formats}
diff --git a/apps/web/src/endpoint-registry.json b/apps/web/src/endpoint-registry.json index 086d4cb..146a030 100644 --- a/apps/web/src/endpoint-registry.json +++ b/apps/web/src/endpoint-registry.json @@ -1,9 +1,91 @@ [ { + "documentation": { + "title": "查询软件包编译状态", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:03.411Z", + "status": "browser-read", + "readCommand": "agc publishing package-compile-status-v3 --docs --pretty" + }, + "id": "package-compile-status-v3", + "familyId": "publishing", + "name": "查询软件包编译状态", + "description": "此接口用于查询HarmonyOS应用/元服务的软件包的编译状态。", + "method": "GET", + "path": "/api/publish/v3/package/compile/status", + "command": "agc publishing package-compile-status-v3", + "requiredParams": [ + "appId", + "pkgIds" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section165302018915", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section165302018915", + "maxLength": 500, + "type": "string", + "name": "pkgIds", + "in": "query", + "required": true, + "description": "待查询的软件包ID。 多个ID之间用英文逗号分隔。 可从更新应用软件包信息接口返回的packageId参数中获取。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "officialSlug": "agc-help-publish-api-query-compile-status-0000002236041434", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/package-compile-status-v3", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing package-compile-status-v3 --invoke", + "show": "agc publishing package-compile-status-v3 --pretty" + } + }, + { + "documentation": { + "title": "创建APP ID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939", + "updatedAt": "2026-09-04 16:04", + "checkedAt": "2026-10-07T05:11:11.924Z", + "status": "browser-read", + "readCommand": "agc publishing app-create --docs --pretty" + }, + "rules": [ + { + "id": "application-package-name", + "kind": "required_if", + "field": "body.packageName", + "when": { + "field": "body.installationFree", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", + "message": "HarmonyOS应用 installationFree=0 时必须提供 packageName。", + "suggestion": "添加 --field packageName=你的唯一包名;元服务 installationFree=1 不需要包名。" + } + ], "id": "app-create", "familyId": "publishing", "name": "创建APP ID", - "description": "创建 HarmonyOS 应用或元服务,用于建立与现有业务应用隔离的测试资源。", + "description": "此接口用于为HarmonyOS应用/元服务创建APP ID。", "method": "POST", "path": "/api/publish/v3/app", "command": "agc publishing app-create", @@ -14,39 +96,54 @@ ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", "type": "string", "name": "projectId", "in": "query", "required": false, - "description": "可选项目 ID;省略时创建专用同名项目" + "description": "项目ID,获取方法请参见查看应用信息。 如果不传projectId,系统会先在内部创建一个与应用同名的项目,随后再创建应用。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", + "maxLength": 64, "type": "string", "name": "appName", "in": "body", "required": true, - "description": "应用名称,最长 64 字符" + "description": "应用名称。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", + "maxLength": 128, "type": "string", "name": "packageName", "in": "body", "required": false, - "description": "HarmonyOS 应用必填且包名唯一;元服务由系统生成" + "description": "应用包名,必须唯一,且不能与其他应用(包括Android应用)包名相同。 说明 installationFree取值为0(HarmonyOS应用)时,此参数必填。 installationFree取值为1(元服务)时,系统将自动生成包名,此参数无需填写。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", + "enum": [ + "2", + "13" + ], "type": "integer", "name": "parentType", "in": "body", "required": true, - "description": "13:应用;2:游戏" + "description": "应用分类。 取值范围: 2:游戏 13:应用" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", + "enum": [ + "0", + "1" + ], "type": "integer", "name": "installationFree", "in": "body", "required": true, - "description": "0:HarmonyOS 应用;1:元服务" + "description": "应用类型。 取值范围: 0:HarmonyOS应用 1:元服务 默认值:0" } ], "body": "appName,packageName,parentType,installationFree", @@ -71,10 +168,32 @@ } }, { + "documentation": { + "title": "查询应用信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T05:11:36.198Z", + "status": "browser-read", + "readCommand": "agc publishing app-info-query-v3 --docs --pretty" + }, + "rules": [ + { + "id": "test-version-id", + "kind": "required_if", + "field": "query.versionId", + "when": { + "field": "query.releaseType", + "equals": "6" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165", + "message": "查询HarmonyOS测试版本时必须提供 versionId。", + "suggestion": "先用 app-version-list 查询真实版本 ID,再添加 --query versionId=该ID。" + } + ], "id": "app-info-query-v3", "familyId": "publishing", - "name": "查询HarmonyOS应用信息", - "description": "查询 HarmonyOS 应用和元服务的资料;releaseType=6 时必须提供专用测试版本 ID。", + "name": "查询应用信息", + "description": "此接口用于根据指定语言和应用ID查询HarmonyOS应用/元服务的详细信息。", "method": "GET", "path": "/api/publish/v3/app-info", "command": "agc publishing app-info-query-v3", @@ -83,32 +202,42 @@ ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165", + "maxLength": 32, "type": "string", "name": "appId", "in": "query", "required": true, - "description": "应用 ID" + "description": "需要查询的应用ID。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165", + "maxLength": 16, "type": "string", "name": "lang", "in": "query", "required": false, - "description": "可选语言;不传则返回全部语言" + "description": "需要查询的语言。 说明 取值参考语言类型。 不传该参数,则查询全部语言的应用信息。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165", + "enum": [ + "1", + "6" + ], "type": "integer", "name": "releaseType", "in": "query", "required": false, - "description": "1:商用版本;6:HarmonyOS 测试版本" + "description": "应用发布方式。 取值范围: 1:全网 6:HarmonyOS测试发布方式(API>=10) 默认值:1" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165", "type": "string", "name": "versionId", "in": "query", "required": false, - "description": "releaseType=6 时必填的测试版本 ID" + "description": "需要查询的版本ID。 注意 releaseType为6,该字段必填。" } ], "status": "registered", @@ -132,36 +261,61 @@ } }, { + "documentation": { + "title": "查询应用所有版本类型的版本列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:56:06.794Z", + "status": "browser-read", + "readCommand": "agc publishing app-version-list --docs --pretty" + }, + "rules": [ + { + "id": "app-identity", + "kind": "at_least_one", + "fields": [ + "header.appId", + "body.packageName" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386", + "message": "appId 与 packageName 至少传一个。", + "suggestion": "添加 --header appId=应用ID 或 --field packageName=应用包名。" + } + ], "id": "app-version-list", "familyId": "publishing", "name": "查询应用所有版本类型的版本列表", - "description": "查询 HarmonyOS 应用或元服务的商用版本和测试版本,读回版本 ID 与状态。", + "description": "此接口用于获取HarmonyOS应用/元服务的所有版本类型(含商用版本和测试版本)的版本列表,帮助开发者了解版本发布状态。", "method": "POST", "path": "/api/publish/v3/version/brief-info/list", "command": "agc publishing app-version-list", - "requiredParams": [ - "appId" - ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165", + "maxLength": 32, + "type": "string", "name": "appId", "in": "header", - "required": true, - "description": "Huawei application ID" + "required": false, + "description": "应用ID,获取方法参考查看应用信息。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386", + "maxLength": 128, "type": "string", "name": "packageName", "in": "body", "required": false, - "description": "应用包名;CLI 已要求 appId 请求头" + "description": "应用包名。 说明 appId和packageName至少传一个。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386", + "maxLength": 64, "type": "string", "name": "state", "in": "body", "required": false, - "description": "可选版本状态,多个状态以逗号分隔" + "description": "版本状态。 多个状态用逗号分隔。 说明 state字段的取值请参考AppInfo中的releaseState参数。" } ], "body": "packageName,state", @@ -186,13 +340,120 @@ } }, { + "documentation": { + "title": "通过下载方式提交软件包", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065", + "updatedAt": "2026-01-21 16:29", + "checkedAt": "2026-10-07T02:51:52.049Z", + "status": "browser-read", + "readCommand": "agc publishing add-packageurl --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], "id": "add-packageurl", "familyId": "publishing", "name": "通过下载方式提交软件包", - "description": "如果您将软件包保存在自己的服务器上,可以直接调用本接口将软件包提交到AppGallery Connect服务器。", + "description": "如果您将软件包保存在自己的服务器上,可以直接调用本接口将软件包提交到AppGallery Connect服务器。华为服务器会自动从下载地址中下载软件包后提交,不会关联版本。本操作只提交软件包,不发布软件包。接口调用者的角色:账号持有者、管理员、APP管理员。", "method": "POST", "path": "/api/publish/v2/app-package-file/by-url", "command": "agc publishing add-packageurl", + "requiredParams": [ + "appId", + "downloadUrl", + "downloadFileName", + "requestId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section164139546428", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 256, + "type": "string", + "name": "downloadUrl", + "in": "body", + "required": true, + "description": "由您自行提供的软件包下载地址。 APK:不超过4GB。 RPK:快应用不超过20MB,快游戏不超过30MB。 AAB:不超过150MB。 EXE(Windows应用):不超过4GB。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "downloadFileName", + "in": "body", + "required": true, + "description": "与downloadUrl配套的文件名,包括后缀。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 256, + "type": "string", + "name": "callbackAddr", + "in": "body", + "required": false, + "description": "回调地址,由您自行配置。软件包提交完成后由华为服务器调用回调结果通知接口通过该URL回调给您的开发者服务器。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "您自定义请求字符串,必须唯一标识此请求。结果回调时会携带该字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 255, + "type": "string", + "name": "versionName", + "in": "body", + "required": false, + "description": "Windows应用的软件包版本号。 文件类型为exe软件包时必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 255, + "type": "string", + "name": "displayName", + "in": "body", + "required": false, + "description": "注册表显示名称,用于唯一标识Windows应用。 文件类型为exe软件包时必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "type": "integer", + "name": "packageType", + "in": "body", + "required": false, + "description": "软件包类型。 1:APK 2:RPK 8:EXE(Windows应用)" + } + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", @@ -215,10 +476,18 @@ } }, { + "documentation": { + "title": "更新应用文件信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202", + "updatedAt": "2025-11-21 17:52", + "checkedAt": "2026-10-07T02:52:22.905Z", + "status": "browser-read", + "readCommand": "agc publishing app-file-info --docs --pretty" + }, "id": "app-file-info", "familyId": "publishing", "name": "更新应用文件信息", - "description": "图片、视频、APK、RPK、AAB等文件上传完成后,通过该接口刷新应用文件信息。", + "description": "图片、视频、APK、RPK、AAB等文件上传完成后,通过该接口刷新应用文件信息。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", "method": "PUT", "path": "/api/publish/v2/app-file-info", "command": "agc publishing app-file-info", @@ -244,10 +513,31 @@ } }, { + "documentation": { + "title": "查询应用信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045", + "updatedAt": "2025-11-21 17:52", + "checkedAt": "2026-10-07T02:52:24.177Z", + "status": "browser-read", + "readCommand": "agc publishing app-info-query --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], "id": "app-info-query", "familyId": "publishing", "name": "查询应用信息", - "description": "此接口用于根据指定语言和应用ID查询应用的详细信息。", + "description": "此接口用于根据指定语言和应用ID查询应用的详细信息。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", "method": "GET", "path": "/api/publish/v2/app-info", "command": "agc publishing app-info-query", @@ -256,16 +546,40 @@ ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165", + "type": "string", "name": "appId", "in": "query", "required": true, - "description": "Huawei application ID" + "description": "需要查询的应用ID。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165", + "type": "string", "name": "lang", "in": "query", "required": false, - "description": "Application information language" + "description": "需要查询的语言,取值参考语言类型。不传该参数则查询全部语言的应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165", + "enum": [ + "1", + "3" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1" } ], "status": "registered", @@ -289,5548 +603,32968 @@ } }, { + "documentation": { + "title": "更新应用基本信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198", + "updatedAt": "2026-09-14 08:56", + "checkedAt": "2026-10-07T04:48:08.197Z", + "status": "browser-read", + "readCommand": "agc publishing app-info-update --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + }, + { + "id": "conditional-price", + "kind": "required_if", + "field": "body.price", + "when": { + "field": "body.isFree", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "price is required when isFree=0.", + "suggestion": "Supply price for the selected application settings." + }, + { + "id": "conditional-priceDetail", + "kind": "required_if", + "field": "body.priceDetail", + "when": { + "field": "body.isFree", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "priceDetail is required when isFree=0.", + "suggestion": "Supply priceDetail for the selected application settings." + }, + { + "id": "conditional-registeredEntity", + "kind": "required_if", + "field": "body.registeredEntity", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "registeredEntity is required when registeredDclType=0.", + "suggestion": "Supply registeredEntity for the selected application settings." + }, + { + "id": "conditional-registeredEntityName", + "kind": "required_if", + "field": "body.registeredEntityName", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "registeredEntityName is required when registeredDclType=0.", + "suggestion": "Supply registeredEntityName for the selected application settings." + } + ], "id": "app-info-update", "familyId": "publishing", "name": "更新应用基本信息", - "description": "此接口用于更新指定应用的应用详情。", + "description": "此接口用于更新指定应用的应用详情。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", "method": "PUT", "path": "/api/publish/v2/app-info", "command": "agc publishing app-info-update", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198", - "officialSlug": "agcapi-app-info-update-0000001111685198", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/publishing/endpoints", - "method": "GET" + "requiredParams": [ + "appId", + "privacyPolicy" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" }, - "self": { - "href": "/api/v1/publishing/endpoints/app-info-update", - "method": "GET" - } - }, - "affordances": { - "invoke": "agc publishing app-info-update --invoke --body body.json", - "show": "agc publishing app-info-update --pretty" - } - }, - { - "id": "app-submit", - "familyId": "publishing", - "name": "提交发布", - "description": "此接口用于提交应用审核,调用本接口前必须保证应用信息已补充完整,应用软件包已经上传。", - "method": "POST", - "path": "/api/publish/v2/app-submit", - "command": "agc publishing app-submit", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061", - "officialSlug": "agcapi-app-submit-0000001158245061", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/publishing/endpoints", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section886219295206", + "enum": [ + "1", + "3" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1" }, - "self": { - "href": "/api/v1/publishing/endpoints/app-submit", - "method": "GET" - } - }, - "affordances": { - "invoke": "agc publishing app-submit --invoke --body body.json", - "show": "agc publishing app-submit --pretty" - } - }, - { - "id": "app-submit-with-file", - "familyId": "publishing", - "name": "通过下载方式提交发布", - "description": "如果您将软件包保存在自己的服务器上,可以直接调用本接口提交应用审核,并传入软件包的下载地址。", - "method": "POST", - "path": "/api/publish/v2/app-submit-with-file", - "command": "agc publishing app-submit-with-file", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092", - "officialSlug": "agcapi-app-submit-with-file-0000001111845092", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/publishing/endpoints", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section886219295206", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要更新的应用ID。" }, - "self": { - "href": "/api/v1/publishing/endpoints/app-submit-with-file", - "method": "GET" - } - }, - "affordances": { - "invoke": "agc publishing app-submit-with-file --invoke --body body.json", - "show": "agc publishing app-submit-with-file --pretty" - } - }, - { - "id": "appid-list", - "familyId": "publishing", - "name": "查询应用包名对应的appid", - "description": "此接口用于根据应用包名查询对应的应用ID,支持一次查询多个应用包名。", - "method": "GET", - "path": "/api/publish/v2/appid-list", - "command": "agc publishing appid-list", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appid-list-0000001111845086", - "officialSlug": "agcapi-appid-list-0000001111845086", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/publishing/endpoints", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "defaultLang", + "in": "body", + "required": false, + "description": "应用的默认语言,取值参见语言类型。" }, - "self": { - "href": "/api/v1/publishing/endpoints/appid-list", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "type": "integer", + "name": "childType", + "in": "body", + "required": false, + "description": "应用的二级分类,固定ID,取值参见应用游戏分类。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "type": "integer", + "name": "grandChildType", + "in": "body", + "required": false, + "description": "应用的三级分类,固定ID,取值参见应用游戏分类。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 255, + "type": "string", + "name": "privacyPolicy", + "in": "body", + "required": true, + "description": "隐私声明地址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "appNetType", + "in": "body", + "required": false, + "description": "应用联网类型。 取值范围: 1:单机 2:网游" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "isFree", + "in": "body", + "required": false, + "description": "应用付费类型。 取值范围: 1:免费 0:付费 如果isFree为1,price和priceDetail参数将无效。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 256, + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "应用价格,格式为{\"countryCode\":\"price\"}。countryCode为国家码,price为应用的价格。国家码列表请参见国家码,对应币种请参见ISO 4217标准。 AppGallery Connect会根据所在国家/地区的价格规则对最终价格做适当调整,具体规则请参见价格换算规则。 注意 当isFree为0时,此参数必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 8192, + "type": "string", + "name": "priceDetail", + "in": "body", + "required": false, + "description": "应用在不同国家或地区的价格,json数组格式,不同国家和地区之间使用逗号分隔,例如:[{\"country\":\"CN\",\"currency\":\"CNY\",\"price\":\"18.00\"},{{\"country\":\"DE\",\"currency\":\"EUR\",\"price\":\"2.50\"}}]。 其中,country为国家码,currency为国家码所对应的币种,price为应用价格。国家码列表请参见国家码,对应币种请参见ISO 4217标准。 AppGallery Connect会根据所在国家/地区的价格规则对最终价格做适当调整,具体规则请参见价格换算规则。 注意 当isFree为0时,此参数必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 2048, + "type": "string", + "name": "publishCountry", + "in": "body", + "required": false, + "description": "应用发布国家的国家码,多个国家以英文逗号分隔,例如:“CN,DE,MC”。如果取值为“OTHER”,表示当AppGallery支持的国家或地区列表中新增某个国家或地区时,应用将自动分发到新增的国家和地区。国家码列表请参见国家码。 注意 取值不能只包含OTHER。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "isAppForcedUpdate", + "in": "body", + "required": false, + "description": "应用是否强制升级。 取值范围: 0:不强制 1:强制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "hispaceAutoDown", + "in": "body", + "required": false, + "description": "是否允许华为应用市场抓包。 取值范围: 0:不允许 1:允许" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 16, + "type": "string", + "name": "appTariffType", + "in": "body", + "required": false, + "description": "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 支持设置多个,使用英文逗号分隔,例如“1,2,3”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 50, + "type": "string", + "name": "publicationNumber", + "in": "body", + "required": false, + "description": "版号信息。 此参数只支持游戏类应用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 50, + "type": "string", + "name": "cultureRecordNumber", + "in": "body", + "required": false, + "description": "文化部备案编号。 此参数只支持游戏类应用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 255, + "type": "string", + "name": "developerWebsite", + "in": "body", + "required": false, + "description": "开发者官网。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "familyShareTag", + "in": "body", + "required": false, + "description": "是否可以家庭共享。 取值范围: 0:不可以。 1:可以。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "4", + "6", + "7", + "8", + "9", + "10" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true, + "description": "设备类型。 取值范围: 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "type": "string", + "name": "appAdapters", + "in": "body", + "required": true, + "description": "适配设备类型,多个类型以英文逗号分隔。 取值范围: 1:荣耀立方(路由器) 4:手机 5:平板 6:VR 7:手表 8:大屏 9:路由器 11:儿童表 12:智能手表 13:带屏音响 15:Windows APK类型的软件包约束如下: 当deviceType为4时,appAdapters可选范围为:4,5,7(如果有7,4也必须选择),15(受限开放,需要联系华为运营开通) 当deviceType为6时,appAdapters可选范围为:4, 5。 当deviceType为7时,appAdapters可选范围为:11,12。 当deviceType为8时,appAdapters可选范围为:1,3,8。 RPK类型的软件包约束如下: 当deviceType为4时,appAdapters可选范围为:4,5,15 注意 修改设备类型信息时此字段必选,否则传入deviceType后会此参数会被置为空。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "itemsType": "object", + "type": "array", + "name": "deviceTypes", + "in": "body", + "required": false, + "description": "设备类型信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "webGameFlag", + "in": "body", + "required": false, + "description": "该应用是否为网页游戏。 取值范围: 0:否 1:是 该参数仅在应用为手机RPK游戏,且设备类型信息中适配设备类型包含Windows(appAdapters取值包含15)时才会生效。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 256, + "type": "string", + "name": "privacyRightsUrl", + "in": "body", + "required": false, + "description": "隐私权利网址,即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "-1", + "0", + "1", + "2" + ], + "type": "integer", + "name": "registeredDclType", + "in": "body", + "required": false, + "description": "APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "-1", + "1", + "2", + "3" + ], + "type": "integer", + "name": "registeredIdType", + "in": "body", + "required": false, + "description": "主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "registeredIdNumber", + "in": "body", + "required": false, + "description": "主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "registeredEntity", + "in": "body", + "required": false, + "description": "主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 若在版本提交时,该字段值选择“一致”,则主办单位名称和证件号,将直接复用开发者联盟注册账号信息。 若您提交的主办单位信息与联盟账号信息不一致,该字段值却选择了“一致”,则系统将自动判定为“不一致”,将会影响审核结果。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 1024, + "type": "string", + "name": "registeredEntityName", + "in": "body", + "required": false, + "description": "主办单位名称。 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 512, + "type": "string", + "name": "userAgreementUrl", + "in": "body", + "required": false, + "description": "用户协议URL。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "encrypted", + "in": "body", + "required": false, + "description": "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198", + "officialSlug": "agcapi-app-info-update-0000001111685198", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-info-update", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-info-update --invoke --body body.json", + "show": "agc publishing app-info-update --pretty" + } + }, + { + "documentation": { + "title": "提交发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061", + "updatedAt": "2025-08-25 13:48", + "checkedAt": "2026-10-07T02:52:26.711Z", + "status": "browser-read", + "readCommand": "agc publishing app-submit --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + }, + { + "id": "phased-phasedReleaseStartTime", + "kind": "required_if", + "field": "body.phasedReleaseStartTime", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleaseStartTime is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + }, + { + "id": "phased-phasedReleaseEndTime", + "kind": "required_if", + "field": "body.phasedReleaseEndTime", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleaseEndTime is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + }, + { + "id": "phased-phasedReleasePercent", + "kind": "required_if", + "field": "body.phasedReleasePercent", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleasePercent is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + }, + { + "id": "phased-phasedReleaseDescription", + "kind": "required_if", + "field": "body.phasedReleaseDescription", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleaseDescription is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + } + ], + "id": "app-submit", + "familyId": "publishing", + "name": "提交发布", + "description": "此接口用于提交应用审核,调用本接口前必须保证应用信息已补充完整,应用软件包已经上传。接口调用者的角色:账号持有者、管理员、APP管理员。", + "method": "POST", + "path": "/api/publish/v2/app-submit", + "command": "agc publishing app-submit", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364", + "type": "string", + "name": "releaseTime", + "in": "query", + "required": false, + "description": "指定发布的UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 说明 如果releaseTime未填写,应用审核通过后会立即上架。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364", + "type": "string", + "name": "remark", + "in": "query", + "required": false, + "description": "提审发布的备注信息,可以为空。如果填写,长度范围在10-300。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364", + "enum": [ + "1", + "3" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 说明 应用发布方式为分阶段发布时,要求该应用存在一个已上架的版本。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "type": "string", + "name": "state", + "in": "body", + "required": false, + "description": "此参数无需设置。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 64, + "type": "string", + "name": "phasedReleaseStartTime", + "in": "body", + "required": false, + "description": "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 64, + "type": "string", + "name": "phasedReleaseEndTime", + "in": "body", + "required": false, + "description": "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 10, + "type": "string", + "name": "phasedReleasePercent", + "in": "body", + "required": false, + "description": "分阶段发布百分比。 Android应用取值范围为0.00到100.00,必须精确到两位小数,不含百分号。 HarmonyOS应用取值为0.00到100.00,可以不带小数或只带一位小数,不含百分号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 500, + "type": "string", + "name": "phasedReleaseDescription", + "in": "body", + "required": false, + "description": "分阶段发布说明。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "isPureDetection", + "in": "body", + "required": false, + "description": "是否申请绿色应用认证。 取值范围: 0:否 1:是" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "type": "string", + "name": "sensitivePermissionIconUrl", + "in": "body", + "required": false, + "description": "绿色认证审核材料的objectId,isPureDetection=1时为必填项。该值为将绿色认证审核材料打成zip包,然后先调用获取上传文件地址接口,然后调用上传文件接口上传审核材料,最后得到获取上传文件地址接口返回的objectId。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "type": "boolean", + "name": "isCommitSensitivePermissionTips", + "in": "body", + "required": false, + "description": "确认是否符合相关要求,true表示符合。isPureDetection=1时为必填项,且只可以填true。要求包括: 非必要的使用场景禁止桌面、锁屏和其他应用弹出窗口骚扰用户行为。 非必要的使用场景禁止发送无法删除的常驻通知。 禁止影响用户体验的广告,如抬头、强制插屏、侧边等。 禁止引导用户开启开发者选项。 禁止引导用户开启USB调试模式。 禁止通过热补丁,引入恶意行为和不符合以上条款的行为。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061", + "officialSlug": "agcapi-app-submit-0000001158245061", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-submit", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-submit --invoke --body body.json", + "show": "agc publishing app-submit --pretty" + } + }, + { + "documentation": { + "title": "通过下载方式提交发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092", + "updatedAt": "2026-01-21 16:29", + "checkedAt": "2026-10-07T02:52:28.134Z", + "status": "browser-read", + "readCommand": "agc publishing app-submit-with-file --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "app-submit-with-file", + "familyId": "publishing", + "name": "通过下载方式提交发布", + "description": "如果您将软件包保存在自己的服务器上,可以直接调用本接口提交应用审核,并传入软件包的下载地址。华为服务器会自动从下载地址中下载软件包后启动发布流程。接口调用者的角色:账号持有者、管理员、APP管理员。", + "method": "POST", + "path": "/api/publish/v2/app-submit-with-file", + "command": "agc publishing app-submit-with-file", + "requiredParams": [ + "appId", + "downloadUrl", + "downloadFileName", + "requestId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section5528235174214", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "releaseTime", + "in": "body", + "required": false, + "description": "指定发布时间,如果为空表示审核通过立即上架。UTC时间:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 300, + "type": "string", + "name": "remark", + "in": "body", + "required": false, + "description": "提交发布的备注信息,可以为空,如果填写,长度范围在10-300。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "enum": [ + "1", + "3" + ], + "type": "integer", + "name": "releaseType", + "in": "body", + "required": false, + "description": "发布方式。 取值范围: 1:全网。 3:分阶段。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "downloadUrl", + "in": "body", + "required": true, + "description": "由您提供的软件包下载地址,支持APK/RPK/AAB/EXE等。 APK:不超过4GB。 RPK:快应用不超过20MB,快游戏不超过30MB。 AAB:不超过150MB。 EXE(Windows应用): 不超过4GB。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "downloadFileName", + "in": "body", + "required": true, + "description": "downloadUrl下载地址中下载的文件名,包括后缀。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "callbackAddr", + "in": "body", + "required": false, + "description": "应用发布回调地址,由您自行配置。应用发布结果由华为服务器调用回调结果通知接口通过该URL回调给您的开发者服务器。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "您自定义的请求字符串,必须唯一标识此请求。结果回调时会携带该字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "clearArk", + "in": "body", + "required": false, + "description": "是否清除方舟包(用于Android + 方舟升级到Android)。 取值范围: 1:需要清除方舟包。 0:不需要清除方舟包。 默认值:0。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "sensitivePermissionDesc", + "in": "body", + "required": false, + "description": "敏感信息。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "state", + "in": "body", + "required": false, + "description": "此参数无需设置。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "phasedReleaseStartTime", + "in": "body", + "required": true, + "description": "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "phasedReleaseEndTime", + "in": "body", + "required": true, + "description": "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 10, + "type": "string", + "name": "phasedReleasePercent", + "in": "body", + "required": true, + "description": "分阶段发布百分比,取值范围为0.00到100.00,必须精确到两位小数,不含百分号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 500, + "type": "string", + "name": "phasedReleaseDescription", + "in": "body", + "required": true, + "description": "分阶段发布说明。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "object", + "name": "phasedReleaseInfo", + "in": "body", + "required": false, + "description": "分阶段发布信息。releaseType为3时,此参数必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "versionName", + "in": "body", + "required": false, + "description": "Windows应用的软件包版本号。 文件类型为exe软件包时必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "displayName", + "in": "body", + "required": false, + "description": "注册表显示名称,用于唯一标识Windows用。 文件类型为exe软件包时必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "isPureDetection", + "in": "body", + "required": false, + "description": "是否申请绿色应用认证。 取值范围: 0:否 1:是" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "string", + "name": "sensitivePermissionIconUrl", + "in": "body", + "required": false, + "description": "绿色认证审核材料的objectId,isPureDetection=1时为必填项。该值为将绿色认证审核材料打成zip包,然后先调用获取上传文件地址接口,然后调用上传文件接口上传审核材料,最后得到获取上传文件地址接口返回的objectId。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "type": "boolean", + "name": "isCommitSensitivePermissionTips", + "in": "body", + "required": false, + "description": "是否确认符合相关要求,true表示符合。isPureDetection=1时为必填项,且只可以填true。要求包括: 非必要的使用场景禁止桌面、锁屏和其他应用弹出窗口骚扰用户行为。 非必要的使用场景禁止发送无法删除的常驻通知。 禁止影响用户体验的广告,如抬头、强制插屏、侧边等。 禁止引导用户开启开发者选项。 禁止引导用户开启USB调试模式。 禁止通过热补丁,引入恶意行为和不符合以上条款的行为。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092", + "officialSlug": "agcapi-app-submit-with-file-0000001111845092", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-submit-with-file", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-submit-with-file --invoke --body body.json", + "show": "agc publishing app-submit-with-file --pretty" + } + }, + { + "documentation": { + "title": "查询应用包名对应的appid", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:11:13.650Z", + "status": "browser-read", + "readCommand": "agc publishing appid-list --docs --pretty" + }, + "id": "appid-list", + "familyId": "publishing", + "name": "查询应用包名对应的appid", + "description": "此接口用于根据HarmonyOS应用/元服务的应用包名查询对应的应用ID,支持一次查询多个应用包名。", + "method": "GET", + "path": "/api/publish/v2/appid-list", + "command": "agc publishing appid-list", + "requiredParams": [ + "packageName" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section19247123515514", + "maxLength": 4096, + "type": "string", + "name": "packageName", + "in": "query", + "required": true, + "description": "需要查询的应用包名。 多个包名以逗号分隔,最多支持50个。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section19247123515514", + "maxLength": 32, + "type": "string", + "name": "packageTypes", + "in": "query", + "required": false, + "description": "通过软件包类型过滤应用,只查询指定软件包类型的应用。 取值范围: 7:APP(HarmonyOS应用/元服务)" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617", + "officialSlug": "agc-help-publish-api-appid-list-0000002271000617", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/appid-list", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing appid-list --invoke", + "show": "agc publishing appid-list --pretty" + } + }, + { + "documentation": { + "title": "设置应用GMS依赖属性", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:29.328Z", + "status": "browser-read", + "readCommand": "agc publishing gms --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "gms", + "familyId": "publishing", + "name": "设置应用GMS依赖属性", + "description": "此接口用于向AGC上报应用是否依赖GMS。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", + "method": "PUT", + "path": "/api/publish/v2/properties/gms", + "command": "agc publishing gms", + "requiredParams": [ + "appId", + "needGms" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section165302018915", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section19652137562", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "needGms", + "in": "body", + "required": true, + "description": "应用是否依赖GMS。 取值范围: 0:不依赖 1:依赖" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094", + "officialSlug": "agcapi-gms-0000001111845094", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/gms", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing gms --invoke --body body.json", + "show": "agc publishing gms --pretty" + } + }, + { + "documentation": { + "title": "删除应用语言信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:29.656Z", + "status": "browser-read", + "readCommand": "agc publishing language-info-delete --docs --pretty" + }, + "id": "language-info-delete", + "familyId": "publishing", + "name": "删除应用语言信息", + "description": "此接口用于删除指定HarmonyOS应用/元服务不需要的语言描述信息,默认语言不支持删除。", + "method": "DELETE", + "path": "/api/publish/v2/app-language-info", + "command": "agc publishing language-info-delete", + "requiredParams": [ + "appId", + "lang" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section23242264517", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要删除语言描述信息的应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section23242264517", + "type": "string", + "name": "lang", + "in": "query", + "required": true, + "description": "需要删除的语言。 说明 取值参见语言类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section23242264517", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 默认值:1" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621", + "officialSlug": "agc-help-publish-api-language-info-delete-0000002271000621", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/language-info-delete", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing language-info-delete --invoke", + "show": "agc publishing language-info-delete --pretty" + } + }, + { + "documentation": { + "title": "更新语言描述信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:52.329Z", + "status": "browser-read", + "readCommand": "agc publishing language-info-update --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "language-info-update", + "familyId": "publishing", + "name": "更新语言描述信息", + "description": "此接口用于更新指定应用的语言描述信息,如果当前没有语言描述信息则新增。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", + "method": "PUT", + "path": "/api/publish/v2/app-language-info", + "command": "agc publishing language-info-update", + "requiredParams": [ + "appId", + "lang" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section41341319578", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要更新语言描述信息的应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section41341319578", + "enum": [ + "1", + "3" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 64, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言种类,取值参见语言类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 64, + "type": "string", + "name": "appName", + "in": "body", + "required": false, + "description": "对应语言的应用名称。新增一个语言种类时,此字段必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 8000, + "type": "string", + "name": "appDesc", + "in": "body", + "required": false, + "description": "对应语言的应用描述信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 80, + "type": "string", + "name": "briefInfo", + "in": "body", + "required": false, + "description": "对应语言的一句话简介。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 500, + "type": "string", + "name": "newFeatures", + "in": "body", + "required": false, + "description": "对应语言的新版本简介。" + } + ], + "body": "lang,appName,appDesc,briefInfo,newFeatures", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057", + "officialSlug": "agcapi-language-info-update-0000001158245057", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/language-info-update", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing language-info-update --invoke --body body.json", + "show": "agc publishing language-info-update --pretty" + } + }, + { + "documentation": { + "title": "查询软件包列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:53.792Z", + "status": "browser-read", + "readCommand": "agc publishing obbfile-package-list --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "obbfile-package-list", + "familyId": "publishing", + "name": "查询软件包列表", + "description": "此接口用于查询应用当前关联的软件包列表信息。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", + "method": "GET", + "path": "/api/publish/v2/package-list", + "command": "agc publishing obbfile-package-list", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237", + "type": "integer", + "name": "fromRecCount", + "in": "query", + "required": false, + "description": "查询起始记录号。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237", + "type": "integer", + "name": "maxReqCount", + "in": "query", + "required": false, + "description": "请求查询的软件包数。 取值范围:最大为100 默认值:10" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210", + "officialSlug": "agcapi-obbfile-package-list-0000001111685210", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/obbfile-package-list", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing obbfile-package-list --invoke", + "show": "agc publishing obbfile-package-list --pretty" + } + }, + { + "documentation": { + "title": "更新分阶段发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204", + "updatedAt": "2025-08-25 13:48", + "checkedAt": "2026-10-07T02:52:55.198Z", + "status": "browser-read", + "readCommand": "agc publishing phased-release --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "phased-release", + "familyId": "publishing", + "name": "更新分阶段发布", + "description": "此接口用于将分阶段发布修改为全网发布,或者更新分阶段发布的设置。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", + "method": "PUT", + "path": "/api/publish/v2/phased-release", + "command": "agc publishing phased-release", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section71521339132219", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section71521339132219", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "需要修改的发布方式。支持将分阶段发布修改为全网发布。 取值范围: 1:全网。 说明 如果选择全网发布,Body请传空对象{}。 3:分阶段。 默认值:3" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "type": "string", + "name": "state", + "in": "body", + "required": false, + "description": "分阶段发布的状态。 取值范围: SUSPEND:暂停。 RELEASE:恢复为发布中。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 64, + "type": "string", + "name": "phasedReleaseStartTime", + "in": "body", + "required": false, + "description": "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。已上架的分阶段发布应用,不允许修改开始时间。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 64, + "type": "string", + "name": "phasedReleaseEndTime", + "in": "body", + "required": false, + "description": "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 10, + "type": "string", + "name": "phasedReleasePercent", + "in": "body", + "required": false, + "description": "分阶段发布百分比。取值为大于0.00且小于100.00,必须精确到两位小数,不含百分号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 500, + "type": "string", + "name": "phasedReleaseDescription", + "in": "body", + "required": false, + "description": "分阶段发布说明。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204", + "officialSlug": "agcapi-phased-release-0000001111685204", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/phased-release", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing phased-release --invoke --body body.json", + "show": "agc publishing phased-release --pretty" + } + }, + { + "documentation": { + "title": "查询软件包编译状态", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:56.407Z", + "status": "browser-read", + "readCommand": "agc publishing query-aabfile --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "query-aabfile", + "familyId": "publishing", + "name": "查询软件包编译状态", + "description": "此接口用于查询软件包的编译状态。接口调用者的角色:账号持有者、管理员、APP管理员。", + "method": "GET", + "path": "/api/publish/v2/package/compile/status", + "command": "agc publishing query-aabfile", + "requiredParams": [ + "appId", + "pkgIds" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section165302018915", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section165302018915", + "type": "string", + "name": "pkgIds", + "in": "query", + "required": true, + "description": "待查询的软件包id,多个id之间用逗号分隔。 对应查询软件包列表接口返回的pkgVersion参数。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206", + "officialSlug": "agcapi-query-aabfile-0000001111685206", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/query-aabfile", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing query-aabfile --invoke", + "show": "agc publishing query-aabfile --pretty" + } + }, + { + "documentation": { + "title": "更新版本上架时间", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:48.314Z", + "status": "browser-read", + "readCommand": "agc publishing update-releasetime --docs --pretty" + }, + "id": "update-releasetime", + "familyId": "publishing", + "name": "更新版本上架时间", + "description": "此接口用于设置版本的上架时间。", + "method": "PUT", + "path": "/api/publish/v2/on-shelf-time", + "command": "agc publishing update-releasetime", + "requiredParams": [ + "appId", + "changeType", + "releaseTime", + "releaseType" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section165302018915", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section2357705386", + "enum": [ + "2", + "3" + ], + "type": "integer", + "name": "changeType", + "in": "body", + "required": true, + "description": "修改类型。 取值范围: 2:指定时间上架改为审核通过立即上架 3:变更定时上架时间" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section2357705386", + "type": "string", + "name": "releaseTime", + "in": "body", + "required": true, + "description": "指定的版本上架时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 changeType为3时有效。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section2357705386", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "body", + "required": true, + "description": "发布方式。 取值范围: 1:全网 目前支持全网及releasePhase为3的分阶段发布。" + } + ], + "body": "changeType,releaseTime,releaseType", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573", + "officialSlug": "agc-help-publish-api-update-release-time-0000002271160573", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/update-releasetime", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing update-releasetime --invoke --body body.json", + "show": "agc publishing update-releasetime --pretty" + } + }, + { + "documentation": { + "title": "查询团队账号下的成员角色列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T05:11:33.888Z", + "status": "browser-read", + "readCommand": "agc publishing members-role-list --docs --pretty" + }, + "id": "members-role-list", + "familyId": "publishing", + "name": "查询团队账号下的成员角色列表", + "description": "此接口用于查询团队账号下的成员角色列表和团队主账号的开发者信息。", + "method": "GET", + "path": "/api/publish/v3/members-role-list", + "command": "agc publishing members-role-list", + "requiredParams": [ + "fromPage", + "pageSize", + "languageCode" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section420734618165", + "minimum": 1, + "type": "integer", + "name": "fromPage", + "in": "query", + "required": true, + "description": "起始页。 最小值:1,表示从第1页开始查询。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section420734618165", + "minimum": 1, + "maximum": 50, + "type": "integer", + "name": "pageSize", + "in": "query", + "required": true, + "description": "每页查询的条数。 取值范围:[1,50]" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section420734618165", + "maxLength": 20, + "enum": [ + "zh_cn", + "en_us", + "ru_ru" + ], + "type": "string", + "name": "languageCode", + "in": "query", + "required": true, + "description": "语言码。 取值范围: zh_cn:中文 en_us:英文 ru_ru:俄语" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743", + "officialSlug": "agc-help-publish-api-teamid-member-list-0000002679253743", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/members-role-list", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing members-role-list --invoke", + "show": "agc publishing members-role-list --pretty" + } + }, + { + "documentation": { + "title": "更新应用基本信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:11:38.645Z", + "status": "browser-read", + "readCommand": "agc publishing app-info-update-v3 --docs --pretty" + }, + "rules": [ + { + "id": "ai-service-types", + "kind": "required_if", + "field": "body.aiTypes", + "when": { + "field": "body.isAiGenerate", + "equals": "1" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "message": "涉及AI生成合成服务时必须提供 aiTypes。", + "suggestion": "添加 --field aiTypes=JSON数组,按官网填写实际涉及的服务类型。" + }, + { + "id": "mainland-entity", + "kind": "required_if", + "field": "body.registeredEntity", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "message": "APP服务器在中国大陆时必须填写主办单位。", + "suggestion": "根据实际账号主体关系填写 registeredEntity(1或2)。" + }, + { + "id": "mainland-entity-name", + "kind": "required_if", + "field": "body.registeredEntityName", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "message": "APP服务器在中国大陆时必须填写主办单位名称。", + "suggestion": "填写实际主办单位名称 registeredEntityName。" + } + ], + "id": "app-info-update-v3", + "familyId": "publishing", + "name": "更新应用基本信息", + "description": "此接口用于更新指定HarmonyOS应用/元服务的应用详情。", + "method": "PUT", + "path": "/api/publish/v3/app-info", + "command": "agc publishing app-info-update-v3", + "requiredParams": [ + "appId", + "publishCountry", + "encrypted" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section886219295206", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要更新的应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section886219295206", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section886219295206", + "enum": [ + "0", + "3" + ], + "type": "integer", + "name": "releasePhase", + "in": "query", + "required": false, + "description": "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 16, + "type": "string", + "name": "defaultLang", + "in": "body", + "required": false, + "description": "应用的默认语言。 说明 取值参见语言类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "type": "integer", + "name": "harmonyChildType", + "in": "body", + "required": false, + "description": "HarmonyOS应用/元服务的二级分类。 固定ID。 说明 取值参见应用游戏分类。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "type": "integer", + "name": "kindMainTag", + "in": "body", + "required": false, + "description": "HarmonyOS应用/元服务主标签。 固定ID。 说明 取值参见应用游戏分类的“标签”列。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxItems": 4, + "itemsType": "integer", + "type": "array", + "name": "kindSubTags", + "in": "body", + "required": false, + "description": "HarmonyOS应用/元服务附属标签。 固定ID。最多可选4个附属标签。 说明 取值参见应用游戏分类的“标签”列。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 255, + "type": "string", + "name": "privacyPolicy", + "in": "body", + "required": false, + "description": "隐私政策网址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "appNetType", + "in": "body", + "required": false, + "description": "应用联网类型。 取值范围: 1:单机 2:网游 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 2048, + "type": "string", + "name": "publishCountry", + "in": "body", + "required": true, + "description": "应用发布国家的国家码。 多个国家以英文逗号分隔,例如:“CN,DE,MC”。 如果取值为“OTHER”,则表示当App Gallery支持的国家或地区列表中新增某个国家或地区时,应用将自动分发到新增的国家和地区。 注意 取值不能只包含OTHER。 如果国家码有设置非CN的地区,将存在个人信息出境的情况,具体请参考个人信息出境授权声明。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 16, + "type": "string", + "name": "appTariffType", + "in": "body", + "required": false, + "description": "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 支持设置多个,使用英文逗号分隔,例如“1,2,3”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 50, + "type": "string", + "name": "publicationNumber", + "in": "body", + "required": false, + "description": "版号信息。 此参数只支持游戏类应用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 255, + "type": "string", + "name": "developerWebsite", + "in": "body", + "required": false, + "description": "开发者官网。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "maxLength": 50, + "type": "string", + "name": "phone", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "maxLength": 50, + "type": "string", + "name": "email", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "maxLength": 50, + "type": "string", + "name": "qqNum", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "maxLength": 100, + "type": "string", + "name": "internalPath", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "type": "object", + "name": "customInfo", + "in": "body", + "required": false, + "description": "客服信息。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "maxLength": 32, + "type": "string", + "name": "appAdapters", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "maxLength": 16, + "enum": [ + "1" + ], + "type": "string", + "name": "remoteControl", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "itemsType": "object", + "type": "array", + "name": "deviceTypes", + "in": "body", + "required": false, + "description": "设备类型信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 256, + "type": "string", + "name": "privacyRightsUrl", + "in": "body", + "required": false, + "description": "隐私权利网址。 即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "enum": [ + "-1", + "0", + "1", + "2" + ], + "type": "integer", + "name": "registeredDclType", + "in": "body", + "required": false, + "description": "APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "enum": [ + "-1", + "1", + "2", + "3" + ], + "type": "integer", + "name": "registeredIdType", + "in": "body", + "required": false, + "description": "主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "registeredIdNumber", + "in": "body", + "required": false, + "description": "主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "registeredEntity", + "in": "body", + "required": false, + "description": "主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 若在版本提交时,该字段值选择“一致”,则主办单位名称和证件号,将直接复用开发者联盟注册账号信息。 若您提交的主办单位信息与联盟账号信息不一致,该字段值却选择了“一致”,则系统将自动判定为“不一致”,将会影响审核结果。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 1024, + "type": "string", + "name": "registeredEntityName", + "in": "body", + "required": false, + "description": "主办单位名称。 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 32, + "type": "string", + "name": "privacyAgreementId", + "in": "body", + "required": false, + "description": "隐私协议ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 512, + "type": "string", + "name": "userAgreementUrl", + "in": "body", + "required": false, + "description": "用户协议URL。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxItems": 5, + "itemsType": "string", + "type": "array", + "name": "userAgreementIds", + "in": "body", + "required": false, + "description": "用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "encrypted", + "in": "body", + "required": true, + "description": "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "isAiGenerate", + "in": "body", + "required": false, + "description": "是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "itemsType": "integer", + "type": "array", + "name": "aiTypes", + "in": "body", + "required": false, + "description": "涉及的AI生成合成服务类型。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景 说明 isAiGenerate取值为1(涉及)时,此参数必填。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 128, + "type": "string", + "name": "testUserName", + "in": "body", + "required": false, + "description": "应用审核信息的测试账号用户名。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号用户名。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 128, + "type": "string", + "name": "testUserPassword", + "in": "body", + "required": false, + "description": "应用审核信息的测试账号密码。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号密码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 300, + "type": "string", + "name": "appRemark", + "in": "body", + "required": false, + "description": "应用审核信息的备注。 提供有助于审核人员更准确、高效测试您应用的额外信息,比如在审核时需要的特别设置等。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 2000, + "type": "string", + "name": "selfTestVideos", + "in": "body", + "required": false, + "description": "应用审核信息的自测文件。 格式为JSON字符串,示例:{\"objectId1\":\"文件名1\",\"objectId2\":\"文件名2\"...} 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 最多可上传5个自测视频,总大小不超过500MB。 注意 此字段只支持元服务。 元服务需要与设备联动时,此参数必填。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "maxLength": 500, + "type": "string", + "name": "account", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "type": "object", + "name": "appReviewPhoneInfo", + "in": "body", + "required": false, + "description": "应用负责人的手机号信息。用于沟通审核问题。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "maxLength": 500, + "type": "string", + "name": "account", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "type": "object", + "name": "appReviewEmailInfo", + "in": "body", + "required": false, + "description": "应用负责人的邮箱账号信息。用于接收上架审核结果,应用整改或下架通知。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxLength": 256, + "type": "string", + "name": "appReviewName", + "in": "body", + "required": false, + "description": "应用负责人的姓名。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "maxLength": 32, + "type": "string", + "name": "packageId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "maxLength": 32, + "type": "string", + "name": "vocId", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "maxItems": 1000, + "itemsType": "object", + "type": "array", + "name": "versionVocs", + "in": "body", + "required": false, + "description": "应用版本已解决问题。 数组长度不超过1000。 说明 调用查询应用未处理的问题工单接口可以查询用户反馈的应用问题。如果在应用版本更新时某些问题已经解决,可以将这些问题提交审核,工单平台验证通过后会关闭工单。" + } + ], + "body": "defaultLang,harmonyChildType,kindMainTag,kindSubTags,privacyPolicy,appNetType,publishCountry,appTariffType,publicationNumber,developerWebsite,customInfo,deviceTypes,privacyRightsUrl,registeredDclType,registeredIdType,registeredIdNumber,registeredEntity,registeredEntityName,privacyAgreementId,userAgreementUrl,userAgreementIds,encrypted,isAiGenerate,aiTypes,testUserName,testUserPassword,appRemark,selfTestVideos,appReviewPhoneInfo,appReviewEmailInfo,appReviewName,versionVocs", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246", + "officialSlug": "agc-help-publish-api-appinfo-update-0000002236201246", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-info-update-v3", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-info-update-v3 --invoke --body body.json", + "show": "agc publishing app-info-update-v3 --pretty" + } + }, + { + "documentation": { + "title": "更新应用语言信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:27.457Z", + "status": "browser-read", + "readCommand": "agc publishing language-info-update-v3 --docs --pretty" + }, + "id": "language-info-update-v3", + "familyId": "publishing", + "name": "更新应用语言信息", + "description": "此接口用于更新指定的HarmonyOS应用/元服务的语言描述信息,如果当前没有语言描述信息则新增。", + "method": "PUT", + "path": "/api/publish/v3/app-language-info", + "command": "agc publishing language-info-update-v3", + "requiredParams": [ + "appId", + "lang" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section41341319578", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要更新语言描述信息的应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section41341319578", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section41341319578", + "enum": [ + "0", + "3" + ], + "type": "integer", + "name": "releasePhase", + "in": "query", + "required": false, + "description": "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言种类。 说明 取值参见语言类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "maxLength": 64, + "type": "string", + "name": "appName", + "in": "body", + "required": false, + "description": "对应语言的应用名称。 新增一个语言种类时,此字段必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "maxLength": 8000, + "type": "string", + "name": "appDesc", + "in": "body", + "required": false, + "description": "对应语言的应用描述信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "maxLength": 80, + "type": "string", + "name": "briefInfo", + "in": "body", + "required": false, + "description": "对应语言的一句话简介。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "maxLength": 500, + "type": "string", + "name": "newFeatures", + "in": "body", + "required": false, + "description": "对应语言的新版本简介。 说明 升级版本时,此参数必填。" + } + ], + "body": "lang,appName,appDesc,briefInfo,newFeatures", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569", + "officialSlug": "agc-help-publish-api-language-info-update-0000002271160569", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/language-info-update-v3", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing language-info-update-v3 --invoke --body body.json", + "show": "agc publishing language-info-update-v3 --pretty" + } + }, + { + "documentation": { + "title": "更新应用文件信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:31.723Z", + "status": "browser-read", + "readCommand": "agc publishing app-file-info-v3 --docs --pretty" + }, + "id": "app-file-info-v3", + "familyId": "publishing", + "name": "更新应用文件信息", + "description": "图片、视频等文件上传完成后,通过该接口刷新HarmonyOS应用/元服务的文件信息。", + "method": "PUT", + "path": "/api/publish/v3/app-file-info", + "command": "agc publishing app-file-info-v3", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section156021546155912", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要更新的应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section156021546155912", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section156021546155912", + "enum": [ + "0", + "3" + ], + "type": "integer", + "name": "releasePhase", + "in": "query", + "required": false, + "description": "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "objectIdList", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "fileInfoList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "appIconList", + "in": "body", + "required": false, + "description": "应用图标信息。 数组长度不超过20。 说明 应用图标必须与软件包中的应用图标一致,且需符合审核政策与应用文件要求。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "objectIdList", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "fileInfoList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "screenShotList", + "in": "body", + "required": false, + "description": "应用介绍截图信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "objectIdList", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "fileInfoList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "introVideoList", + "in": "body", + "required": false, + "description": "应用介绍视频信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "objectIdList", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "fileInfoList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "rcmdVideoList", + "in": "body", + "required": false, + "description": "推荐视频信息。 数组长度不超过20。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "objectIdList", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "fileInfoList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "rcmdPicList", + "in": "body", + "required": false, + "description": "推荐图片信息。 数组长度不超过20。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxLength": 512, + "type": "string", + "name": "elecCertificate", + "in": "body", + "required": false, + "description": "电子版本证书。" + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "certificateList", + "in": "body", + "required": false, + "description": "应用版权证书或代理证书。 数组长度不超过10。" + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "publicationList", + "in": "body", + "required": false, + "description": "版号证明。 数组长度不超过10。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "maxLength": 512, + "type": "string", + "name": "permissionName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "maxLength": 512, + "type": "string", + "name": "objectId", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "packagePermissionIntroVideoList", + "in": "body", + "required": false, + "description": "包权限使用场景说明视频。 数组长度不超过100。 说明 隐私权限说明的“权限描述”、“权限使用设备范围”和“权限使用理由”从上传的软件包体中读取,无需通过接口更新。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxLength": 512, + "type": "string", + "name": "otherCertificatesURL", + "in": "body", + "required": false, + "description": "授权书及其他材料文件压缩包的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 若文件格式不正确,提交发布时会出错,具体限制如下: 压缩包必须为zip格式,不超过200MB。 解压后的大小不超过1GB。 文件夹层级不超过3层。 只能包含JPG、JPEG、BMP格式图片和PDF格式的文件,累计不超过200个。 说明 此字段只支持HarmonyOS应用,不支持元服务。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "objectIdList", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "fileInfoList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "updateScreenShotList", + "in": "body", + "required": false, + "description": "更新截图素材。 数组长度不超过20。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "4", + "5", + "8", + "12", + "14", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true + }, + { + "itemsMaxLength": 512, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "objectIdList", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "fileInfoList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "maxItems": 20, + "itemsType": "object", + "type": "array", + "name": "updateVideoList", + "in": "body", + "required": false, + "description": "更新视频素材。 数组长度不超过20。" + } + ], + "body": "appIconList,screenShotList,introVideoList,rcmdVideoList,rcmdPicList,elecCertificate,certificateList,publicationList,packagePermissionIntroVideoList,otherCertificatesURL,updateScreenShotList,updateVideoList", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430", + "officialSlug": "agc-help-publish-api-app-file-info-update-0000002236041430", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-file-info-v3", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-file-info-v3 --invoke --body body.json", + "show": "agc publishing app-file-info-v3 --pretty" + } + }, + { + "documentation": { + "title": "更新应用软件包信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:46.452Z", + "status": "browser-read", + "readCommand": "agc publishing app-package-info-update --docs --pretty" + }, + "id": "app-package-info-update", + "familyId": "publishing", + "name": "更新应用软件包信息", + "description": "APP软件包上传完成后,通过该接口刷新HarmonyOS应用/元服务的软件包信息。", + "method": "PUT", + "path": "/api/publish/v3/app-package-info", + "command": "agc publishing app-package-info-update", + "requiredParams": [ + "appId", + "fileName", + "objectId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section156021546155912", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要更新的应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section156021546155912", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section156021546155912", + "enum": [ + "0", + "3" + ], + "type": "integer", + "name": "releasePhase", + "in": "query", + "required": false, + "description": "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1131102811712", + "maxLength": 255, + "type": "string", + "name": "fileName", + "in": "body", + "required": true, + "description": "文件名称,包括文件的后缀名。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1131102811712", + "maxLength": 512, + "type": "string", + "name": "objectId", + "in": "body", + "required": true, + "description": "文件在文件服务器中的对象ID。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + } + ], + "body": "fileName,objectId", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250", + "officialSlug": "agc-help-publish-api-app-package-info-update-0000002236201250", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-package-info-update", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-package-info-update --invoke --body body.json", + "show": "agc publishing app-package-info-update --pretty" + } + }, + { + "documentation": { + "title": "更新分阶段发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:50.500Z", + "status": "browser-read", + "readCommand": "agc publishing phased-release-update --docs --pretty" + }, + "id": "phased-release-update", + "familyId": "publishing", + "name": "更新分阶段发布", + "description": "此接口用于将分阶段发布修改为全网发布,或者更新分阶段发布的设置。", + "method": "PUT", + "path": "/api/publish/v2/version/phased-release", + "command": "agc publishing phased-release-update", + "requiredParams": [ + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "版本ID。 可从查询应用所有版本类型的版本列表接口返回的versionId参数中获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201", + "enum": [ + "3", + "4" + ], + "type": "integer", + "name": "releasePhase", + "in": "body", + "required": false, + "description": "分阶段发布标识。 取值范围: 3:分阶段。 4:分阶段转全网。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201", + "maxLength": 16, + "enum": [ + "SUSPEND", + "RELEASE" + ], + "type": "string", + "name": "state", + "in": "body", + "required": false, + "description": "分阶段发布的状态。 取值范围: SUSPEND:暂停。 RELEASE:恢复为发布中。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201", + "maxLength": 500, + "type": "string", + "name": "description", + "in": "body", + "required": false, + "description": "分阶段发布说明。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201", + "enum": [ + "2", + "3", + "4", + "5", + "6", + "7" + ], + "type": "integer", + "name": "phaseDay", + "in": "body", + "required": false, + "description": "更新分阶段天数。 取值范围2、3、4、5、6、7,对应分阶段发布比例加速到2%、5%、10%、20%、50%、100%。" + } + ], + "body": "versionId,releasePhase,state,description,phaseDay", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625", + "officialSlug": "agc-help-publish-api-phased-release-0000002271000625", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/phased-release-update", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing phased-release-update --invoke --body body.json", + "show": "agc publishing phased-release-update --pretty" + } + }, + { + "documentation": { + "title": "查询应用软件包信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:01.749Z", + "status": "browser-read", + "readCommand": "agc publishing app-package-info-query --docs --pretty" + }, + "id": "app-package-info-query", + "familyId": "publishing", + "name": "查询应用软件包信息", + "description": "此接口用于查询HarmonyOS应用/元服务的软件包信息。", + "method": "GET", + "path": "/api/publish/v2/app-package-info", + "command": "agc publishing app-package-info-query", + "requiredParams": [ + "appId", + "packageId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section165302018915", + "maxLength": 32, + "type": "string", + "name": "packageId", + "in": "query", + "required": true, + "description": "待查询的软件包ID。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469", + "officialSlug": "agc-help-publish-api-query-package-info-0000002328848469", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-package-info-query", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-package-info-query --invoke", + "show": "agc publishing app-package-info-query --pretty" + } + }, + { + "documentation": { + "title": "查询应用未处理的问题工单", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:19.563Z", + "status": "browser-read", + "readCommand": "agc publishing app-version-voc --docs --pretty" + }, + "id": "app-version-voc", + "familyId": "publishing", + "name": "查询应用未处理的问题工单", + "description": "此接口用于查询HarmonyOS应用/元服务未处理的问题工单。", + "method": "POST", + "path": "/api/publish/v1/app-voc/version-voc", + "command": "agc publishing app-version-voc", + "requiredParams": [ + "appId", + "pageNo", + "pageSize" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section11431111271820", + "maxLength": 32, + "type": "string", + "name": "vocId", + "in": "body", + "required": false, + "description": "工单ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section11431111271820", + "maxLength": 255, + "type": "string", + "name": "vocDesc", + "in": "body", + "required": false, + "description": "工单描述。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section11431111271820", + "minimum": 1, + "type": "integer", + "name": "pageNo", + "in": "body", + "required": true, + "description": "当前页。 最小值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section11431111271820", + "maximum": 100, + "type": "integer", + "name": "pageSize", + "in": "body", + "required": true, + "description": "每页数量。 最大值:100" + } + ], + "body": "vocId,vocDesc,pageNo,pageSize", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "officialSlug": "agc-help-publish-api-post-app-version-voc-0000002495233986", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-version-voc", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-version-voc --invoke --body body.json", + "show": "agc publishing app-version-voc --pretty" + } + }, + { + "documentation": { + "title": "查询需要上传的资质文件信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:24.391Z", + "status": "browser-read", + "readCommand": "agc publishing tag-qual-dependent --docs --pretty" + }, + "id": "tag-qual-dependent", + "familyId": "publishing", + "name": "查询需要上传的资质文件信息", + "description": "此接口用于查询元服务需要上传的所有资质文件信息。", + "method": "GET", + "path": "/api/publish/v2/tag-qual-dependent", + "command": "agc publishing tag-qual-dependent", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577", + "officialSlug": "agc-help-publish-api-query-tag-qual-dependent-0000002271160577", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/tag-qual-dependent", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing tag-qual-dependent --invoke", + "show": "agc publishing tag-qual-dependent --pretty" + } + }, + { + "documentation": { + "title": "提交资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:28.028Z", + "status": "browser-read", + "readCommand": "agc publishing qualification-review-create --docs --pretty" + }, + "id": "qualification-review-create", + "familyId": "publishing", + "name": "提交资质审核任务", + "description": "此接口用于提交元服务的资质审核任务。", + "method": "POST", + "path": "/api/publish/v2/qualification-review-task", + "command": "agc publishing qualification-review-create", + "requiredParams": [ + "appId", + "tagQualInfos" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "maxLength": 64, + "type": "string", + "name": "tagId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "maxLength": 32, + "type": "string", + "name": "taskId", + "in": "body", + "required": false + }, + { + "itemsRules": [ + { + "minDays": 30, + "id": "qualification_remaining_validity", + "kind": "minimum_remaining_days", + "field": "body.expireTime", + "when": { + "field": "body.validityType", + "equals": "0", + "default": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "message": "Custom qualification expiry must have more than 30 days remaining.", + "suggestion": "Use a real qualification expiry date in yyyy-MM-dd format with more than 30 days remaining; do not change the source certificate's validity." + } + ], + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxLength": 32, + "type": "string", + "name": "qualificationCode", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "maxLength": 128, + "type": "string", + "name": "objectId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "maxLength": 128, + "type": "string", + "name": "fileName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "type": "integer", + "name": "fileSize", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "maxLength": 128, + "type": "string", + "name": "sha256", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxItems": 10, + "itemsType": "object", + "type": "array", + "name": "qualificationFileInfos", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "validityType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxLength": 20, + "type": "string", + "format": "date", + "name": "startTime", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxLength": 20, + "type": "string", + "format": "date", + "name": "expireTime", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "maxItems": 10, + "itemsType": "object", + "type": "array", + "name": "qualificationInfos", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section2357705386", + "maxItems": 5, + "itemsType": "object", + "type": "array", + "name": "tagQualInfos", + "in": "body", + "required": true, + "description": "标签和标签对应的资质信息列表。 数组长度不超过5。" + } + ], + "body": "tagQualInfos", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", + "officialSlug": "agc-help-publish-api-post-qualification-review-0000002271000629", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/qualification-review-create", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing qualification-review-create --invoke --body body.json", + "show": "agc publishing qualification-review-create --pretty" + } + }, + { + "documentation": { + "title": "查询资质审核任务详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:44.080Z", + "status": "browser-read", + "readCommand": "agc publishing qualification-review-query --docs --pretty" + }, + "id": "qualification-review-query", + "familyId": "publishing", + "name": "查询资质审核任务详情", + "description": "此接口用于查询元服务的资质审核任务详情。", + "method": "GET", + "path": "/api/publish/v2/qualification-review-task", + "command": "agc publishing qualification-review-query", + "requiredParams": [ + "appId", + "tagIds" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section165302018915", + "maxLength": 256, + "type": "string", + "name": "tagIds", + "in": "query", + "required": true, + "description": "审核任务包含的标签ID列表,逗号分隔。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438", + "officialSlug": "agc-help-publish-api-get-qualification-review-0000002236041438", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/qualification-review-query", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing qualification-review-query --invoke", + "show": "agc publishing qualification-review-query --pretty" + } + }, + { + "documentation": { + "title": "修改资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:45.618Z", + "status": "browser-read", + "readCommand": "agc publishing qualification-review-update --docs --pretty" + }, + "id": "qualification-review-update", + "familyId": "publishing", + "name": "修改资质审核任务", + "description": "此接口用于修改元服务的资质审核任务。", + "method": "PUT", + "path": "/api/publish/v2/qualification-review-task", + "command": "agc publishing qualification-review-update", + "requiredParams": [ + "appId", + "tagQualInfos" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "maxLength": 64, + "type": "string", + "name": "tagId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "maxLength": 32, + "type": "string", + "name": "taskId", + "in": "body", + "required": true + }, + { + "itemsRules": [ + { + "minDays": 30, + "id": "qualification_remaining_validity", + "kind": "minimum_remaining_days", + "field": "body.expireTime", + "when": { + "field": "body.validityType", + "equals": "0", + "default": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "message": "Custom qualification expiry must have more than 30 days remaining.", + "suggestion": "Use a real qualification expiry date in yyyy-MM-dd format with more than 30 days remaining; do not change the source certificate's validity." + } + ], + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxLength": 32, + "type": "string", + "name": "qualificationCode", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "maxLength": 128, + "type": "string", + "name": "objectId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "maxLength": 128, + "type": "string", + "name": "fileName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "type": "integer", + "name": "fileSize", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "maxLength": 128, + "type": "string", + "name": "sha256", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxItems": 10, + "itemsType": "object", + "type": "array", + "name": "qualificationFileInfos", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "validityType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxLength": 20, + "type": "string", + "format": "date", + "name": "startTime", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "maxLength": 20, + "type": "string", + "format": "date", + "name": "expireTime", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "maxItems": 10, + "itemsType": "object", + "type": "array", + "name": "qualificationInfos", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section2357705386", + "maxItems": 5, + "itemsType": "object", + "type": "array", + "name": "tagQualInfos", + "in": "body", + "required": true, + "description": "标签和标签对应的资质信息列表。 数组长度不超过5。" + } + ], + "body": "tagQualInfos", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", + "officialSlug": "agc-help-publish-api-put-qualification-review-0000002422530746", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/qualification-review-update", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing qualification-review-update --invoke --body body.json", + "show": "agc publishing qualification-review-update --pretty" + } + }, + { + "documentation": { + "title": "撤销资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:47.305Z", + "status": "browser-read", + "readCommand": "agc publishing qualification-review-cancel --docs --pretty" + }, + "id": "qualification-review-cancel", + "familyId": "publishing", + "name": "撤销资质审核任务", + "description": "此接口用于撤销元服务的资质审核任务。", + "method": "PUT", + "path": "/api/publish/v2/qualification-review-task/cancel", + "command": "agc publishing qualification-review-cancel", + "requiredParams": [ + "appId", + "taskId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section2357705386", + "maxLength": 32, + "type": "string", + "name": "taskId", + "in": "body", + "required": true, + "description": "资质审核任务ID。" + } + ], + "body": "taskId", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258", + "officialSlug": "agc-help-publish-api-cancel-qualification-review-0000002236201258", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/qualification-review-cancel", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing qualification-review-cancel --invoke --body body.json", + "show": "agc publishing qualification-review-cancel --pretty" + } + }, + { + "documentation": { + "title": "删除资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:03.034Z", + "status": "browser-read", + "readCommand": "agc publishing qualification-review-delete --docs --pretty" + }, + "id": "qualification-review-delete", + "familyId": "publishing", + "name": "删除资质审核任务", + "description": "此接口用于删除元服务的资质审核任务。", + "method": "DELETE", + "path": "/api/publish/v2/qualification-review-task", + "command": "agc publishing qualification-review-delete", + "requiredParams": [ + "appId", + "tagIds" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section2357705386", + "maxItems": 5, + "itemsType": "string", + "type": "array", + "name": "tagIds", + "in": "body", + "required": true, + "description": "需要删除的资质审核标签ID列表,逗号分隔。 数组长度不超过5。 说明 具体取值请参见元服务的“标签ID”列。" + } + ], + "body": "tagIds", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788", + "officialSlug": "agc-help-publish-api-delete-qualification-review-0000002526538788", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/qualification-review-delete", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing qualification-review-delete --invoke", + "show": "agc publishing qualification-review-delete --pretty" + } + }, + { + "documentation": { + "title": "新建用户协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:04.732Z", + "status": "browser-read", + "readCommand": "agc publishing user-agreement-create --docs --pretty" + }, + "id": "user-agreement-create", + "familyId": "publishing", + "name": "新建用户协议", + "description": "此接口用于新建HarmonyOS应用/元服务的用户协议。", + "method": "POST", + "path": "/api/publish/v2/agreement", + "command": "agc publishing user-agreement-create", + "requiredParams": [ + "appId", + "type" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section11431111271820", + "enum": [ + "2" + ], + "type": "integer", + "name": "type", + "in": "body", + "required": true, + "description": "协议类型。 取值范围: 2:用户协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section11431111271820", + "maxLength": 20, + "type": "string", + "name": "defaultLang", + "in": "body", + "required": false, + "description": "用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "maxLength": 20, + "enum": [ + "zh", + "en", + "ug", + "bo", + "zh-Hant-HK", + "zh-Hant-TW" + ], + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "maxLength": 100, + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "maxLength": 100, + "type": "string", + "name": "agreementTitle", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "maxLength": 512, + "type": "string", + "name": "userAgreementUrl", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "type": "object", + "name": "baseInfo", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section11431111271820", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "agreementInfos", + "in": "body", + "required": false, + "description": "用户协议列表。 数组长度不超过100。" + }, + { + "type": "integer", + "name": "channel", + "in": "body", + "required": false, + "description": "官方创建用户协议请求样例中的渠道字段。" + } + ], + "body": "type,defaultLang,agreementInfos,channel", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581", + "officialSlug": "agc-help-publish-api-create-user-agreement-0000002271160581", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/user-agreement-create", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing user-agreement-create --invoke --body body.json", + "show": "agc publishing user-agreement-create --pretty" + } + }, + { + "documentation": { + "title": "查询用户协议列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:06.324Z", + "status": "browser-read", + "readCommand": "agc publishing user-agreement-list --docs --pretty" + }, + "id": "user-agreement-list", + "familyId": "publishing", + "name": "查询用户协议列表", + "description": "此接口用于查询HarmonyOS应用/元服务的用户协议信息。", + "method": "POST", + "path": "/api/publish/v2/agreement/list", + "command": "agc publishing user-agreement-list", + "requiredParams": [ + "appId", + "name" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386", + "minItems": 1, + "maxItems": 1000, + "itemsType": "string", + "type": "array", + "name": "agreementIdList", + "in": "body", + "required": false, + "description": "用户协议ID。 数组长度为1~1000。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386", + "maxLength": 100, + "allowEmpty": true, + "type": "string", + "name": "name", + "in": "body", + "required": true, + "description": "用户协议名称。 使用模糊查询方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386", + "enum": [ + "2", + "3" + ], + "type": "integer", + "name": "status", + "in": "body", + "required": false, + "description": "用户协议状态。 取值范围: 2:已完成 3:已删除" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386", + "enum": [ + "2" + ], + "type": "integer", + "name": "type", + "in": "body", + "required": false, + "description": "协议类型。 取值范围: 2:用户协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386", + "type": "integer", + "name": "fromRecCount", + "in": "body", + "required": false, + "description": "查询起始位置。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386", + "minimum": 1, + "maximum": 100, + "type": "integer", + "name": "maxReqCount", + "in": "body", + "required": false, + "description": "最大请求查询数。 取值范围:[1,100] 默认值:30" + } + ], + "body": "agreementIdList,name,status,type,fromRecCount,maxReqCount", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442", + "officialSlug": "agc-help-publish-api-query-user-agreement-0000002236041442", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/user-agreement-list", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing user-agreement-list --invoke --body body.json", + "show": "agc publishing user-agreement-list --pretty" + } + }, + { + "documentation": { + "title": "更新用户协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:18.109Z", + "status": "browser-read", + "readCommand": "agc publishing user-agreement-update --docs --pretty" + }, + "id": "user-agreement-update", + "familyId": "publishing", + "name": "更新用户协议", + "description": "此接口用于更新HarmonyOS应用/元服务的用户协议信息。", + "method": "PUT", + "path": "/api/publish/v2/agreement", + "command": "agc publishing user-agreement-update", + "requiredParams": [ + "appId", + "id" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section11431111271820", + "maxLength": 32, + "type": "string", + "name": "id", + "in": "body", + "required": true, + "description": "用户协议ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section11431111271820", + "maxLength": 20, + "type": "string", + "name": "defaultLang", + "in": "body", + "required": false, + "description": "用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "maxLength": 20, + "enum": [ + "zh", + "en", + "ug", + "bo", + "zh-Hant-HK", + "zh-Hant-TW" + ], + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "maxLength": 100, + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "maxLength": 100, + "type": "string", + "name": "agreementTitle", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "maxLength": 512, + "type": "string", + "name": "userAgreementUrl", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "type": "object", + "name": "baseInfo", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section11431111271820", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "agreementInfos", + "in": "body", + "required": false, + "description": "用户协议列表。 数组长度不超过100。" + } + ], + "body": "id,defaultLang,agreementInfos", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626", + "officialSlug": "agc-help-publish-api-update-user-agreement-0000002294845626", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/user-agreement-update", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing user-agreement-update --invoke --body body.json", + "show": "agc publishing user-agreement-update --pretty" + } + }, + { + "documentation": { + "title": "提交隐私政策协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:20.479Z", + "status": "browser-read", + "readCommand": "agc publishing privacy-agreement-submit --docs --pretty" + }, + "id": "privacy-agreement-submit", + "familyId": "publishing", + "name": "提交隐私政策协议", + "description": "此接口用于提交HarmonyOS应用/元服务的隐私政策协议。", + "method": "PUT", + "path": "/api/publish/v2/agreement/submit", + "command": "agc publishing privacy-agreement-submit", + "requiredParams": [ + "appId", + "id" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section1131102811712", + "maxLength": 32, + "type": "string", + "name": "id", + "in": "body", + "required": true, + "description": "隐私政策协议ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section1131102811712", + "enum": [ + "1", + "0" + ], + "type": "integer", + "name": "requireConfirm", + "in": "body", + "required": false, + "description": "是否弹窗确认。 取值范围: 1:是 0:否" + } + ], + "body": "id,requireConfirm", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633", + "officialSlug": "agc-help-publish-api-put-privacy-agreement-0000002271000633", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/privacy-agreement-submit", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing privacy-agreement-submit --invoke --body body.json", + "show": "agc publishing privacy-agreement-submit --pretty" + } + }, + { + "documentation": { + "title": "查询隐私政策协议列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:10:26.407Z", + "status": "browser-read", + "readCommand": "agc publishing privacy-agreement-list --docs --pretty" + }, + "id": "privacy-agreement-list", + "familyId": "publishing", + "name": "查询隐私政策协议列表", + "description": "此接口用于查询HarmonyOS应用/元服务的隐私政策协议信息。", + "method": "POST", + "path": "/api/publish/v2/agreement/list", + "command": "agc publishing privacy-agreement-list", + "requiredParams": [ + "appId", + "name" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386", + "minItems": 1, + "maxItems": 1000, + "itemsType": "string", + "type": "array", + "name": "agreementIdList", + "in": "body", + "required": false, + "description": "隐私政策协议ID。 数组长度为1~1000。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386", + "maxLength": 100, + "allowEmpty": true, + "type": "string", + "name": "name", + "in": "body", + "required": true, + "description": "隐私政策协议名称。 使用模糊查询方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386", + "enum": [ + "1", + "2", + "3" + ], + "type": "integer", + "name": "status", + "in": "body", + "required": false, + "description": "隐私政策协议状态。 取值范围: 1:草稿 2:已完成 3:已删除 不传值:默认查未删除的记录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386", + "enum": [ + "1" + ], + "type": "integer", + "name": "type", + "in": "body", + "required": false, + "description": "协议类型。 取值范围: 1:隐私政策协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386", + "type": "integer", + "name": "fromRecCount", + "in": "body", + "required": false, + "description": "起始页数。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386", + "minimum": 1, + "maximum": 100, + "type": "integer", + "name": "maxReqCount", + "in": "body", + "required": false, + "description": "每页返回条数。 取值范围:[1,100] 默认值:30" + } + ], + "body": "agreementIdList,name,status,type,fromRecCount,maxReqCount", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925", + "officialSlug": "agc-help-publish-api-query-privacy-agreement-0000002328924925", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/privacy-agreement-list", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing privacy-agreement-list --invoke --body body.json", + "show": "agc publishing privacy-agreement-list --pretty" + } + }, + { + "documentation": { + "title": "更新隐私政策协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:06:42.704Z", + "status": "browser-read", + "readCommand": "agc publishing privacy-agreement-update --docs --pretty" + }, + "id": "privacy-agreement-update", + "familyId": "publishing", + "name": "更新隐私政策协议", + "description": "此接口用于更新HarmonyOS应用/元服务的隐私政策协议。接口调用者的角色:账号持有者、管理员、APP管理员、运营。", + "method": "PUT", + "path": "/api/publish/v2/agreement", + "command": "agc publishing privacy-agreement-update", + "requiredParams": [ + "appId", + "id" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section11431111271820", + "maxLength": 32, + "type": "string", + "name": "id", + "in": "body", + "required": true, + "description": "隐私政策协议ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section11431111271820", + "maxLength": 20, + "type": "string", + "name": "defaultLang", + "in": "body", + "required": false, + "description": "隐私政策协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "maxLength": 20, + "enum": [ + "zh", + "en", + "ug", + "bo", + "zh-Hant-HK", + "zh-Hant-TW" + ], + "type": "string", + "name": "lang", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 100, + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 255, + "type": "string", + "name": "appName", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 1024, + "type": "string", + "name": "companyName", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 500, + "type": "string", + "name": "briefDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "type": "integer", + "name": "effectiveTime", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "type": "object", + "name": "baseInfo", + "in": "body", + "required": false + }, + { + "properties": [ + { + "properties": [ + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "sceneId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "sceneReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "collectModeId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "collectMode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "legalBasisId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "legalBasis", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "remark", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "sceneItems", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "type": "object", + "name": "requiredInfo", + "in": "body", + "required": false + }, + { + "properties": [ + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "sceneId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "sceneReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "collectModeId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "collectMode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "legalBasisId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "legalBasis", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "remark", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "sceneItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "maxLength": 500, + "type": "string", + "name": "closeSetting", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "type": "object", + "name": "recommendInfo", + "in": "body", + "required": false + }, + { + "properties": [ + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "sceneId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "sceneReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "collectModeId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "collectMode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "legalBasisId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "legalBasis", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "remark", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "sceneItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "maxLength": 500, + "type": "string", + "name": "pushContent", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "maxLength": 500, + "type": "string", + "name": "closeSetting", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "type": "object", + "name": "adsInfo", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string", + "name": "selectPath", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string", + "name": "personalCollectType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string", + "name": "basicServiceType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string", + "name": "extraServiceType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "type": "object", + "name": "fullServiceMode", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "maxLength": 500, + "type": "string", + "name": "serviceType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "maxLength": 500, + "type": "string", + "name": "personalCollectReason", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "maxLength": 100, + "type": "string", + "name": "serviceType", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "sceneId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "sceneReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "collectModeId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "collectMode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "legalBasisId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "legalBasis", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "remark", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "sceneItems", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "serviceTypeInfos", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "type": "object", + "name": "contractObligationMode", + "in": "body", + "required": false + }, + { + "properties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "maxLength": 100, + "type": "string", + "name": "serviceType", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "sceneId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "sceneReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "collectModeId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "collectMode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "legalBasisId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "legalBasis", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "remark", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "sceneItems", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "serviceTypeInfos", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "type": "object", + "name": "lawRegulationMode", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "type": "object", + "name": "personalInfo", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "maxLength": 100, + "type": "string", + "name": "permissionName", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "maxLength": 500, + "type": "string", + "name": "permissionDesc", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "minItems": 1, + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "permissions", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 64, + "type": "string", + "name": "reasonId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 500, + "type": "string", + "name": "reason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 100, + "type": "string", + "name": "groupId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 256, + "type": "string", + "name": "groupName", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "devicePermissions", + "in": "body", + "required": false + }, + { + "properties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string", + "name": "name", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string", + "name": "providerName", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string", + "name": "version", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 512, + "type": "string", + "name": "privacyDeclare", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "sceneId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "sceneReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "collectModeId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "collectMode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "legalBasisId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "legalBasis", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "remark", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "privacyLabels", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 200, + "type": "string", + "name": "scene", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string", + "name": "collectType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 500, + "type": "string", + "name": "purpose", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "maxItems": 50, + "itemsType": "object", + "type": "array", + "name": "sdkInfos", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "type": "object", + "name": "thirdSdkInfo", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 100, + "type": "string", + "name": "name", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 500, + "type": "string", + "name": "purpose", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 500, + "type": "string", + "name": "personalType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 1024, + "type": "string", + "name": "officialPrivacyUrl", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 100, + "type": "string", + "name": "serviceType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 200, + "type": "string", + "name": "scene", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 100, + "type": "string", + "name": "shareType", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "thirdSharedInfos", + "in": "body", + "required": false + }, + { + "properties": [ + { + "properties": [ + { + "itemsMaxLength": 100, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "email", + "in": "body", + "required": false + }, + { + "itemsMaxLength": 31, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "phoneNum", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "maxLength": 512, + "type": "string", + "name": "companyAddress", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "maxLength": 500, + "type": "string", + "name": "customContactInfo", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "type": "object", + "name": "contactInfo", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 512, + "type": "string", + "name": "storagePeriod", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 100, + "type": "string", + "name": "country", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "type": "boolean", + "name": "isCrossBorder", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 500, + "type": "string", + "name": "crossBorderReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 100, + "type": "string", + "name": "crossBorderReceiveName", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string", + "name": "itemId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string", + "name": "itemDesc", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sensitiveData", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "dataItems", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "sceneId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "sceneReason", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "collectModeId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "collectMode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string", + "name": "legalBasisId", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "legalBasis", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string", + "name": "remark", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxItems": 200, + "itemsType": "object", + "type": "array", + "name": "crossBorderDeclarations", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 100, + "type": "string", + "name": "crossBorderCountry", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "type": "object", + "name": "storageInfo", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "maxLength": 512, + "type": "string", + "name": "childPrivacyUrl", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "maxLength": 50, + "type": "string", + "name": "chapter", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "maxLength": 500, + "type": "string", + "name": "desc", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "itemsType": "object", + "type": "array", + "name": "versionChangeDescs", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "maxLength": 300, + "type": "string", + "name": "abstracts", + "in": "body", + "required": false + }, + { + "properties": [ + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "maxLength": 500, + "type": "string", + "name": "personalSettingPath", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "maxLength": 500, + "type": "string", + "name": "personalType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "type": "object", + "name": "infoAccess", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "maxLength": 500, + "type": "string", + "name": "personalSettingPath", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "maxLength": 500, + "type": "string", + "name": "personalType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "type": "object", + "name": "infoModify", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "maxLength": 500, + "type": "string", + "name": "personalSettingPath", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "maxLength": 500, + "type": "string", + "name": "personalType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "type": "object", + "name": "infoDelete", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "maxLength": 500, + "type": "string", + "name": "personalSettingPath", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "maxLength": 200, + "type": "string", + "name": "serviceType", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "type": "object", + "name": "infoCancel", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237", + "maxLength": 500, + "type": "string", + "name": "personalSettingPath", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "type": "object", + "name": "serviceStop", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "type": "object", + "name": "managePersonalInfo", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "maxLength": 100, + "type": "string", + "name": "title", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "maxLength": 5000, + "type": "string", + "name": "customInfoDesc", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "maxLength": 100, + "type": "string", + "name": "title", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "maxLength": 3000, + "type": "string", + "name": "customInfoDesc", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "maxItems": 5, + "itemsType": "object", + "type": "array", + "name": "customInfos", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "type": "object", + "name": "customInfo", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "maxLength": 8192, + "type": "string", + "name": "extField", + "in": "body", + "required": false + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "maxLength": 512, + "type": "string", + "name": "childPrivacyTitle", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "maxLength": 5000, + "type": "string", + "name": "childPrivacyCustomInfoDesc", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "type": "object", + "name": "extFieldCustomInfo", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "type": "object", + "name": "extInfo", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section11431111271820", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "agreementInfos", + "in": "body", + "required": false, + "description": "隐私政策协议列表。 数组长度不超过100。" + } + ], + "body": "id,defaultLang,agreementInfos", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169", + "officialSlug": "agc-help-publish-api-update-privacy-agreement-0000002328805169", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/privacy-agreement-update", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing privacy-agreement-update --invoke --body body.json", + "show": "agc publishing privacy-agreement-update --pretty" + } + }, + { + "documentation": { + "title": "申请年龄分级", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:45.706Z", + "status": "browser-read", + "readCommand": "agc publishing app-age-rating --docs --pretty" + }, + "id": "app-age-rating", + "familyId": "publishing", + "name": "申请年龄分级", + "description": "此接口用于申请或修改HarmonyOS应用/元服务的年龄分级。", + "method": "POST", + "path": "/api/publish/v2/app-age-rating", + "command": "agc publishing app-age-rating", + "requiredParams": [ + "appId", + "feedback" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID。 获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section23242264517", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section23242264517", + "enum": [ + "0", + "3" + ], + "type": "integer", + "name": "releasePhase", + "in": "query", + "required": false, + "description": "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "maxLength": 8192, + "type": "string", + "name": "feedback", + "in": "body", + "required": true, + "description": "问卷内容。 说明 具体请参见feedback获取方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "enum": [ + "1", + "2", + "3", + "4", + "5" + ], + "type": "integer", + "name": "expectedRating", + "in": "body", + "required": false, + "description": "预期年龄分级。 取值范围: 1:巴西适用所有年龄段,中国区及其他区域年满3周岁 2:中国区年满8周岁,巴西年满10周岁,其他区域年满7周岁 3:巴西年满14周岁,中国区及其他区域年满12周岁 4:年满16周岁 5:年满18周岁" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "ratingRule", + "in": "body", + "required": false, + "description": "年龄分级生效规则。 取值范围: 0:以问卷内容评级结果为准。 1:当预期年龄分级expectedRating设置的值大于问卷评级结果中的年龄值时,以预期年龄分级为准,否则以问卷内容评级结果为准。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "childFlag", + "in": "body", + "required": false, + "description": "应用是否仅面向儿童。 取值范围: 0:应用不仅面向儿童 1:应用仅面向儿童" + } + ], + "body": "feedback,expectedRating,ratingRule,childFlag", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262", + "officialSlug": "agc-help-publish-api-post-app-age-rating-0000002236201262", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-age-rating", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-age-rating --invoke --body body.json", + "show": "agc publishing app-age-rating --pretty" + } + }, + { + "documentation": { + "title": "提交发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:47.737Z", + "status": "browser-read", + "readCommand": "agc publishing app-submit-v3 --docs --pretty" + }, + "rules": [ + { + "id": "phased-release-description", + "kind": "required_if", + "field": "body.phasedReleaseDescription", + "when": { + "field": "body.releasePhase", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "message": "分阶段发布时必须提供 phasedReleaseDescription。", + "suggestion": "添加 --field phasedReleaseDescription=分阶段发布说明。" + } + ], + "id": "app-submit-v3", + "familyId": "publishing", + "name": "提交发布", + "description": "此接口用于提交HarmonyOS应用/元服务审核,调用本接口前必须保证应用信息已补充完整,应用软件包已经上传。", + "method": "POST", + "path": "/api/publish/v3/app-submit", + "command": "agc publishing app-submit-v3", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section292816392364", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "maxLength": 64, + "type": "string", + "name": "releaseTime", + "in": "body", + "required": false, + "description": "指定发布时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 可以不用填写,则表示立刻发布。 说明 如果在首次提交发布时已设置过releaseTime参数,撤销审核后再次提交发布时,需要将releaseTime参数重新设置为过去的时间,才能实现立即发布。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "maxLength": 300, + "type": "string", + "name": "remark", + "in": "body", + "required": false, + "description": "提审发布备注。 可以为空,如果填写则长度范围为10-300。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "body", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "enum": [ + "0", + "3" + ], + "type": "integer", + "name": "releasePhase", + "in": "body", + "required": false, + "description": "分阶段发布标识。 取值范围: 0:全网发布 3:分阶段发布(7天内自动更新) 默认值:0" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "maxLength": 500, + "type": "string", + "name": "phasedReleaseDescription", + "in": "body", + "required": false, + "description": "分阶段发布说明。 说明 releasePhase取值为3(分阶段发布)时,此参数必填。" + } + ], + "body": "releaseTime,remark,releaseType,releasePhase,phasedReleaseDescription", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585", + "officialSlug": "agc-help-publish-api-app-submit-0000002271160585", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-submit-v3", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-submit-v3 --invoke --body body.json", + "show": "agc publishing app-submit-v3 --pretty" + } + }, + { + "documentation": { + "title": "撤销审核", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:58:00.948Z", + "status": "browser-read", + "readCommand": "agc publishing on-shelf-cancel --docs --pretty" + }, + "id": "on-shelf-cancel", + "familyId": "publishing", + "name": "撤销审核", + "description": "此接口用于HarmonyOS应用/元服务的撤销审核,当应用发布方式为“全网”时,只有处于“审核中”、“预审中”、“升级审核中”、“待上架/预约上架”、“申请下架”状态的应用可以撤销审核;当应用发布方式为“HarmonyOS测试发布方式(API>=10)”时,只有处于“正在审核”状态的应用可以撤销审核。", + "method": "PUT", + "path": "/api/publish/v3/version/on-shelf/cancel", + "command": "agc publishing on-shelf-cancel", + "requiredParams": [ + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section13576204051611", + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "版本ID。" + } + ], + "body": "versionId", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637", + "officialSlug": "agc-help-publish-api-on-shelf-cancel-0000002271000637", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/on-shelf-cancel", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing on-shelf-cancel --invoke --body body.json", + "show": "agc publishing on-shelf-cancel --pretty" + } + }, + { + "documentation": { + "title": "下架应用", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450", + "updatedAt": "2026-07-31 09:08", + "checkedAt": "2026-10-07T04:58:02.750Z", + "status": "browser-read", + "readCommand": "agc publishing app-shelf-off --docs --pretty" + }, + "id": "app-shelf-off", + "familyId": "publishing", + "name": "下架应用", + "description": "此接口用于对已经上架的应用进行下架处理。", + "method": "POST", + "path": "/api/publish/v2/app-shelf-off", + "command": "agc publishing app-shelf-off", + "requiredParams": [ + "appId", + "reason" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section198511327144414", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要下架的应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section198511327144414", + "maxLength": 1024, + "type": "string", + "name": "reason", + "in": "query", + "required": true, + "description": "下架的原因描述。 说明 中文字符需要进行URL编码后再传入。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section198511327144414", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "下架的方式。 取值范围: 1:全网下架。 默认值:1" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450", + "officialSlug": "agc-help-publish-api-app-shelf-off-0000002236041450", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/publishing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/publishing/endpoints/app-shelf-off", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc publishing app-shelf-off --invoke --body body.json", + "show": "agc publishing app-shelf-off --pretty" + } + }, + { + "dynamicBody": { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "partObjectId", + "in": "body", + "required": true, + "description": "分段对象ID,必须与获取分片上传地址时返回的partObjectId一致。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "etag", + "in": "body", + "required": true, + "description": "上传分片实体时返回的分片的Etag值。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910", + "type": "object", + "name": "", + "in": "", + "required": true + }, + "dynamicBodyKeyPattern": "^additionalProp[1-9][0-9]*$", + "documentation": { + "title": "合并分片", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:52:57.559Z", + "status": "browser-read", + "readCommand": "agc upload obbfile-compose --docs --pretty" + }, + "id": "obbfile-compose", + "familyId": "upload", + "name": "合并分片", + "description": "此接口用于将已经上传成功后的分片合并为一个文件。", + "method": "POST", + "path": "/api/publish/v2/upload/multipart/compose", + "command": "agc upload obbfile-compose", + "requiredParams": [ + "objectId", + "nspUploadId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section0204135491218", + "type": "string", + "name": "objectId", + "in": "query", + "required": true, + "description": "对象ID,参见分片上传初始化时生成的objectId参数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section0204135491218", + "type": "string", + "name": "nspUploadId", + "in": "query", + "required": true, + "description": "上传ID,参见分片上传初始化时生成的nspUploadId参数。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098", + "officialSlug": "agcapi-obbfile-compose-0000001111845098", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/upload/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/upload/endpoints/obbfile-compose", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc upload obbfile-compose --invoke --body body.json", + "show": "agc upload obbfile-compose --pretty" + } + }, + { + "documentation": { + "title": "分片上传初始化", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:52:59.350Z", + "status": "browser-read", + "readCommand": "agc upload obbfile-init --docs --pretty" + }, + "rules": [ + { + "id": "obb-subtype-required", + "kind": "required_if", + "field": "query.obbType", + "when": { + "field": "query.fileType", + "equals": "2", + "default": "2" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "message": "OBB 文件必须提供 obbType;省略 fileType 时默认为 OBB。", + "suggestion": "OBB 添加 --query obbType=1 或 2;HarmonyOS APP 明确添加 --query fileType=1。" + }, + { + "id": "non-obb-subtype-forbidden-1", + "kind": "forbidden_if", + "field": "query.obbType", + "when": { + "field": "query.fileType", + "equals": "1" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "message": "非 OBB 文件不能传入 obbType。", + "suggestion": "移除 --query obbType;保留正确的 fileType。" + }, + { + "id": "non-obb-subtype-forbidden-3", + "kind": "forbidden_if", + "field": "query.obbType", + "when": { + "field": "query.fileType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "message": "非 OBB 文件不能传入 obbType。", + "suggestion": "移除 --query obbType;保留正确的 fileType。" + } + ], + "id": "obbfile-init", + "familyId": "upload", + "name": "分片上传初始化", + "description": "此接口用于分片信息初始化,在获取分片文件上传地址前调用。", + "method": "POST", + "path": "/api/publish/v2/upload/multipart/init", + "command": "agc upload obbfile-init", + "requiredParams": [ + "appId", + "fileName" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "type": "string", + "name": "fileName", + "in": "query", + "required": true, + "description": "原始文件名,需要带文件后缀。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "type": "string", + "name": "contentType", + "in": "query", + "required": false, + "description": "对象内容的类型,为http标准的content-type,例如image/jpeg。 如果不传,默认值:“application/octet-stream”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "enum": [ + "1", + "2", + "3" + ], + "type": "integer", + "name": "fileType", + "in": "query", + "required": false, + "description": "文件类型。 取值范围: 1:APP文件(HarmonyOS应用/元服务软件包)。 2:OBB(Android APK扩展文件)。 3:APK(Android软件包,含APK、AAB)。 默认值:2" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "obbType", + "in": "query", + "required": false, + "description": "OBB文件类型。 取值范围: 1:主扩展文件 2:补丁扩展文件 上传OBB文件时必填,非OBB文件不能传入此参数。上传OBB文件前,应用最新版本必须已经关联了APK包。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网发布。 6:HarmonyOS测试发布(API>=10)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "type": "integer", + "name": "chineseMainlandFlag", + "in": "query", + "required": false, + "description": "软件包是否分发中国大陆(不包括港澳台)。 取值范围: 0:不分发中国大陆 1:分发中国大陆 说明 当fileType为1且开发者注册地非中国大陆时,必须设置chineseMainlandFlag参数。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "officialSlug": "agcapi-obbfile-init-0000001158365055", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/upload/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/upload/endpoints/obbfile-init", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc upload obbfile-init --invoke --body body.json", + "show": "agc upload obbfile-init --pretty" + } + }, + { + "documentation": { + "title": "上传分片实体", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", + "updatedAt": "2025-12-02 17:24", + "checkedAt": "2026-10-07T02:53:00.764Z", + "status": "browser-read", + "readCommand": "agc upload obbfile-upload --docs --pretty" + }, + "id": "obbfile-upload", + "familyId": "upload", + "name": "上传分片实体", + "description": "将单个分片上传到获取分片上传地址接口返回的上传地址。", + "method": "PUT", + "path": "{uploadUrl}", + "command": "agc upload obbfile-upload", + "requiredParams": [ + "uploadUrl" + ], + "parameters": [ + { + "name": "uploadUrl", + "in": "path", + "required": true, + "description": "uploadUrl parameter" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", + "officialSlug": "agcapi-obbfile-upload-0000001158245067", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/upload/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/upload/endpoints/obbfile-upload", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc upload obbfile-upload --invoke --body body.json", + "show": "agc upload obbfile-upload --pretty" + } + }, + { + "dynamicBody": { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910", + "maxLength": 64, + "type": "string", + "name": "sha256", + "in": "body", + "required": false, + "description": "分片文件的sha256值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910", + "type": "integer", + "format": "int64", + "name": "length", + "in": "body", + "required": true, + "description": "分片文件大小,单位字节,必须与分片的实际大小一致。单个分片最大限制为100MB。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910", + "type": "object", + "name": "", + "in": "", + "required": true + }, + "dynamicBodyKeyPattern": "^additionalProp[1-9][0-9]*$", + "documentation": { + "title": "获取分片上传地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:53:02.499Z", + "status": "browser-read", + "readCommand": "agc upload obbfile-uploadurl --docs --pretty" + }, + "id": "obbfile-uploadurl", + "familyId": "upload", + "name": "获取分片上传地址", + "description": "此接口用于获取文件所有分片的上传地址,调用此接口前必须先调用 分片上传初始化 接口完成分片初始化。", + "method": "POST", + "path": "/api/publish/v2/upload/multipart/parts", + "command": "agc upload obbfile-uploadurl", + "requiredParams": [ + "objectId", + "nspUploadId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section420451011213", + "type": "string", + "name": "objectId", + "in": "query", + "required": true, + "description": "对象ID,必须与分片上传初始化时生成的objectId参数一致。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section420451011213", + "type": "string", + "name": "nspUploadId", + "in": "query", + "required": true, + "description": "上传ID,必须与分片上传初始化时生成的nspUploadId参数一致。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "officialSlug": "agcapi-obbfile-uploadurl-0000001111685208", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/upload/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/upload/endpoints/obbfile-uploadurl", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc upload obbfile-uploadurl --invoke --body body.json", + "show": "agc upload obbfile-uploadurl --pretty" + } + }, + { + "documentation": { + "title": "上传文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:53:04.769Z", + "status": "browser-read", + "readCommand": "agc upload upload-file-new --docs --pretty" + }, + "id": "upload-file-new", + "familyId": "upload", + "name": "上传文件", + "description": "将文件上传到获取文件上传地址接口返回的上传地址。", + "method": "PUT", + "path": "{uploadUrl}", + "command": "agc upload upload-file-new", + "requiredParams": [ + "uploadUrl" + ], + "parameters": [ + { + "name": "uploadUrl", + "in": "path", + "required": true, + "description": "uploadUrl parameter" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "officialSlug": "agcapi-upload-file-new-0000001111845090", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/upload/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/upload/endpoints/upload-file-new", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc upload upload-file-new --invoke --body body.json", + "show": "agc upload upload-file-new --pretty" + } + }, + { + "documentation": { + "title": "获取文件上传地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "updatedAt": "2026-05-26 15:34", + "checkedAt": "2026-10-07T02:53:06.315Z", + "status": "browser-read", + "readCommand": "agc upload upload-url-new --docs --pretty" + }, + "id": "upload-url-new", + "familyId": "upload", + "name": "获取文件上传地址", + "description": "上传文件至AppGallery Connect前需要先调用此接口获取上传地址,包括图片、视频、PDF等文件。", + "method": "GET", + "path": "/api/publish/v2/upload-url/for-obs", + "command": "agc upload upload-url-new", + "requiredParams": [ + "appId", + "fileName", + "contentLength" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "maxLength": 256, + "type": "string", + "name": "fileName", + "in": "query", + "required": true, + "description": "原始文件名,需包含文件后缀。主要用于在生成上传地址时获取原始文件后缀。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "maxLength": 64, + "type": "string", + "name": "sha256", + "in": "query", + "required": false, + "description": "文件内容的SHA256哈希值,如果传入此参数,文件在上传到文件服务器后会执行完整性校验。如果不传则不做校验。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "type": "integer", + "name": "contentLength", + "in": "query", + "required": true, + "description": "文件内容的大小,单位:字节。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "enum": [ + "1" + ], + "type": "integer", + "name": "releaseType", + "in": "query", + "required": false, + "description": "发布方式。 取值范围: 1:全网发布。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "chineseMainlandFlag", + "in": "query", + "required": false, + "description": "软件包是否分发中国大陆(不包括港澳台)。 取值范围: 0:不分发中国大陆 1:分发中国大陆 说明 当开发者注册地非中国大陆时,必须设置chineseMainlandFlag参数。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "officialSlug": "agcapi-upload-url-new-0000001111685200", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/upload/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/upload/endpoints/upload-url-new", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc upload upload-url-new --invoke", + "show": "agc upload upload-url-new --pretty" + } + }, + { + "documentation": { + "title": "批量添加设备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:26.284Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-add-device --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-add-device", + "familyId": "provisioning", + "name": "批量添加设备", + "description": "此接口用于批量添加调试/测试设备。", + "method": "POST", + "path": "/api/publish/v2/device", + "command": "agc provisioning provision-api-add-device", + "requiredParams": [ + "deviceList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "maxLength": 100, + "type": "string", + "name": "deviceName", + "in": "body", + "required": true, + "description": "设备名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "maxLength": 64, + "type": "string", + "name": "udid", + "in": "body", + "required": true, + "description": "设备UDID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "enum": [ + "1", + "2", + "4", + "5", + "8", + "19" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true, + "description": "设备类型。 取值范围: 1:运动手表 2:智能手表 4:手机 5:平板 8:智慧屏 19:PC/2in1" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section16551174881019", + "maxItems": 1000, + "itemsType": "object", + "type": "array", + "name": "deviceList", + "in": "body", + "required": true, + "description": "添加调试/测试设备的信息列表。 数组长度不超过1000。 说明 支持重新添加在过去一年内被删除的设备,只需输入新的deviceName,并输入原始的udid即可。" + } + ], + "body": "deviceList", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498", + "officialSlug": "agc-help-provision-api-add-device-0000002236041498", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-add-device", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-add-device --invoke --body body.json", + "show": "agc provisioning provision-api-add-device --pretty" + } + }, + { + "documentation": { + "title": "新增证书指纹", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:27.746Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-add-fingerprints --docs --pretty" + }, + "id": "provision-api-add-fingerprints", + "familyId": "provisioning", + "name": "新增证书指纹", + "description": "此接口用于新增证书指纹。", + "method": "POST", + "path": "/api/provision/v1/fingerprints", + "command": "agc provisioning provision-api-add-fingerprints", + "requiredParams": [ + "appId", + "fingerprintList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsMaxLength": 128, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section16551174881019", + "minItems": 1, + "maxItems": 50, + "itemsType": "string", + "type": "array", + "name": "fingerprintList", + "in": "body", + "required": true, + "description": "证书指纹列表。 最大长度50个。" + } + ], + "body": "fingerprintList", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480", + "officialSlug": "agc-help-provision-api-add-fingerprints-0000002431201480", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-add-fingerprints", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-add-fingerprints --invoke --body body.json", + "show": "agc provisioning provision-api-add-fingerprints --pretty" + } + }, + { + "documentation": { + "title": "申请证书", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:29.169Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-apply-cent --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-apply-cent", + "familyId": "provisioning", + "name": "申请证书", + "description": "此接口用于申请二进制证书、In-house发布证书、调试证书或发布证书。", + "method": "POST", + "path": "/api/publish/v3/cert", + "command": "agc provisioning provision-api-apply-cent", + "requiredParams": [ + "csr", + "certName", + "certType" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019", + "maxLength": 2048, + "type": "string", + "name": "csr", + "in": "body", + "required": true, + "description": "证书的CSR。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019", + "maxLength": 100, + "type": "string", + "name": "certName", + "in": "body", + "required": true, + "description": "证书名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019", + "enum": [ + "1", + "2", + "3", + "4" + ], + "type": "integer", + "name": "certType", + "in": "body", + "required": true, + "description": "证书类型。 取值范围: 1:调试 2:发布 3:In-house发布 4:二进制证书(用于二进制程序签名) 说明 二进制证书目前为受限开放,如需体验可通过在线工单系统与我们联系。 工单“问题分类”请选择“AppGallery Connect > 证书、APP ID和Profile > 证书”,并在“问题描述”中提供如下信息: 企业名称与资质 应用名称及APP ID 应用的业务场景与用途 申请的证书类型:二进制证书" + } + ], + "body": "csr,certName,certType", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302", + "officialSlug": "agc-help-provision-api-apply-cent-0000002236201302", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-apply-cent", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-apply-cent --invoke --body body.json", + "show": "agc provisioning provision-api-apply-cent --pretty" + } + }, + { + "documentation": { + "title": "申请Profile", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:31.554Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-apply-provision --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-apply-provision", + "familyId": "provisioning", + "name": "申请Profile", + "description": "此接口用于申请指定设备发布Profile、In-house发布Profile、调试Profile或发布Profile。", + "method": "POST", + "path": "/api/publish/v3/provision", + "command": "agc provisioning provision-api-apply-provision", + "requiredParams": [ + "provisionName", + "provisionType", + "certId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxLength": 256, + "type": "string", + "name": "provisionName", + "in": "body", + "required": true, + "description": "Profile名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "enum": [ + "1", + "2", + "3", + "6" + ], + "type": "integer", + "name": "provisionType", + "in": "body", + "required": true, + "description": "Profile类型。 取值范围: 1:调试 2:发布 3:In-house发布 6:指定设备发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxLength": 32, + "type": "string", + "name": "certId", + "in": "body", + "required": true, + "description": "证书ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxLength": 20, + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "应用ID。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxItems": 4000, + "itemsType": "string", + "type": "array", + "name": "deviceIdList", + "in": "body", + "required": false, + "description": "调试/测试设备ID列表。 可通过查询设备列表接口获取。 数组长度不超过4000。" + }, + { + "itemsMaxLength": 256, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxItems": 1000, + "itemsType": "string", + "type": "array", + "name": "aclPermissionList", + "in": "body", + "required": false, + "description": "受限ACL权限列表。 数组长度不超过1000。 说明 仅支持受限ACL权限已审核通过的应用使用,申请方式可参见申请受限ACL权限。" + } + ], + "body": "provisionName,provisionType,certId,appId,deviceIdList,aclPermissionList", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689", + "officialSlug": "agc-help-provision-api-apply-provision-0000002271000689", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-apply-provision", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-apply-provision --invoke --body body.json", + "show": "agc provisioning provision-api-apply-provision --pretty" + } + }, + { + "documentation": { + "title": "申请受限ACL权限", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:33.033Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-applyacl --docs --pretty" + }, + "id": "provision-api-applyacl", + "familyId": "provisioning", + "name": "申请受限ACL权限", + "description": "此接口用于申请受限ACL权限。", + "method": "POST", + "path": "/api/provision/v1/user/permission/apply", + "command": "agc provisioning provision-api-applyacl", + "requiredParams": [ + "appId", + "aclPermissionList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section16551174881019", + "type": "string", + "name": "attachment", + "in": "body", + "required": false, + "description": "附件的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756", + "maxLength": 256, + "type": "string", + "name": "name", + "in": "body", + "required": true, + "description": "受限ACL权限名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756", + "maxLength": 256, + "type": "string", + "name": "reason", + "in": "body", + "required": true, + "description": "受限ACL权限的申请理由。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section16551174881019", + "itemsType": "object", + "type": "array", + "name": "aclPermissionList", + "in": "body", + "required": true, + "description": "受限ACL权限申请列表。" + } + ], + "body": "attachment,aclPermissionList", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721", + "officialSlug": "agc-help-provision-api-applyacl-0000002502198721", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-applyacl", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-applyacl --invoke --body body.json", + "show": "agc provisioning provision-api-applyacl --pretty" + } + }, + { + "documentation": { + "title": "删除证书", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:34.515Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-delete-cent --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-delete-cent", + "familyId": "provisioning", + "name": "删除证书", + "description": "此接口用于删除创建的证书。", + "method": "POST", + "path": "/api/publish/v2/cert/delete", + "command": "agc provisioning provision-api-delete-cent", + "requiredParams": [ + "certIds" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section16551174881019", + "minItems": 1, + "maxItems": 100, + "itemsType": "string", + "type": "array", + "name": "certIds", + "in": "body", + "required": true, + "description": "证书ID列表。 数组长度为1~100。" + } + ], + "body": "certIds", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685", + "officialSlug": "agc-help-provision-api-delete-cent-0000002271000685", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-delete-cent", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-delete-cent --invoke --body body.json", + "show": "agc provisioning provision-api-delete-cent --pretty" + } + }, + { + "documentation": { + "title": "删除设备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:36.151Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-delete-device --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-delete-device", + "familyId": "provisioning", + "name": "删除设备", + "description": "此接口用于删除已添加的设备。", + "method": "POST", + "path": "/api/publish/v2/device/delete", + "command": "agc provisioning provision-api-delete-device", + "requiredParams": [ + "deviceIdList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section16551174881019", + "maxItems": 1000, + "itemsType": "string", + "type": "array", + "name": "deviceIdList", + "in": "body", + "required": true, + "description": "待删除的设备ID列表。 数组长度不超过1000。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633", + "officialSlug": "agc-help-provision-api-delete-device-0000002271160633", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-delete-device", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-delete-device --invoke --body body.json", + "show": "agc provisioning provision-api-delete-device --pretty" + } + }, + { + "documentation": { + "title": "删除证书指纹", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:38.114Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-delete-fingerprints --docs --pretty" + }, + "id": "provision-api-delete-fingerprints", + "familyId": "provisioning", + "name": "删除证书指纹", + "description": "此接口用于删除证书指纹。", + "method": "DELETE", + "path": "/api/provision/v1/fingerprints", + "command": "agc provisioning provision-api-delete-fingerprints", + "requiredParams": [ + "appId", + "fingerprintList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsMaxLength": 128, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section16551174881019", + "minItems": 1, + "maxItems": 50, + "itemsType": "string", + "type": "array", + "name": "fingerprintList", + "in": "body", + "required": true, + "description": "证书指纹列表。 最大长度50个。" + } + ], + "body": "fingerprintList", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925", + "officialSlug": "agc-help-provision-api-delete-fingerprints-0000002464839925", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-delete-fingerprints", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-delete-fingerprints --invoke", + "show": "agc provisioning provision-api-delete-fingerprints --pretty" + } + }, + { + "documentation": { + "title": "删除Profile", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:39.600Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-delete-provision --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-delete-provision", + "familyId": "provisioning", + "name": "删除Profile", + "description": "此接口用于删除申请的Profile。", + "method": "DELETE", + "path": "/api/publish/v2/provision", + "command": "agc provisioning provision-api-delete-provision", + "requiredParams": [ + "id" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section16551174881019", + "maxLength": 32, + "type": "string", + "name": "id", + "in": "query", + "required": true, + "description": "待删除Profile的ID。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310", + "officialSlug": "agc-help-provision-api-delete-provision-0000002236201310", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-delete-provision", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-delete-provision --invoke", + "show": "agc provisioning provision-api-delete-provision --pretty" + } + }, + { + "documentation": { + "title": "查询可申请的ACL权限列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:41.036Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-eligible-acl --docs --pretty" + }, + "id": "provision-api-eligible-acl", + "familyId": "provisioning", + "name": "查询可申请的ACL权限列表", + "description": "此接口用于查询指定APP ID下所有可申请的ACL权限列表。", + "method": "POST", + "path": "/api/provision/v1/user/permission/apply/list", + "command": "agc provisioning provision-api-eligible-acl", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019", + "maxLength": 10, + "enum": [ + "zh", + "en", + "ru" + ], + "type": "string", + "name": "lang", + "in": "body", + "required": false, + "description": "ACL权限的语言类型。 取值范围: zh:中文 en:英文 ru:俄语 默认值:zh" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019", + "minimum": 1, + "type": "integer", + "name": "start", + "in": "body", + "required": false, + "description": "起始页。 最小值:1,表示从第1页开始查询。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "每页返回条数。 取值范围:[1,1000] 默认值:10" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044", + "officialSlug": "agc-help-provision-api-eligible-acl-0000002554975044", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-eligible-acl", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-eligible-acl --invoke --body body.json", + "show": "agc provisioning provision-api-eligible-acl --pretty" + } + }, + { + "documentation": { + "title": "查询证书指纹", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:06.350Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-get-fingerprints --docs --pretty" + }, + "id": "provision-api-get-fingerprints", + "familyId": "provisioning", + "name": "查询证书指纹", + "description": "此接口用于查询已创建的证书指纹。", + "method": "GET", + "path": "/api/provision/v1/fingerprints", + "command": "agc provisioning provision-api-get-fingerprints", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316", + "officialSlug": "agc-help-provision-api-get-fingerprints-0000002431361316", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-get-fingerprints", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-get-fingerprints --invoke", + "show": "agc provisioning provision-api-get-fingerprints --pretty" + } + }, + { + "documentation": { + "title": "查询已申请的受限ACL权限", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:07.685Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-getacl --docs --pretty" + }, + "id": "provision-api-getacl", + "familyId": "provisioning", + "name": "查询已申请的受限ACL权限", + "description": "此接口用于查询申请的受限ACL权限信息。", + "method": "GET", + "path": "/api/provision/v1/user/permission", + "command": "agc provisioning provision-api-getacl", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113", + "officialSlug": "agc-help-provision-api-getacl-0000002465770113", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-getacl", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-getacl --invoke", + "show": "agc provisioning provision-api-getacl --pretty" + } + }, + { + "documentation": { + "title": "查询受限ACL权限的申请状态", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:09.046Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-getaclapplystatus --docs --pretty" + }, + "id": "provision-api-getaclapplystatus", + "familyId": "provisioning", + "name": "查询受限ACL权限的申请状态", + "description": "此接口用于查询受限ACL权限的申请状态,包含“申请中”和“审核通过”。", + "method": "GET", + "path": "/api/provision/v1/user/permission/apply/status", + "command": "agc provisioning provision-api-getaclapplystatus", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150", + "officialSlug": "agc-help-provision-api-getaclapplystatus-0000002469246150", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-getaclapplystatus", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-getaclapplystatus --invoke", + "show": "agc provisioning provision-api-getaclapplystatus --pretty" + } + }, + { + "documentation": { + "title": "查询证书", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:10.537Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-query-cent --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-query-cent", + "familyId": "provisioning", + "name": "查询证书", + "description": "此接口用于查询创建的证书。", + "method": "POST", + "path": "/api/publish/v3/cert/list", + "command": "agc provisioning provision-api-query-cent", + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section16551174881019", + "enum": [ + "1", + "2", + "3", + "4" + ], + "type": "integer", + "name": "certType", + "in": "body", + "required": false, + "description": "证书类型。 取值范围: 1:调试 2:发布 3:In-house发布 4:二进制证书(用于二进制程序签名)" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section16551174881019", + "minItems": 1, + "maxItems": 100, + "itemsType": "string", + "type": "array", + "name": "certIds", + "in": "body", + "required": false, + "description": "证书ID列表。 数组长度为1~100。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629", + "officialSlug": "agc-help-provision-api-query-cent-0000002271160629", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-query-cent", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-query-cent --invoke --body body.json", + "show": "agc provisioning provision-api-query-cent --pretty" + } + }, + { + "documentation": { + "title": "查询设备列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:12.058Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-query-device --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-query-device", + "familyId": "provisioning", + "name": "查询设备列表", + "description": "此接口用于查询当前设备的信息。", + "method": "GET", + "path": "/api/publish/v2/device/list", + "command": "agc provisioning provision-api-query-device", + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "maxLength": 256, + "type": "string", + "name": "deviceName", + "in": "query", + "required": false, + "description": "设备名称。 支持模糊查询。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "minimum": 1, + "type": "integer", + "name": "fromRecCount", + "in": "query", + "required": false, + "description": "起始页数。 取值范围:最小为1 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "minimum": 1, + "maximum": 100, + "type": "integer", + "name": "maxReqCount", + "in": "query", + "required": false, + "description": "每页返回条数。 取值范围:[1,100] 默认值:20" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "order", + "in": "query", + "required": false, + "description": "返回的结果排序方式。 取值范围: 1:创建时间降序 2:设备名称升序" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306", + "officialSlug": "agc-help-provision-api-query-device-0000002236201306", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-query-device", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-query-device --invoke", + "show": "agc provisioning provision-api-query-device --pretty" + } + }, + { + "documentation": { + "title": "查询Profile列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:13.513Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-query-provision --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-query-provision", + "familyId": "provisioning", + "name": "查询Profile列表", + "description": "此接口用于查询申请的Profile。", + "method": "GET", + "path": "/api/publish/v3/provision/list", + "command": "agc provisioning provision-api-query-provision", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "type": "string", + "name": "provisionId", + "in": "header", + "required": false, + "description": "Profile的ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section16551174881019", + "type": "integer", + "name": "fromRecCount", + "in": "query", + "required": false, + "description": "起始页数。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section16551174881019", + "minimum": 1, + "maximum": 100, + "type": "integer", + "name": "maxReqCount", + "in": "query", + "required": false, + "description": "每页返回条数。 取值范围:[1,100] 默认值:10" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506", + "officialSlug": "agc-help-provision-api-query-provision-0000002236041506", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-query-provision", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-query-provision --invoke", + "show": "agc provisioning provision-api-query-provision --pretty" + } + }, + { + "documentation": { + "title": "修改Profile绑定的设备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:14.683Z", + "status": "browser-read", + "readCommand": "agc provisioning provision-api-update-provision --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "provision-api-update-provision", + "familyId": "provisioning", + "name": "修改Profile绑定的设备", + "description": "此接口用于修改调试Profile绑定的调试设备,或者修改指定设备发布Profile绑定的测试设备。", + "method": "PUT", + "path": "/api/publish/v3/provision", + "command": "agc provisioning provision-api-update-provision", + "requiredParams": [ + "provisionId", + "deviceIdList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section16551174881019", + "maxLength": 32, + "type": "string", + "name": "provisionId", + "in": "body", + "required": true, + "description": "Profile的ID。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section16551174881019", + "minItems": 1, + "maxItems": 4000, + "itemsType": "string", + "type": "array", + "name": "deviceIdList", + "in": "body", + "required": true, + "description": "调试/测试设备ID列表。 可通过查询设备列表接口获取。 数组长度不超过4000。" + } + ], + "body": "provisionId,deviceIdList", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766", + "officialSlug": "agc-help-provision-api-update-provision-0000002469198766", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/provisioning/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/provisioning/endpoints/provision-api-update-provision", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc provisioning provision-api-update-provision --invoke --body body.json", + "show": "agc provisioning provision-api-update-provision --pretty" + } + }, + { + "documentation": { + "title": "下载域名配置文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:15.982Z", + "status": "browser-read", + "readCommand": "agc domains domain-api-download-domain-config --docs --pretty" + }, + "id": "domain-api-download-domain-config", + "familyId": "domains", + "name": "下载域名配置文件", + "description": "此接口用于以文件流的形式进行直接下载域名配置文件。", + "method": "GET", + "path": "/api/dms/domain-manage/v1/app/domain/verify-file", + "command": "agc domains domain-api-download-domain-config", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653", + "officialSlug": "agc-help-domain-api-download-domain-config-0000002271160653", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/domains/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/domains/endpoints/domain-api-download-domain-config", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc domains domain-api-download-domain-config --invoke", + "show": "agc domains domain-api-download-domain-config --pretty" + } + }, + { + "documentation": { + "title": "查询元服务的域名配置信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:17.291Z", + "status": "browser-read", + "readCommand": "agc domains domain-api-get-domain --docs --pretty" + }, + "id": "domain-api-get-domain", + "familyId": "domains", + "name": "查询元服务的域名配置信息", + "description": "此接口用于查询元服务的域名配置信息。", + "method": "GET", + "path": "/api/dms/domain-manage/v1/app/domain", + "command": "agc domains domain-api-get-domain", + "requiredParams": [ + "appId", + "category" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section886219295206", + "maxLength": 32, + "enum": [ + "server", + "business" + ], + "type": "string", + "name": "category", + "in": "query", + "required": true, + "description": "域名分类。 取值范围: server:服务器域名 business:业务域名" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701", + "officialSlug": "agc-help-domain-api-get-domain-0000002271000701", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/domains/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/domains/endpoints/domain-api-get-domain", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc domains domain-api-get-domain --invoke", + "show": "agc domains domain-api-get-domain --pretty" + } + }, + { + "documentation": { + "title": "查询域名修改次数/配置上限", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:18.730Z", + "status": "browser-read", + "readCommand": "agc domains domain-api-get-domain-config --docs --pretty" + }, + "id": "domain-api-get-domain-config", + "familyId": "domains", + "name": "查询域名修改次数/配置上限", + "description": "此接口用于查询域名修改次数、配置上限等信息。", + "method": "GET", + "path": "/api/dms/domain-manage/v1/app/domain/config", + "command": "agc domains domain-api-get-domain-config", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section886219295206", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "元服务的应用ID。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326", + "officialSlug": "agc-help-domain-api-get-domain-config-0000002236201326", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/domains/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/domains/endpoints/domain-api-get-domain-config", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc domains domain-api-get-domain-config --invoke", + "show": "agc domains domain-api-get-domain-config --pretty" + } + }, + { + "documentation": { + "title": "新增/更新元服务的域名配置信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:49.804Z", + "status": "browser-read", + "readCommand": "agc domains domain-api-post-domain --docs --pretty" + }, + "id": "domain-api-post-domain", + "familyId": "domains", + "name": "新增/更新元服务的域名配置信息", + "description": "此接口用于新增/更新元服务的域名配置信息。", + "method": "POST", + "path": "/api/dms/domain-manage/v1/app/domain", + "command": "agc domains domain-api-post-domain", + "requiredParams": [ + "appId", + "category" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section886219295206", + "maxLength": 32, + "enum": [ + "server", + "business" + ], + "type": "string", + "name": "category", + "in": "query", + "required": true, + "description": "域名分类。 取值范围: server:服务器域名 business:业务域名" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "maxLength": 32, + "enum": [ + "httpRequest", + "upload", + "download", + "webSocket", + "webView" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true, + "description": "域名类型。 取值范围: httpRequest:httpRequest服务器域名 upload:upload服务器域名 download:download服务器域名 webSocket:webSocket服务器域名 webView:webView业务域名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "maxLength": 128, + "type": "string", + "name": "value", + "in": "body", + "required": true, + "description": "完整的域名。例如: https://huawei.com:8080" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section141117691213", + "maxItems": 3000, + "itemsType": "object", + "type": "array", + "name": "domains", + "in": "body", + "required": false, + "description": "域名全量数据。 集合长度最大3000。" + } + ], + "body": "domains", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522", + "officialSlug": "agc-help-domain-api-post-domain-0000002236041522", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/domains/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/domains/endpoints/domain-api-post-domain", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc domains domain-api-post-domain --invoke --body body.json", + "show": "agc domains domain-api-post-domain --pretty" + } + }, + { + "documentation": { + "title": "预检查业务域名配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:50.960Z", + "status": "browser-read", + "readCommand": "agc domains domain-api-precheck --docs --pretty" + }, + "id": "domain-api-precheck", + "familyId": "domains", + "name": "预检查业务域名配置", + "description": "此接口用于对业务域名配置进行预检查。", + "method": "POST", + "path": "/api/dms/domain-manage/v1/app/domain/pre-check", + "command": "agc domains domain-api-precheck", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "maxLength": 32, + "enum": [ + "webView" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true, + "description": "域名类型。 取值范围: httpRequest:httpRequest服务器域名 upload:upload服务器域名 download:download服务器域名 webSocket:webSocket服务器域名 webView:webView业务域名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "maxLength": 128, + "type": "string", + "name": "value", + "in": "body", + "required": true, + "description": "完整的域名。例如: https://huawei.com:8080" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section141117691213", + "type": "object", + "name": "domain", + "in": "body", + "required": false, + "description": "业务域名信息。 说明 type必须设置为webView。" + } + ], + "body": "domain", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522", + "officialSlug": "agc-help-domain-api-precheck-0000002295134522", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/domains/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/domains/endpoints/domain-api-precheck", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc domains domain-api-precheck --invoke --body body.json", + "show": "agc domains domain-api-precheck --pretty" + } + }, + { + "documentation": { + "title": "生成邀请码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:54:52.317Z", + "status": "browser-read", + "readCommand": "agc testing test-api-add-invite-code --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-add-invite-code", + "familyId": "testing", + "name": "生成邀请码", + "description": "此接口用于邀请测试生成邀请码。", + "method": "POST", + "path": "/api/app-test/v1/invitation-code", + "command": "agc testing test-api-add-invite-code", + "requiredParams": [ + "appId", + "groupId", + "invitationCodeValidDays", + "invitationCodeInviteLimit" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "body", + "required": true, + "description": "测试群组ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213", + "type": "integer", + "name": "invitationCodeValidDays", + "in": "body", + "required": true, + "description": "邀请码有效期。 单位:天 邀请码仅支持30天有效。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213", + "type": "integer", + "name": "invitationCodeInviteLimit", + "in": "body", + "required": true, + "description": "邀请码可邀请人数上限。 最大值10000。" + } + ], + "body": "groupId,invitationCodeValidDays,invitationCodeInviteLimit", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342", + "officialSlug": "agc-help-test-api-add-invite-code-0000002236201342", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-add-invite-code", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-add-invite-code --invoke --body body.json", + "show": "agc testing test-api-add-invite-code --pretty" + } + }, + { + "documentation": { + "title": "新增测试群组", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:54:53.586Z", + "status": "browser-read", + "readCommand": "agc testing test-api-add-test-group --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-add-test-group", + "familyId": "testing", + "name": "新增测试群组", + "description": "此接口用于邀请测试创建内外部测试群组。", + "method": "POST", + "path": "/api/app-test/v1/test-group", + "command": "agc testing test-api-add-test-group", + "requiredParams": [ + "appId", + "groupName" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section141117691213", + "maxLength": 50, + "type": "string", + "name": "groupName", + "in": "body", + "required": true, + "description": "测试群组。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section141117691213", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "groupType", + "in": "body", + "required": false, + "description": "群组类别。 取值范围: 0: 外部群组(默认)。 1: 内部群组。" + } + ], + "body": "groupName,groupType", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661", + "officialSlug": "agc-help-test-api-add-test-group-0000002271160661", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-add-test-group", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-add-test-group --invoke --body body.json", + "show": "agc testing test-api-add-test-group --pretty" + } + }, + { + "documentation": { + "title": "新增测试群组成员", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:54:55.274Z", + "status": "browser-read", + "readCommand": "agc testing test-api-add-test-group-user --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-add-test-group-user", + "familyId": "testing", + "name": "新增测试群组成员", + "description": "此接口用于邀请测试新增测试群组成员。", + "method": "POST", + "path": "/api/publish/v2/test/user", + "command": "agc testing test-api-add-test-group-user", + "requiredParams": [ + "appId", + "groupId", + "hwAccount" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "body", + "required": true, + "description": "测试群组ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 64, + "type": "string", + "name": "nickName", + "in": "body", + "required": false, + "description": "需要添加到测试群组的成员昵称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 256, + "type": "string", + "name": "hwAccount", + "in": "body", + "required": true, + "description": "测试群组成员的华为账号、邮箱或者手机号。 手机号格式为:国家码-手机号 内部群组手机号格式为:0086手机号 外部群组手机号格式为:86-手机号" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 128, + "type": "string", + "name": "uid", + "in": "body", + "required": false, + "description": "联盟账号id,内部群组添加成员必填。" + } + ], + "body": "groupId,hwAccount,nickName,uid", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338", + "officialSlug": "agc-help-test-api-add-test-group-user-0000002236201338", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-add-test-group-user", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-add-test-group-user --invoke --body body.json", + "show": "agc testing test-api-add-test-group-user --pretty" + } + }, + { + "documentation": { + "title": "添加软件包", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:56.608Z", + "status": "browser-read", + "readCommand": "agc testing test-api-add-test-package --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-add-test-package", + "familyId": "testing", + "name": "添加软件包", + "description": "此接口用于测试版本上传软件包。", + "method": "POST", + "path": "/api/publish/v2/test/version/pkg", + "command": "agc testing test-api-add-test-package", + "requiredParams": [ + "appId", + "file" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section141117691213", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "distributeMode", + "in": "body", + "required": false, + "description": "软件包分发方式。 取值范围: 1:测试专区 2:应用市场" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549", + "maxLength": 255, + "type": "string", + "name": "fileName", + "in": "body", + "required": true, + "description": "文件名称,包括文件的后缀名。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549", + "maxLength": 1024, + "type": "string", + "name": "objectId", + "in": "body", + "required": true, + "description": "文件在文件服务器中的对象ID。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section141117691213", + "type": "object", + "name": "file", + "in": "body", + "required": true, + "description": "文件信息。" + } + ], + "body": "file,distributeMode", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330", + "officialSlug": "agc-help-test-api-add-test-package-0000002236201330", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-add-test-package", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-add-test-package --invoke --body body.json", + "show": "agc testing test-api-add-test-package --pretty" + } + }, + { + "documentation": { + "title": "新建测试版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:58.085Z", + "status": "browser-read", + "readCommand": "agc testing test-api-add-test-version --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-add-test-version", + "familyId": "testing", + "name": "新建测试版本", + "description": "此接口用于创建HarmonyOS应用/元服务的测试版本。", + "method": "POST", + "path": "/api/publish/v2/test/app/version", + "command": "agc testing test-api-add-test-version", + "requiredParams": [ + "appId", + "releaseType", + "testType", + "testDesc" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "type": "integer", + "name": "releaseType", + "in": "body", + "required": true, + "description": "HarmonyOS测试发布方式(API>=10)。 默认值:6" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "enum": [ + "3", + "4" + ], + "type": "integer", + "name": "testType", + "in": "body", + "required": true, + "description": "测试类型。 取值范围: 3:HarmonyOS邀请测试。 4:HarmonyOS公开测试。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "maxLength": 50, + "type": "string", + "name": "testDesc", + "in": "body", + "required": true, + "description": "测试版本描述。 最长50个字符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "onshelfSelfDetect", + "in": "body", + "required": false, + "description": "是否进行上架自检。 取值范围: 0:否。 1:是。 说明 选择“是”,将提交邀请测试并按照正式上架的审核要求自检,上架自检预计1天内完成。 选择“否”,将仅提交邀请测试审核,不进行正式上架自检。 上架自检不影响您邀请测试的上架结果。 一个应用有且仅支持存在一个上架自检中的任务,若存在上架自检中的任务时,再次创建邀请测试,该字段设置无效。" + } + ], + "body": "releaseType,testType,testDesc,onshelfSelfDetect", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526", + "officialSlug": "agc-help-test-api-add-test-version-0000002236041526", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-add-test-version", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-add-test-version --invoke --body body.json", + "show": "agc testing test-api-add-test-version --pretty" + } + }, + { + "documentation": { + "title": "创建公开链接", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T05:04:13.887Z", + "status": "browser-read", + "readCommand": "agc testing test-api-create-open-test-link --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-create-open-test-link", + "familyId": "testing", + "name": "创建公开链接", + "description": "此接口用于创建群组级公开测试链接。", + "method": "POST", + "path": "/api/app-test/v1/test-group/public-link", + "command": "agc testing test-api-create-open-test-link", + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-create-open-test-link-0000002665117715", + "officialSlug": "agc-help-test-api-create-open-test-link-0000002665117715", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-create-open-test-link", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-create-open-test-link --invoke --body body.json", + "show": "agc testing test-api-create-open-test-link --pretty" + } + }, + { + "documentation": { + "title": "删除测试问题反馈", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:01.149Z", + "status": "browser-read", + "readCommand": "agc testing test-api-delete-feedback --docs --pretty" + }, + "id": "test-api-delete-feedback", + "familyId": "testing", + "name": "删除测试问题反馈", + "description": "此接口用于删除测试问题反馈。", + "method": "DELETE", + "path": "/api/app-test/v1/mgmt/tester-feedback", + "command": "agc testing test-api-delete-feedback", + "requiredParams": [ + "delFeedBackInfos", + "deleteMode" + ], + "parameters": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324", + "maxLength": 32, + "type": "string", + "name": "problemId", + "in": "body", + "required": true, + "description": "问题ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324", + "maxLength": 32, + "type": "string", + "name": "testerId", + "in": "body", + "required": true, + "description": "测试用户ID。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "itemsType": "object", + "type": "array", + "name": "delFeedBackInfos", + "in": "body", + "required": true, + "description": "待删除问题反馈信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "deleteMode", + "in": "body", + "required": true, + "description": "删除模式,1-仅删除反馈,2-删除反馈+测试用户。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668", + "officialSlug": "agc-help-test-api-delete-feedback-0000002634718668", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-delete-feedback", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-delete-feedback --invoke", + "show": "agc testing test-api-delete-feedback --pretty" + } + }, + { + "documentation": { + "title": "删除邀请码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:02.651Z", + "status": "browser-read", + "readCommand": "agc testing test-api-delete-invite-code --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-delete-invite-code", + "familyId": "testing", + "name": "删除邀请码", + "description": "此接口用于邀请测试删除邀请码。", + "method": "DELETE", + "path": "/api/app-test/v1/invitation-code", + "command": "agc testing test-api-delete-invite-code", + "requiredParams": [ + "appId", + "invitationCodeId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section162251741185115", + "type": "string", + "name": "invitationCodeId", + "in": "query", + "required": true, + "description": "待删除的邀请码ID;参数表缺漏,Query位置由官方请求示例确认。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570", + "officialSlug": "agc-help-test-api-delete-invite-code-0000002634878570", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-delete-invite-code", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-delete-invite-code --invoke", + "show": "agc testing test-api-delete-invite-code --pretty" + } + }, + { + "documentation": { + "title": "删除测试群组", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:22.144Z", + "status": "browser-read", + "readCommand": "agc testing test-api-delete-test-group --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-delete-test-group", + "familyId": "testing", + "name": "删除测试群组", + "description": "此接口用于邀请测试删除测试群组。", + "method": "DELETE", + "path": "/api/app-test/v1/publish-api/test-group", + "command": "agc testing test-api-delete-test-group", + "requiredParams": [ + "appId", + "groupId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "query", + "required": true, + "description": "测试群组ID。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534", + "officialSlug": "agc-help-test-api-delete-test-group-0000002236041534", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-delete-test-group", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-delete-test-group --invoke", + "show": "agc testing test-api-delete-test-group --pretty" + } + }, + { + "documentation": { + "title": "删除测试群组成员", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:23.289Z", + "status": "browser-read", + "readCommand": "agc testing test-api-delete-test-group-user --docs --pretty" + }, + "id": "test-api-delete-test-group-user", + "familyId": "testing", + "name": "删除测试群组成员", + "description": "此接口用于邀请测试删除测试群组中的成员。", + "method": "DELETE", + "path": "/api/publish/v2/test/user", + "command": "agc testing test-api-delete-test-group-user", + "requiredParams": [ + "appId", + "deleteTesterIds", + "groupId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "itemsMaxLength": 100, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section141117691213", + "maxItems": 100, + "itemsType": "string", + "type": "array", + "name": "deleteTesterIds", + "in": "body", + "required": true, + "description": "需要删除的测试成员的ID列表。 数组长度不超过100。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "body", + "required": true, + "description": "测试群组ID。" + } + ], + "body": "groupId,deleteTesterIds", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721", + "officialSlug": "agc-help-test-api-delete-test-group-user-0000002271000721", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-delete-test-group-user", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-delete-test-group-user --invoke", + "show": "agc testing test-api-delete-test-group-user --pretty" + } + }, + { + "documentation": { + "title": "删除测试版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:55:24.555Z", + "status": "browser-read", + "readCommand": "agc testing test-api-delete-test-version --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-delete-test-version", + "familyId": "testing", + "name": "删除测试版本", + "description": "此接口用于删除测试版本。", + "method": "DELETE", + "path": "/api/publish/v2/test/app/version", + "command": "agc testing test-api-delete-test-version", + "requiredParams": [ + "versionId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section6641436115716", + "type": "string", + "name": "versionId", + "in": "query", + "required": true, + "description": "测试版本ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346", + "officialSlug": "agc-help-test-api-delete-test-version-0000002236201346", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-delete-test-version", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-delete-test-version --invoke", + "show": "agc testing test-api-delete-test-version --pretty" + } + }, + { + "documentation": { + "title": "修改公开链接", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:25.938Z", + "status": "browser-read", + "readCommand": "agc testing test-api-edit-open-test-link --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-edit-open-test-link", + "familyId": "testing", + "name": "修改公开链接", + "description": "此接口用于编辑群组级公开测试链接。", + "method": "PUT", + "path": "/api/app-test/v1/test-group/public-link", + "command": "agc testing test-api-edit-open-test-link", + "requiredParams": [ + "groupId", + "status" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716", + "type": "string", + "name": "groupId", + "in": "body", + "required": true, + "description": "群组ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716", + "type": "integer", + "name": "limit", + "in": "body", + "required": false, + "description": "允许通过此公开链接加入群的数量限制,传null表示不限制。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "status", + "in": "body", + "required": true, + "description": "链接状态。 取值范围: 1:生效 2:失效" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666", + "officialSlug": "agc-help-test-api-edit-open-test-link-0000002634718666", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-edit-open-test-link", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-edit-open-test-link --invoke --body body.json", + "show": "agc testing test-api-edit-open-test-link --pretty" + } + }, + { + "documentation": { + "title": "修改测试群组", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:27.137Z", + "status": "browser-read", + "readCommand": "agc testing test-api-edit-test-group --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-edit-test-group", + "familyId": "testing", + "name": "修改测试群组", + "description": "此接口用于邀请测试修改测试群组。", + "method": "PUT", + "path": "/api/app-test/v2/test-group", + "command": "agc testing test-api-edit-test-group", + "requiredParams": [ + "appId", + "groupId", + "groupName" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "body", + "required": true, + "description": "测试群组ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section141117691213", + "maxLength": 50, + "type": "string", + "name": "groupName", + "in": "body", + "required": true, + "description": "群组名称。" + } + ], + "body": "groupId,groupName", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664", + "officialSlug": "agc-help-test-api-edit-test-group-0000002634718664", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-edit-test-group", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-edit-test-group --invoke --body body.json", + "show": "agc testing test-api-edit-test-group --pretty" + } + }, + { + "documentation": { + "title": "查询上架自检报告信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:55:28.305Z", + "status": "browser-read", + "readCommand": "agc testing test-api-get-detect-task --docs --pretty" + }, + "id": "test-api-get-detect-task", + "familyId": "testing", + "name": "查询上架自检报告信息", + "description": "此接口用于查询邀请测试进行上架自检的报告信息。", + "method": "GET", + "path": "/api/publish/v2/test/app/version/detect-report", + "command": "agc testing test-api-get-detect-task", + "requiredParams": [ + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section141117691213", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section141117691213", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "query", + "required": true, + "description": "测试版本ID。 可从新建测试版本接口返回的versionId参数中获取。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189", + "officialSlug": "agc-help-test-api-get-detect-task-0000002525033189", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-get-detect-task", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-get-detect-task --invoke", + "show": "agc testing test-api-get-detect-task --pretty" + } + }, + { + "documentation": { + "title": "查询测试群组邀请码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:29.470Z", + "status": "browser-read", + "readCommand": "agc testing test-api-get-invite-code --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-get-invite-code", + "familyId": "testing", + "name": "查询测试群组邀请码", + "description": "此接口用于邀请测试查询测试群组邀请码信息。", + "method": "GET", + "path": "/api/app-test/v1/test-group/invitation-code", + "command": "agc testing test-api-get-invite-code", + "requiredParams": [ + "appId", + "groupId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "query", + "required": true, + "description": "测试群组ID。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669", + "officialSlug": "agc-help-test-api-get-invite-code-0000002271160669", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-get-invite-code", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-get-invite-code --invoke", + "show": "agc testing test-api-get-invite-code --pretty" + } + }, + { + "documentation": { + "title": "查询测试群组列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:30.803Z", + "status": "browser-read", + "readCommand": "agc testing test-api-get-test-grouplist --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-get-test-grouplist", + "familyId": "testing", + "name": "查询测试群组列表", + "description": "此接口用于邀请测试查询已创建的内外部测试群组列表。", + "method": "GET", + "path": "/api/app-test/v1/test-group/list", + "command": "agc testing test-api-get-test-grouplist", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "groupType", + "in": "query", + "required": false, + "description": "群组类别。 取值范围: 0: 外部群组(默认)。 1: 内部群组。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213", + "type": "integer", + "name": "current", + "in": "query", + "required": false, + "description": "当前页。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213", + "type": "integer", + "name": "pageSize", + "in": "query", + "required": false, + "description": "每页数。 默认值:10" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717", + "officialSlug": "agc-help-test-api-get-test-grouplist-0000002271000717", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-get-test-grouplist", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-get-test-grouplist --invoke", + "show": "agc testing test-api-get-test-grouplist --pretty" + } + }, + { + "documentation": { + "title": "更新测试版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:32.017Z", + "status": "browser-read", + "readCommand": "agc testing test-api-modify-test-version --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + }, + { + "id": "testing-ai-types", + "kind": "required_if", + "field": "body.extInfo.aiTypes", + "when": { + "field": "body.extInfo.isAiGenerate", + "equals": "1" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "message": "AI-generated services require aiTypes.", + "suggestion": "Supply the documented AI service types in extInfo.aiTypes." + } + ], + "id": "test-api-modify-test-version", + "familyId": "testing", + "name": "更新测试版本", + "description": "此接口用于更新已创建的测试版本。", + "method": "PUT", + "path": "/api/publish/v2/test/app/version", + "command": "agc testing test-api-modify-test-version", + "requiredParams": [ + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "需要更新的测试版本ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxLength": 32, + "type": "string", + "name": "pkgId", + "in": "body", + "required": false, + "description": "需要上传的软件包ID。 说明 请确保上传的软件包是正常状态,即确认查询软件包编译状态接口中的响应参数successStatus为0。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 20, + "type": "string", + "name": "language", + "in": "body", + "required": true, + "description": "应用支持的语言。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 255, + "minLength": 2, + "type": "string", + "name": "appName", + "in": "body", + "required": false, + "description": "应用名称。 不少于2个字符,否则应用信息不完整。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 8000, + "minLength": 2, + "type": "string", + "name": "appDesc", + "in": "body", + "required": true, + "description": "对应语言的应用介绍。 不少于2个字符,否则应用信息不完整。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 256, + "minLength": 1, + "type": "string", + "name": "briefInfo", + "in": "body", + "required": false, + "description": "应用简介,用于新增应用一句话介绍。 不少于1个字符,否则应用信息不完整。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 1024, + "type": "string", + "name": "newFeatures", + "in": "body", + "required": true, + "description": "测试说明,描述测试版本的重点特性。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 1024, + "type": "string", + "name": "formalVersionNewFeatures", + "in": "body", + "required": false, + "description": "描述正式版本的重点特性。 当为测试版本时,该字段表示后续转成正式版本的新版本特性描述。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "enum": [ + "4", + "5", + "12", + "14" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true, + "description": "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "maxLength": 300, + "minLength": 1, + "type": "string", + "name": "appIcon", + "in": "body", + "required": false, + "description": "应用图标下载地址。 不少于1个字符,否则应用信息不完整。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + }, + { + "itemsMaxLength": 300, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "minItems": 3, + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "screenShots", + "in": "body", + "required": false, + "description": "应用截屏地址。 不少于1个字符,否则应用信息不完整。 多个地址以英文逗号隔开,最多不超过10个地址,最少不少于3个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "showType", + "in": "body", + "required": false, + "description": "截图展现方式。 取值范围: 0:竖屏 1:横屏" + }, + { + "itemsMaxLength": 300, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "maxItems": 10, + "itemsType": "string", + "type": "array", + "name": "promoGraphics", + "in": "body", + "required": false, + "description": "宣传图片地址。 多个地址以英文逗号隔开,最多不超过10个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxItems": 6, + "itemsType": "object", + "type": "array", + "name": "deviceMaterials", + "in": "body", + "required": false, + "description": "设备类型相关的素材。 数组长度不超过6。 说明 素材的格式请参考素材规范。 注意 接口不校验素材的格式(尺寸、分辨率、文件后缀等),请开发者自行保证素材格式的准确性,以免影响素材最终的呈现效果。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "版本多语言本地化信息。 数组长度不超过100。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488", + "enum": [ + "4", + "5", + "12", + "14" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true, + "description": "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表 说明 其他设备类型暂未开放。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488", + "type": "string", + "name": "appAdapters", + "in": "body", + "required": false, + "description": "适配设备类型。 5:平板 说明 当deviceType为4(手机)时,系统会默认兼容分发到平板设备,即给appAdapters赋值5。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxItems": 6, + "itemsType": "object", + "type": "array", + "name": "deviceTypes", + "in": "body", + "required": false, + "description": "版本的设备类型信息。 数组长度不超过6。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxLength": 1024, + "type": "string", + "name": "distCountryList", + "in": "body", + "required": false, + "description": "版本发布国家的国家码。 多个国家以英文逗号分隔,例如:“CN,DE,MC”。 如果取值为“OTHER”,则表示当AppGallery支持的国家或地区列表中新增某个国家或地区时,版本将自动分发到新增的国家和地区。国家码列表请参见国家码。 注意 取值不能只包含OTHER。仅公开测试支持填写此字段。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 128, + "type": "string", + "name": "testUserName", + "in": "body", + "required": false, + "description": "应用审核信息的测试账号。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 128, + "type": "string", + "name": "testUserPassword", + "in": "body", + "required": false, + "description": "应用审核信息的测试用户密码。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 300, + "type": "string", + "name": "appRemark", + "in": "body", + "required": false, + "description": "应用审核信息的备注。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "1" + ], + "type": "integer", + "name": "isSignedCommitment", + "in": "body", + "required": false, + "description": "是否签署合规承诺函。 取值范围: 空:未签署 1:已签署 说明 目前只有元服务涉及签署。 默认值:空 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "-1", + "1", + "2", + "3" + ], + "type": "integer", + "name": "registeredIdType", + "in": "body", + "required": false, + "description": "备案证件类型。 取值范围: -1:清空数据,同时也会清空registeredIdNumber的内容。 1:面向企业,备案证件为社会信用。 2:面向个人,备案证件为身份证。 3:面向机构,备案证件为机构代码。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 64, + "type": "string", + "name": "registeredIdNumber", + "in": "body", + "required": false, + "description": "备案证件号码。 取值范围: registeredIdType为1时,对应社会信用代码。 registeredIdType为2时,对应身份证号码。 registeredIdType为3时,对应机构代码。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 32, + "type": "string", + "name": "privacyAgreementId", + "in": "body", + "required": false, + "description": "隐私协议ID。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 512, + "type": "string", + "name": "userAgreementUrl", + "in": "body", + "required": false, + "description": "用户协议URL。 注意 仅公开测试支持填写此字段。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxItems": 5, + "itemsType": "string", + "type": "array", + "name": "userAgreementIds", + "in": "body", + "required": false, + "description": "用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 512, + "type": "string", + "name": "privacyPolicy", + "in": "body", + "required": false, + "description": "隐私政策网址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 256, + "type": "string", + "name": "privacyRightsUrl", + "in": "body", + "required": false, + "description": "隐私权利网址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "encrypted", + "in": "body", + "required": false, + "description": "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "isAiGenerate", + "in": "body", + "required": false, + "description": "是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。 注意 仅公开测试支持填写此字段。" + }, + { + "itemsEnum": [ + "-1", + "1", + "2", + "3", + "4", + "5" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "itemsType": "integer", + "type": "array", + "name": "aiTypes", + "in": "body", + "required": false, + "description": "涉及的AI生成合成服务类型。 注意 仅公开测试支持填写此字段。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景 说明 isAiGenerate取值为1(涉及)时,此参数必填。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "maxLength": 500, + "type": "string", + "name": "account", + "in": "body", + "required": false, + "description": "应用负责人的手机号码或者邮箱账号。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "type": "object", + "name": "appReviewPhoneInfo", + "in": "body", + "required": false, + "description": "应用负责人的手机号信息。用于沟通审核问题。 注意 仅公开测试支持填写此字段。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "maxLength": 500, + "type": "string", + "name": "account", + "in": "body", + "required": false, + "description": "应用负责人的手机号码或者邮箱账号。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "type": "object", + "name": "appReviewEmailInfo", + "in": "body", + "required": false, + "description": "应用负责人的邮箱账号信息。用于接收上架审核结果,应用整改或下架通知。 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 256, + "type": "string", + "name": "appReviewName", + "in": "body", + "required": false, + "description": "应用负责人的姓名。 注意 仅公开测试支持填写此字段。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "type": "object", + "name": "extInfo", + "in": "body", + "required": false, + "description": "版本扩展信息。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "type": "integer", + "name": "startTime", + "in": "body", + "required": true, + "description": "测试版本开始时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "type": "integer", + "name": "endTime", + "in": "body", + "required": true, + "description": "测试版本结束时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "maxLength": 50, + "type": "string", + "name": "testDesc", + "in": "body", + "required": false, + "description": "测试版本描述。" + }, + { + "properties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "body", + "required": false, + "description": "测试群组ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "maxLength": 50, + "type": "string", + "name": "groupName", + "in": "body", + "required": false, + "description": "测试群组名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "type": "integer", + "name": "addedTesterNum", + "in": "body", + "required": false, + "description": "已添加测试群组成员的数量。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "bind", + "in": "body", + "required": false, + "description": "是否绑定该测试群组。 取值范围: 1:已绑定 0:未绑定" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "itemsType": "object", + "type": "array", + "name": "groupInfos", + "in": "body", + "required": true, + "description": "测试用户信息。 注意 公开测试不支持修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "needShareLink", + "in": "body", + "required": false, + "description": "是否需要生成分享链接。 取值范围: 0:不需要。 1:需要。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "type": "integer", + "name": "publicTestInstallLimit", + "in": "body", + "required": false, + "description": "公开测试安装次数上限。 默认值:10万次 注意 仅公开测试支持填写此字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "maxLength": 32, + "type": "string", + "name": "displayArea", + "in": "body", + "required": false, + "description": "展示区域。 取值范围: 1:AppGallery客户端测试专区 说明 邀请测试该字段必填。 公开测试该字段选填。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "needNotify", + "in": "body", + "required": false, + "description": "是否向用户发送测试通知。 取值范围: 0:不需要 1:需要 默认值:1" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "type": "object", + "name": "testTaskInfo", + "in": "body", + "required": false, + "description": "测试发布信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "type": "object", + "name": "openTestInfo", + "in": "body", + "required": false, + "description": "测试版本信息,包含测试版本开始时间和结束时间。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "maxLength": 8, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言种类。 说明 取值请参见语言类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "maxLength": 512, + "type": "string", + "name": "permissionName", + "in": "body", + "required": true, + "description": "权限标记字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "enum": [ + "4", + "5", + "12", + "14" + ], + "type": "integer", + "name": "deviceType", + "in": "body", + "required": true, + "description": "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "maxLength": 512, + "type": "string", + "name": "objectId", + "in": "body", + "required": true, + "description": "文件在OBS上的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxItems": 100, + "itemsType": "object", + "type": "array", + "name": "packagePermissionIntroVideoList", + "in": "body", + "required": false, + "description": "软件包权限使用场景说明视频。 数组长度不超过100。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "版本号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "maxLength": 32, + "type": "string", + "name": "packageId", + "in": "body", + "required": true, + "description": "软件包ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "maxLength": 32, + "type": "string", + "name": "vocId", + "in": "body", + "required": true, + "description": "问题工单ID。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxItems": 1000, + "itemsType": "object", + "type": "array", + "name": "versionVocReq", + "in": "body", + "required": false, + "description": "应用版本已解决问题。 数组长度不超过1000。 仅公开测试支持填写此字段。 说明 调用查询应用未处理的问题工单接口可以查询用户反馈的应用问题。如果在应用版本更新时某些问题已经解决,可以将这些问题提交审核,工单平台验证通过后会关闭工单。" + } + ], + "body": "versionId,pkgId,languages,deviceTypes,distCountryList,extInfo,openTestInfo,packagePermissionIntroVideoList,versionVocReq", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657", + "officialSlug": "agc-help-test-api-modify-test-version-0000002271160657", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-modify-test-version", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-modify-test-version --invoke --body body.json", + "show": "agc testing test-api-modify-test-version --pretty" + } + }, + { + "documentation": { + "title": "发送邀请测试通知", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:33.320Z", + "status": "browser-read", + "readCommand": "agc testing test-api-post-test-notify --docs --pretty" + }, + "id": "test-api-post-test-notify", + "familyId": "testing", + "name": "发送邀请测试通知", + "description": "此接口用于给内外部群组的测试用户发送邀请测试的通知。", + "method": "POST", + "path": "/api/publish/v1/test/user/action/notify", + "command": "agc testing test-api-post-test-notify", + "requiredParams": [ + "appId", + "groupId", + "testerIds" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section236517415165", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "body", + "required": true, + "description": "测试群组ID。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section141117691213", + "maxItems": 10000, + "itemsType": "string", + "type": "array", + "name": "testerIds", + "in": "body", + "required": true, + "description": "需要通知的测试用户ID。 数组长度不超过10000。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538", + "officialSlug": "agc-help-test-api-post-test-notify-0000002236041538", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-post-test-notify", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-post-test-notify --invoke --body body.json", + "show": "agc testing test-api-post-test-notify --pretty" + } + }, + { + "documentation": { + "title": "查询测试问题反馈", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:34.569Z", + "status": "browser-read", + "readCommand": "agc testing test-api-query-feedback --docs --pretty" + }, + "id": "test-api-query-feedback", + "familyId": "testing", + "name": "查询测试问题反馈", + "description": "此接口用于查询测试问题反馈列表。", + "method": "POST", + "path": "/api/app-test/v1/mgmt/tester-feedback/action/query", + "command": "agc testing test-api-query-feedback", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "type": "integer", + "name": "startTime", + "in": "body", + "required": false, + "description": "时间戳,开始时间,不填默认近一年。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "type": "integer", + "name": "endTime", + "in": "body", + "required": false, + "description": "时间戳,结束时间,不填默认近一年。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "type": "array", + "name": "appVersions", + "in": "body", + "required": false, + "description": "应用版本。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "type": "array", + "name": "models", + "in": "body", + "required": false, + "description": "模型。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "type": "array", + "name": "deviceVersions", + "in": "body", + "required": false, + "description": "设备版本。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "type": "array", + "name": "machineTypes", + "in": "body", + "required": false, + "description": "机器类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "type": "integer", + "name": "currentPage", + "in": "body", + "required": false, + "description": "当前页。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "每页数量。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717", + "officialSlug": "agc-help-test-api-query-feedback-0000002665117717", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-query-feedback", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-query-feedback --invoke --body body.json", + "show": "agc testing test-api-query-feedback --pretty" + } + }, + { + "documentation": { + "title": "查询测试问题反馈维度", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:36.402Z", + "status": "browser-read", + "readCommand": "agc testing test-api-query-feedback-dimension --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-query-feedback-dimension", + "familyId": "testing", + "name": "查询测试问题反馈维度", + "description": "此接口用于查询测试反馈维度。", + "method": "POST", + "path": "/api/app-test/v1/mgmt/tester-feedback-dimension/action/query", + "command": "agc testing test-api-query-feedback-dimension", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "type": "integer", + "name": "startTime", + "in": "body", + "required": false, + "description": "开始时间。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "type": "integer", + "name": "endTime", + "in": "body", + "required": false, + "description": "结束时间。" + }, + { + "itemsMaxLength": 64, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "itemsType": "string", + "type": "array", + "name": "appVersions", + "in": "body", + "required": false, + "description": "应用版本。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "maxLength": 64, + "type": "string", + "name": "models", + "in": "body", + "required": false, + "description": "模型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "maxLength": 64, + "type": "string", + "name": "deviceVersions", + "in": "body", + "required": false, + "description": "设备版本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "maxLength": 64, + "type": "string", + "name": "machineTypes", + "in": "body", + "required": false, + "description": "机器类型。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572", + "officialSlug": "agc-help-test-api-query-feedback-dimension-0000002634878572", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-query-feedback-dimension", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-query-feedback-dimension --invoke --body body.json", + "show": "agc testing test-api-query-feedback-dimension --pretty" + } + }, + { + "documentation": { + "title": "查询公开链接", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:37.909Z", + "status": "browser-read", + "readCommand": "agc testing test-api-query-open-test-link --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-query-open-test-link", + "familyId": "testing", + "name": "查询公开链接", + "description": "此接口用于查询群组级公开测试链接。", + "method": "GET", + "path": "/api/app-test/v1/test-group/public-link", + "command": "agc testing test-api-query-open-test-link", + "requiredParams": [ + "versionId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section6641436115716", + "type": "string", + "name": "versionId", + "in": "query", + "required": true, + "description": "测试版本ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775", + "officialSlug": "agc-help-test-api-query-open-test-link-0000002664997775", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-query-open-test-link", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-query-open-test-link --invoke", + "show": "agc testing test-api-query-open-test-link --pretty" + } + }, + { + "documentation": { + "title": "查询测试群组成员", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:39.362Z", + "status": "browser-read", + "readCommand": "agc testing test-api-query-test-user --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-query-test-user", + "familyId": "testing", + "name": "查询测试群组成员", + "description": "此接口用于查询测试群组成员。", + "method": "GET", + "path": "/api/app-test/v1/test-user", + "command": "agc testing test-api-query-test-user", + "requiredParams": [ + "appId", + "groupId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213", + "maxLength": 32, + "type": "string", + "name": "groupId", + "in": "query", + "required": true, + "description": "测试群组ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213", + "type": "integer", + "name": "current", + "in": "query", + "required": false, + "description": "当前页。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213", + "type": "integer", + "name": "pageSize", + "in": "query", + "required": false, + "description": "每页数。 默认值:25" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773", + "officialSlug": "agc-help-test-api-query-test-user-0000002664997773", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-query-test-user", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-query-test-user --invoke", + "show": "agc testing test-api-query-test-user --pretty" + } + }, + { + "documentation": { + "title": "更新测试生效版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:40.822Z", + "status": "browser-read", + "readCommand": "agc testing test-api-release-test-version --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-release-test-version", + "familyId": "testing", + "name": "更新测试生效版本", + "description": "此接口用于将公开测试版本转为全网版本或者分阶段版本。", + "method": "PUT", + "path": "/api/publish/v2/test/version/release", + "command": "agc testing test-api-release-test-version", + "requiredParams": [ + "appId", + "versionId", + "releaseType" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "需要转为全网版本或者分阶段版本的测试版本ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "releaseType", + "in": "body", + "required": true, + "description": "发布方式。 取值范围: 1:全网发布。 2:分阶段发布。 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "type": "integer", + "name": "releaseTime", + "in": "body", + "required": false, + "description": "发布时间。 时间为毫秒数。 0,则表示立即上架。 非0,则表示指定时间上架,只对转全网生效。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "type": "object", + "name": "phasedReleaseInfo", + "in": "body", + "required": false, + "description": "分阶段发布信息。 说明 releaseType为2时,该参数必填。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713", + "officialSlug": "agc-help-test-api-release-test-version-0000002271000713", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-release-test-version", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-release-test-version --invoke --body body.json", + "show": "agc testing test-api-release-test-version --pretty" + } + }, + { + "documentation": { + "title": "停止邀请码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:42.982Z", + "status": "browser-read", + "readCommand": "agc testing test-api-stop-invite-code --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-stop-invite-code", + "familyId": "testing", + "name": "停止邀请码", + "description": "此接口用于邀请测试停止邀请码。", + "method": "POST", + "path": "/api/app-test/v1/invitation-code/action/stop", + "command": "agc testing test-api-stop-invite-code", + "requiredParams": [ + "appId", + "invitationCodeId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "type": "integer", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section141117691213", + "maxLength": 32, + "type": "string", + "name": "invitationCodeId", + "in": "body", + "required": true, + "description": "邀请码ID。" + } + ], + "body": "invitationCodeId", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725", + "officialSlug": "agc-help-test-api-stop-invite-code-0000002271000725", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-stop-invite-code", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-stop-invite-code --invoke --body body.json", + "show": "agc testing test-api-stop-invite-code --pretty" + } + }, + { + "documentation": { + "title": "停止测试版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:55:44.345Z", + "status": "browser-read", + "readCommand": "agc testing test-api-stop-test-version --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-stop-test-version", + "familyId": "testing", + "name": "停止测试版本", + "description": "此接口用于停止测试版本。", + "method": "POST", + "path": "/api/publish/v2/test/version/stop", + "command": "agc testing test-api-stop-test-version", + "requiredParams": [ + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section141117691213", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "测试版本ID。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542", + "officialSlug": "agc-help-test-api-stop-test-version-0000002236041542", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-stop-test-version", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-stop-test-version --invoke --body body.json", + "show": "agc testing test-api-stop-test-version --pretty" + } + }, + { + "documentation": { + "title": "提交测试版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:45.828Z", + "status": "browser-read", + "readCommand": "agc testing test-api-submit-test-version --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-submit-test-version", + "familyId": "testing", + "name": "提交测试版本", + "description": "此接口用于测试版本提交审核。", + "method": "POST", + "path": "/api/publish/v2/test/app/version/submit", + "command": "agc testing test-api-submit-test-version", + "requiredParams": [ + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section141117691213", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "测试版本ID。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334", + "officialSlug": "agc-help-test-api-submit-test-version-0000002236201334", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-submit-test-version", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-submit-test-version --invoke --body body.json", + "show": "agc testing test-api-submit-test-version --pretty" + } + }, + { + "documentation": { + "title": "更新有效期内的测试版本信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:47.214Z", + "status": "browser-read", + "readCommand": "agc testing test-api-update-test-version-opentest --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "test-api-update-test-version-opentest", + "familyId": "testing", + "name": "更新有效期内的测试版本信息", + "description": "此接口用于更新有效期内测试版本的测试时间和下载安装次数。", + "method": "PUT", + "path": "/api/publish/v2/test/version/open-test", + "command": "agc testing test-api-update-test-version-opentest", + "requiredParams": [ + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "maxLength": 64, + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "开发者所在团队的团队ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section6641436115716", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "maxLength": 32, + "type": "string", + "name": "versionId", + "in": "body", + "required": true, + "description": "需要更新的测试版本ID。 测试版本的状态必须是正在测试和等待生效。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "type": "integer", + "name": "startTime", + "in": "body", + "required": false, + "description": "测试版本开始时间。 此时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "type": "integer", + "name": "endTime", + "in": "body", + "required": false, + "description": "测试版本结束时间。 此时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "type": "integer", + "name": "publicTestInstallLimit", + "in": "body", + "required": false, + "description": "公开测试安装次数上限。 默认值:10万次。" + }, + { + "itemsMaxLength": 32, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "maxItems": 1000, + "itemsType": "string", + "type": "array", + "name": "newBindGroupIds", + "in": "body", + "required": false, + "description": "需要关联测试版本的测试群组ID列表。 数组长度不超过1000。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530", + "officialSlug": "agc-help-test-api-update-test-version-opentest-0000002236041530", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/testing/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/testing/endpoints/test-api-update-test-version-opentest", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc testing test-api-update-test-version-opentest --invoke --body body.json", + "show": "agc testing test-api-update-test-version-opentest --pretty" + } + }, + { + "documentation": { + "title": "获取给指定用户群发奖的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:55:48.944Z", + "status": "browser-read", + "readCommand": "agc reports activityawardexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } + ], + "id": "activityawardexport", + "familyId": "reports", + "name": "获取给指定用户群发奖的报表", + "description": "获取指定给用户群发奖的报表数据的CSV文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/activityAwardExport/{appId}", + "command": "agc reports activityawardexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterCondition", + "in": "query", + "required": false, + "description": "过滤器,目前只支持“activityId”,表示基于活动过滤。如果不传此参数默认无过滤器。 URL示例:&filterCondition=activityId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterConditionValue", + "in": "query", + "required": false, + "description": "过滤器对应的值,例如过滤器是“activityId”,此参数的取值为活动ID。目前只支持输入1个活动ID,不支持输入多个活动ID。 活动ID可在AppGallery Connect网站应用开发页面的“运营 > 活动运营 > 活动管理”页面查看。 URL示例:&filterConditionValue=939130" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071", + "officialSlug": "agcapi-activityawardexport-0000001158245071", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/activityawardexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports activityawardexport --invoke", + "show": "agc reports activityawardexport --pretty" + } + }, + { + "documentation": { + "title": "获取新增和留存的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:17.878Z", + "status": "browser-read", + "readCommand": "agc reports addadkpexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } + ], + "id": "addadkpexport", + "familyId": "reports", + "name": "获取新增和留存的报表", + "description": "获取新增和留存的报表数据的CSV或者Excel文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/addAdKpExport/{appId}", + "command": "agc reports addadkpexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "userTag", + "in": "query", + "required": false, + "description": "基于账号还是设备查询。 取值范围: 0: 账号 1: 设备 默认值:1" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102", + "officialSlug": "agcapi-addadkpexport-0000001111845102", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/addadkpexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports addadkpexport --invoke", + "show": "agc reports addadkpexport --pretty" + } + }, + { + "documentation": { + "title": "获取下载安装的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:18.806Z", + "status": "browser-read", + "readCommand": "agc reports appdownloadexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } + ], + "id": "appdownloadexport", + "familyId": "reports", + "name": "获取下载安装的报表", + "description": "获取下载安装的报表数据的CSV或者Excel文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/appDownloadExport/{appId}", + "command": "agc reports appdownloadexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterCondition", + "in": "query", + "required": false, + "description": "过滤器。 取值范围: countryId:按国家过滤。 businessType:按业务类型过滤。 appVersion:按应用版本过滤。 如果不传,默认无过滤器。 支持countryId、businessType和appVersion同时使用,URL示例:&filterCondition=countryId&filterCondition=businessType&filterCondition=appVersion" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterConditionValue", + "in": "query", + "required": false, + "description": "过滤器对应的值。 如果过滤器为countryId,此参数的取值为国家码的字符串数组,例如“CN, AL, AD, AT”。具体国家码列表参考国家码。传入“all”表示查询全球。传入“others”表示仅查询“US,CU,IR,SD,SY”(美国,古巴,伊朗,苏丹,叙利亚),获取的数据作为一个整体展示,例如“CN,AL,others”。“all”和“others”不区分大小写。 如果过滤器为businessType,此参数的取值为业务类型,取值范围为: ALL:所有业务 AppGallery:华为应用市场 AppTouch:AppTouch业务 取值区分大小写。 如果过滤器为appVersion,此参数的取值为应用版本,多个版本以英文逗号分隔,如:“1.0.0,2.0.0”。“all”表示查询所有应用版本,“all”不区分大小写。 如果传入多个过滤器,使用多个filterConditionValue表示,顺序必须与filterCondition中过滤器的顺序一致。URL示例:&filterConditionValue=CN&filterConditionValue=AppGallery。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "type": "string", + "name": "groupBy", + "in": "query", + "required": false, + "description": "数据统计的分组信息,支持按如下依据分组。 取值范围: date:按日期分组 countryId:按国家分组 businessType:按业务类型分组 appVersion:按应用版本分组 默认值:date" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059", + "officialSlug": "agcapi-appdownloadexport-0000001158365059", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/appdownloadexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports appdownloadexport --invoke", + "show": "agc reports appdownloadexport --pretty" + } + }, + { + "documentation": { + "title": "获取安装失败数据的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:19.769Z", + "status": "browser-read", + "readCommand": "agc reports appdownloadfailexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } + ], + "id": "appdownloadfailexport", + "familyId": "reports", + "name": "获取安装失败数据的报表", + "description": "获取安装失败数据的报表CSV或EXCEL文件。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/appDownloadFailExport/{appId}", + "command": "agc reports appdownloadfailexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "itemsType": "string", + "type": "array", + "name": "filterCondition", + "in": "query", + "required": false, + "description": "过滤器,目前只支持机型“deviceName”、下载类型“downloadType”、应用版本“appVersion”和国家/地区“countryId”过滤。四个参数可以组合。如果不传此参数默认无过滤器。URL示例:&filterCondition=deviceName&filterCondition=downloadType&filterCondition=countryId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "itemsType": "string", + "type": "array", + "name": "filterConditionValue", + "in": "query", + "required": false, + "description": "过滤器对应的值。 downloadType对应的取值:1(新下载)、2(更新下载)。 deviceName为设备型号的名称,取值例如: “Mate30Pro-5G版”、“P40-lite”、“P30-Pro”、“P40-lite-5G”、“nova7-SE”、“nova7_SE_5G乐活版”、“nova6-5G版”、“nova6-SE”。 countryId对应的值:“CN,AL,AD,AT” appVersion对应的值:\"1.0.0,2.0.0\" URL示例:&filterConditionValue=mate20&filterConditionValue=1&filterConditionValue=CN" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "itemsType": "string", + "type": "array", + "name": "groupBy", + "in": "query", + "required": false, + "description": "数据统计的分组信息。支持按照日期(date) 、机型(deviceName)、下载类型(downloadType)、应用版本(appVersion)或国家/地区(countryId)进行分组。如果不传默认按照日期分组。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063", + "officialSlug": "agcapi-appdownloadfailexport-0000001158365063", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/appdownloadfailexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports appdownloadfailexport --invoke", + "show": "agc reports appdownloadfailexport --pretty" + } + }, + { + "documentation": { + "title": "获取优惠券活动的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:20.937Z", + "status": "browser-read", + "readCommand": "agc reports couponexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } + ], + "id": "couponexport", + "familyId": "reports", + "name": "获取优惠券活动的报表", + "description": "获取优惠券活动的报表CSV或EXCEL文件。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/activityCouponExport/{appId}", + "command": "agc reports couponexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterCondition", + "in": "query", + "required": false, + "description": "过滤器,目前只支持“activityId”,表示基于活动过滤。如果不传此参数默认无过滤器。 URL示例:&filterCondition=activityId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterConditionValue", + "in": "query", + "required": false, + "description": "过滤器对应的值,例如过滤器是“activityId”,此参数的取值为活动ID。目前只支持输入1个活动ID,不支持输入多个活动ID。 活动ID可在AppGallery Connect网站应用开发页面的“运营 > 活动运营 > 活动管理”页面查看。 URL示例:&filterConditionValue=123456" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104", + "officialSlug": "agcapi-couponexport-0000001111845104", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/couponexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports couponexport --invoke", + "show": "agc reports couponexport --pretty" + } + }, + { + "documentation": { + "title": "获取元服务分发分析的报表文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:22.007Z", + "status": "browser-read", + "readCommand": "agc reports fa-distribute-analysis-export --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } + ], + "id": "fa-distribute-analysis-export", + "familyId": "reports", + "name": "获取元服务分发分析的报表文件", + "description": "获取元服务分发分析的报表数据的CSV或者Excel文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/fa/distributeAnalysisExport/", + "command": "agc reports fa-distribute-analysis-export", + "requiredParams": [ + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "maxLength": 10, + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": false, + "description": "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352", + "officialSlug": "agcapi-fa-distribute_analysis_export-0000001690307352", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/fa-distribute-analysis-export", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports fa-distribute-analysis-export --invoke", + "show": "agc reports fa-distribute-analysis-export --pretty" + } + }, + { + "documentation": { + "title": "获取元服务新增留存的报表文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:23.264Z", + "status": "browser-read", + "readCommand": "agc reports fa-user-analysis-export --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } + ], + "id": "fa-user-analysis-export", + "familyId": "reports", + "name": "获取元服务新增留存的报表文件", + "description": "获取元服务新增留存的报表数据的CSV或者Excel文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/fa/userAnalysisExport/", + "command": "agc reports fa-user-analysis-export", + "requiredParams": [ + "startTime", + "endTime", + "userTag" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "maxLength": 10, + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": false, + "description": "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "userTag", + "in": "query", + "required": true, + "description": "统计维度类型。 取值范围: 0:按照账号维度 1:按照设备维度 默认值:0" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949", + "officialSlug": "agcapi-fa-user_analysis_export-0000001738465949", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/fa-user-analysis-export", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports fa-user-analysis-export --invoke", + "show": "agc reports fa-user-analysis-export --pretty" + } + }, + { + "documentation": { + "title": "获取元服务卡片分析的报表文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:24.316Z", + "status": "browser-read", + "readCommand": "agc reports fa-widget-analysis-export --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } + ], + "id": "fa-widget-analysis-export", + "familyId": "reports", + "name": "获取元服务卡片分析的报表文件", + "description": "获取元服务卡片分析的报表数据的CSV或者Excel文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/fa/widgetAnalysisExport/", + "command": "agc reports fa-widget-analysis-export", + "requiredParams": [ + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "maxLength": 10, + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": false, + "description": "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092", + "officialSlug": "agcapi-fa-widget_analysis_export-0000001690467092", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/fa-widget-analysis-export", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports fa-widget-analysis-export --invoke", + "show": "agc reports fa-widget-analysis-export --pretty" + } + }, + { + "documentation": { + "title": "获取预约的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:25.394Z", + "status": "browser-read", + "readCommand": "agc reports gamereservationexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } + ], + "id": "gamereservationexport", + "familyId": "reports", + "name": "获取预约的报表", + "description": "获取预约报表数据的CSV或EXCEL文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/gameReservationExport/{appId}", + "command": "agc reports gamereservationexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206", + "enum": [ + "zh-CN" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,目前只支持简体中文(zh-CN)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212", + "officialSlug": "agcapi-gamereservationexport-0000001111685212", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/gamereservationexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports gamereservationexport --invoke", + "show": "agc reports gamereservationexport --pretty" + } + }, + { + "documentation": { + "title": "获取应用内付费的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:26.548Z", + "status": "browser-read", + "readCommand": "agc reports iapexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } + ], + "id": "iapexport", + "familyId": "reports", + "name": "获取应用内付费的报表", + "description": "获取应用内付费的报表的CSV或者EXCEL文件地址。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/IAPExport/{appId}", + "command": "agc reports iapexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime", + "currency" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterCondition", + "in": "query", + "required": false, + "description": "过滤器,取值范围: countryId:按国家过滤。 businessType:按业务类型过滤。 如果不传,默认无过滤器。 支持countryId和businessType同时使用,URL示例:&filterCondition=countryId&filterCondition=businessType" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterConditionValue", + "in": "query", + "required": false, + "description": "过滤器对应的值。 如果过滤器为countryId,此参数的取值为国家码的字符串数组,例如“CN, AL, AD, AT”。具体国家码列表参考国家码。传入“all”表示查询全球。传入“others”表示仅查询“US,CU,IR,SD,SY”(美国,古巴,伊朗,苏丹,叙利亚),获取的数据作为一个整体展示,例如“CN,AL,others”。“all”和“others”不区分大小写。 如果过滤器为businessType,此参数的取值为业务类型,取值范围为: ALL:所有业务 AppGallery:华为应用市场 AppTouch:AppTouch业务 取值区分大小写。 如果传入多个过滤器,使用多个filterConditionValue表示,顺序必须与filterCondition中过滤器的顺序一致。URL示例:&filterConditionValue=CN&filterConditionValue=AppGallery。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "type": "string", + "name": "groupBy", + "in": "query", + "required": false, + "description": "数据统计的分组信息,支持按如下依据分组。 date:按日期分组。 countryId:按国家分组 businessType:按业务类型分组 默认值:date。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "enum": [ + "CNY", + "EUR", + "USD" + ], + "type": "string", + "name": "currency", + "in": "query", + "required": true, + "description": "货币单位编码,只支持3种货币单位,分别为:CNY(元)、EUR(欧元)、USD(美金)。 设置后,报表中非指定货币单位的货币值将按汇率转换为指定的货币值。例如:设置为USD,那么报表中以CNY、EUR等为单位的数据将按汇率转换为以USD为单位的数据呈现。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061", + "officialSlug": "agcapi-iapexport-0000001158365061", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/iapexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports iapexport --invoke", + "show": "agc reports iapexport --pretty" + } + }, + { + "documentation": { + "title": "获取付费下载的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:27.783Z", + "status": "browser-read", + "readCommand": "agc reports orderanalysisexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 365, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 365 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } + ], + "id": "orderanalysisexport", + "familyId": "reports", + "name": "获取付费下载的报表", + "description": "获取付费下载报表的CSV或者EXCEL文件。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/orderAnalysisExport/{appId}", + "command": "agc reports orderanalysisexport", + "requiredParams": [ + "appId", + "language", + "startTime", + "endTime" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过365天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过365天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterCondition", + "in": "query", + "required": false, + "description": "过滤器,目前只支持“countryId”,表示基于国家过滤,支持多国家查询。如果不传此参数默认查询所有国家。 URL示例:&filterCondition=countryId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterConditionValue", + "in": "query", + "required": false, + "description": "过滤器对应的值,例如过滤器是“countryId”,此参数的取值为国家码的字符串数组,例如CN。具体国家码列表请参见国家码。 URL示例:&filterConditionValue=CN" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ], + "type": "string", + "name": "exportType", + "in": "query", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214", + "officialSlug": "agcapi-orderanalysisexport-0000001111685214", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/orderanalysisexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports orderanalysisexport --invoke", + "show": "agc reports orderanalysisexport --pretty" + } + }, + { + "documentation": { + "title": "获取付费下载明细的报表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:29.001Z", + "status": "browser-read", + "readCommand": "agc reports orderdetailexport --docs --pretty" + }, + "rules": [ + { + "maxDays": 180, + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } + ], + "id": "orderdetailexport", + "familyId": "reports", + "name": "获取付费下载明细的报表", + "description": "获取付费下载明细的报表CSV文件。", + "method": "GET", + "path": "/api/report/distribution-operation-quality/v1/orderDetailExport/{appId}", + "command": "agc reports orderdetailexport", + "requiredParams": [ + "appId", + "language", + "queryType", + "startTime", + "endTime", + "filterCondition", + "filterConditionValue" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section1250171775311", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ], + "type": "string", + "name": "language", + "in": "query", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "queryType", + "in": "query", + "required": true, + "description": "查询日期类型。 0:按照购买时间查询 1:按照退款时间查询" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "type": "string", + "name": "startTime", + "in": "query", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "type": "string", + "name": "endTime", + "in": "query", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterCondition", + "in": "query", + "required": true, + "description": "过滤器,目前支持countryId、orderID、orderStatus三种,可以进行组合,其中countryId必须包含。过滤器为countryId时,不支持多个国家,每次查询只支持一个国家。 URL示例:&filterCondition=countryId&filterCondition=orderID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "itemsType": "string", + "type": "array", + "name": "filterConditionValue", + "in": "query", + "required": true, + "description": "过滤器对应的值。 过滤器是“countryId”,此参数的取值为国家码的字符串数组,数组中每次只支持查询一个值,例如CN。具体国家码列表参考国家码。 过滤器是“orderID”,此参数的取值为订单ID,例如44rRFFrereere3343。 过滤器是“orderStatus”,此参数的取值可以为:0(已付)、 1(已退)、2(付款失败)、3(退款失败)、5(退款中)。 如果filterCondition传入多个过滤器,filterConditionValue的顺序必须对应。URL示例:filterConditionValue=CN&filterConditionValue=44rRFFrereere3343" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073", + "officialSlug": "agcapi-orderdetailexport-0000001158245073", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/reports/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/reports/endpoints/orderdetailexport", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc reports orderdetailexport --invoke", + "show": "agc reports orderdetailexport --pretty" + } + }, + { + "documentation": { + "title": "添加证书指纹", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218", + "updatedAt": "2025-10-30 11:38", + "checkedAt": "2026-10-07T02:56:30.244Z", + "status": "browser-read", + "readCommand": "agc projects addappfingerprint --docs --pretty" + }, + "id": "addappfingerprint", + "familyId": "projects", + "name": "添加证书指纹", + "description": "此接口用于设置应用的证书指纹信息。", + "method": "PUT", + "path": "/api/cds/app-distirbution/v1/all/app-extra-info/{appId}", + "command": "agc projects addappfingerprint", + "requiredParams": [ + "oauth2Token", + "uid", + "teamId", + "appId", + "addCertFingerprints" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165", + "type": "string", + "name": "oauth2Token", + "in": "header", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165", + "type": "string", + "name": "uid", + "in": "header", + "required": true, + "description": "开发者账号ID,可通过查询开发者账号ID查询。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": true, + "description": "应用归属的团队账号ID,可以通过获取应用简略信息接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section886219295206", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID。" + }, + { + "itemsPattern": "^[^:]*$", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section843129163214", + "maxItems": 5, + "itemsType": "string", + "type": "array", + "name": "addCertFingerprints", + "in": "body", + "required": true, + "description": "需要添加的证书指纹,证书指纹中不能包含冒号。 1个应用最多只能有5个证书指纹。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218", + "officialSlug": "agcapi-addappfingerprint-0000001111685218", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/addappfingerprint", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects addappfingerprint --invoke --body body.json", + "show": "agc projects addappfingerprint --pretty" + } + }, + { + "documentation": { + "title": "获取应用简略信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T05:24:11.249Z", + "status": "browser-read", + "readCommand": "agc projects appbriefinfo --docs --pretty" + }, + "rules": [ + { + "unlessPresent": "query.appId", + "minItems": 1, + "maxItems": 100, + "id": "application-package-count", + "kind": "csv_count", + "field": "query.packageNames", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "message": "packageNames accepts at most 100 nonempty comma-separated package names.", + "suggestion": "Use at most 100 package names, or select applications with appId, which takes precedence." + }, + { + "id": "application-identity", + "kind": "at_least_one", + "fields": [ + "query.appId", + "query.packageNames" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "message": "Supply appId or packageNames to select applications.", + "suggestion": "Provide a comma-separated appId list or packageNames list; appId takes precedence when both exist." + } + ], + "id": "appbriefinfo", + "familyId": "projects", + "name": "获取应用简略信息", + "description": "批量查询应用简略信息。", + "method": "GET", + "path": "/api/cds/app-distirbution/v1/all/app-brief-info/list", + "command": "agc projects appbriefinfo", + "requiredParams": [ + "oauth2Token", + "userID" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section236517415165", + "type": "string", + "name": "oauth2Token", + "in": "header", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section236517415165", + "type": "integer", + "name": "userID", + "in": "header", + "required": true, + "description": "主账号用户id,即团队ID。通过获取团队列表接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "type": "string", + "name": "appId", + "in": "query", + "required": false, + "description": "需要查询的应用ID列表,多个值间以半角逗号分隔。 appId和packageNames必须传一个,如果同时存在则以appId为准。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "type": "string", + "name": "packageNames", + "in": "query", + "required": false, + "description": "需要查询的应用包名,多个包名用逗号分隔,最大100个。 appId和packageNames必须传一个,如果同时存在则以appId为准。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "enum": [ + "1", + "2", + "4", + "8", + "9", + "19", + "23", + "27", + "28", + "29", + "30", + "9998", + "9999" + ], + "type": "string", + "name": "appType", + "in": "query", + "required": false, + "description": "应用类型。 1:移动应用(包括普通应用和游戏) 2:电视应用 4:路由器应用 8:华为VR应用 9:手表应用 19:RPK应用 23:大屏快应用 27:车机应用 28:车机快应用 29:运动手表 30:云游戏 9998:ios应用 9999:web应用" + }, + { + "pattern": "^(?:-999|-995|0|1|62|101|99999|9998|9997)(?:,(?:-999|-995|0|1|62|101|99999|9998|9997))*$", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "type": "string", + "name": "appDistStatus", + "in": "query", + "required": false, + "description": "应用分发状态列表,多个值间以半角逗号分隔。 -999:审核中 -995:升级中 0:不通过 1:已下架(含强制下架) 62:待上架 101:已上架(含升级不通过,申请下架失败) 99999:申请下架 9998:草稿 9997:已删除" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "minimum": 1, + "type": "integer", + "name": "fromRecCount", + "in": "query", + "required": false, + "description": "起始页数。从1开始,表示第1个。如果不传,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "maximum": 1000, + "type": "integer", + "name": "maxReqCount", + "in": "query", + "required": false, + "description": "每页返回条数;缺省20(最大1000)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "type": "string", + "name": "sortType", + "in": "query", + "required": false, + "description": "排序方式。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "officialSlug": "agcapi-appbriefinfo-0000001111845106", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/appbriefinfo", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects appbriefinfo --invoke", + "show": "agc projects appbriefinfo --pretty" + } + }, + { + "documentation": { + "title": "获取配置文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:32.464Z", + "status": "browser-read", + "readCommand": "agc projects getconfigfile --docs --pretty" + }, + "id": "getconfigfile", + "familyId": "projects", + "name": "获取配置文件", + "description": "获取应用的配置文件。", + "method": "GET", + "path": "/api/cpms/project-management-service/v1/config-file", + "command": "agc projects getconfigfile", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section886219295206", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "需要获取配置文件的应用ID,可以通过获取应用简略信息接口获取。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065", + "officialSlug": "agcapi-getconfigfile-0000001158365065", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/getconfigfile", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects getconfigfile --invoke", + "show": "agc projects getconfigfile --pretty" + } + }, + { + "documentation": { + "title": "获取团队列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:56:33.514Z", + "status": "browser-read", + "readCommand": "agc projects getteamlist --docs --pretty" + }, + "id": "getteamlist", + "familyId": "projects", + "name": "获取团队列表", + "description": "获取开发者的团队账号列表信息。", + "method": "GET", + "path": "/api/ups/user-permission-service/v1/user-team-list", + "command": "agc projects getteamlist", + "requiredParams": [ + "oauth2Token" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section236517415165", + "type": "string", + "name": "oauth2Token", + "in": "header", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "officialSlug": "agcapi-getteamlist-0000001158245075", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/getteamlist", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects getteamlist --invoke", + "show": "agc projects getteamlist --pretty" + } + }, + { + "documentation": { + "title": "查询证书指纹和AppSecret", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:56:34.746Z", + "status": "browser-read", + "readCommand": "agc projects queryappfingerprint --docs --pretty" + }, + "id": "queryappfingerprint", + "familyId": "projects", + "name": "查询证书指纹和AppSecret", + "description": "此接口用于根据应用ID查询App Secret、证书指纹信息。", + "method": "GET", + "path": "/api/cds/app-distirbution/v1/all/app-extra-info/{appId}", + "command": "agc projects queryappfingerprint", + "requiredParams": [ + "oauth2Token", + "uid", + "teamId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165", + "type": "string", + "name": "oauth2Token", + "in": "header", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165", + "type": "string", + "name": "uid", + "in": "header", + "required": true, + "description": "开发者账号ID,可通过查询开发者账号ID查询。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": true, + "description": "应用归属的团队账号ID,可以通过获取应用简略信息接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section886219295206", + "type": "string", + "name": "appId", + "in": "path", + "required": true, + "description": "应用ID。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077", + "officialSlug": "agcapi-queryappfingerprint-0000001158245077", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/queryappfingerprint", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects queryappfingerprint --invoke", + "show": "agc projects queryappfingerprint --pretty" + } + }, + { + "documentation": { + "title": "查询项目详情及项目下的应用", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:36.578Z", + "status": "browser-read", + "readCommand": "agc projects queryprojectdetail --docs --pretty" + }, + "id": "queryprojectdetail", + "familyId": "projects", + "name": "查询项目详情及项目下的应用", + "description": "此接口用于查询指定项目的详细项目信息和项目下的应用列表信息。", + "method": "GET", + "path": "/api/project-service/v1/projects/{projectId}", + "command": "agc projects queryprojectdetail", + "requiredParams": [ + "projectId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section35551630174017", + "type": "string", + "name": "projectId", + "in": "path", + "required": true, + "description": "需要查询的项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section886219295206", + "enum": [ + "0", + "1" + ], + "type": "string", + "name": "queryFlag", + "in": "query", + "required": false, + "description": "是否需要查询项目下的应用信息。 0:不需要 1:需要 如果不传,默认值:0,响应参数中将不会返回appList。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067", + "officialSlug": "agcapi-queryprojectdetail-0000001158365067", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/queryprojectdetail", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects queryprojectdetail --invoke", + "show": "agc projects queryprojectdetail --pretty" + } + }, + { + "documentation": { + "title": "查询项目列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:37.663Z", + "status": "browser-read", + "readCommand": "agc projects queryprojectlist --docs --pretty" + }, + "rules": [ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165", + "message": "teamId is required with OAuth authorization.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } + ], + "id": "queryprojectlist", + "familyId": "projects", + "name": "查询项目列表", + "description": "此接口用于查询指定团队账号下的项目列表信息。", + "method": "GET", + "path": "/api/project-service/v1/projects", + "command": "agc projects queryprojectlist", + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165", + "type": "string", + "name": "teamId", + "in": "header", + "required": false, + "description": "需要查询的团队账号ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section886219295206", + "type": "string", + "name": "fromPage", + "in": "query", + "required": false, + "description": "起始页,默认是1,表示从第1页开始查询。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section886219295206", + "type": "string", + "name": "pageSize", + "in": "query", + "required": false, + "description": "每页查询的条数,默认值:100。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220", + "officialSlug": "agcapi-queryprojectlist-0000001111685220", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/queryprojectlist", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects queryprojectlist --invoke", + "show": "agc projects queryprojectlist --pretty" + } + }, + { + "documentation": { + "title": "查询服务开通状态", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:38.722Z", + "status": "browser-read", + "readCommand": "agc projects queryservice --docs --pretty" + }, + "id": "queryservice", + "familyId": "projects", + "name": "查询服务开通状态", + "description": "此接口用于查询项目、应用开通的服务信息列表以及API的状态。", + "method": "GET", + "path": "/api/cpms/project-service/v1/services/order-api", + "command": "agc projects queryservice", + "requiredParams": [ + "projectId", + "appID" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section886219295206", + "type": "string", + "name": "projectId", + "in": "query", + "required": true, + "description": "应用所在的项目ID,可以通过获取应用简略信息接口获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section886219295206", + "type": "integer", + "name": "appID", + "in": "query", + "required": true, + "description": "应用ID。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108", + "officialSlug": "agcapi-queryservice-0000001111845108", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/projects/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/projects/endpoints/queryservice", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc projects queryservice --invoke", + "show": "agc projects queryservice --pretty" + } + }, + { + "documentation": { + "title": "查询单个评论详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:56:39.782Z", + "status": "browser-read", + "readCommand": "agc comments com-getreviewinfo --docs --pretty" + }, + "id": "com-getreviewinfo", + "familyId": "comments", + "name": "查询单个评论详情", + "description": "获取单个评论详情。", + "method": "GET", + "path": "/api/reviews/v1/manage/dev/reviews/{reviewId}", + "command": "agc comments com-getreviewinfo", + "requiredParams": [ + "reviewId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section3861044135212", + "type": "string", + "name": "reviewId", + "in": "path", + "required": true, + "description": "评论ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求页码,默认1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313", + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248", + "officialSlug": "agcapi-com-getreviewinfo-0000001116028248", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/com-getreviewinfo", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments com-getreviewinfo --invoke", + "show": "agc comments com-getreviewinfo --pretty" + } + }, + { + "documentation": { + "title": "查询单个评论详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839", + "updatedAt": "2026-04-29 19:20", + "checkedAt": "2026-10-07T02:57:09.424Z", + "status": "browser-read", + "readCommand": "agc comments com-getreviewinfo-harmonyos --docs --pretty" + }, + "id": "com-getreviewinfo-harmonyos", + "familyId": "comments", + "name": "查询单个评论详情", + "description": "开发者查询对应鸿蒙应用下的单个评论详情及评论下的回复列表。", + "method": "GET", + "path": "/api/marketing-api/v2/reviews/manage/dev/reviews/{reviewId}", + "command": "agc comments com-getreviewinfo-harmonyos", + "requiredParams": [ + "reviewId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1271mcpsimp", + "type": "string", + "name": "reviewId", + "in": "path", + "required": true, + "description": "评论ID,可从查询应用评论列表接口中获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp", + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839", + "officialSlug": "agcapi-com-getreviewinfo-harmonyos-0000002504053839", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/com-getreviewinfo-harmonyos", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments com-getreviewinfo-harmonyos --invoke", + "show": "agc comments com-getreviewinfo-harmonyos --pretty" + } + }, + { + "documentation": { + "title": "查询应用评分", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:57:11.483Z", + "status": "browser-read", + "readCommand": "agc comments com-rating --docs --pretty" + }, + "id": "com-rating", + "familyId": "comments", + "name": "查询应用评分", + "description": "开发者查询对应应用下的评分列表及综合评分。", + "method": "GET", + "path": "/api/reviews/v1/manage/dev/ratings", + "command": "agc comments com-rating", + "requiredParams": [ + "appId", + "beginTime", + "endTime", + "countries" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "type": "integer", + "format": "int64", + "name": "beginTime", + "in": "query", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "type": "integer", + "format": "int64", + "name": "endTime", + "in": "query", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 beginTime和endTime不能超过6个月的跨度。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "type": "string", + "name": "countries", + "in": "query", + "required": true, + "description": "ISO国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "type": "string", + "name": "apkVersions", + "in": "query", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。该参数不设置时默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "type": "string", + "name": "ratings", + "in": "query", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”为查询所有评分为5的评论。 如果传递参数“4,5”为查询所有评分为4和5的评论。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "enum": [ + "0", + "1", + "2" + ], + "type": "integer", + "name": "sort", + "in": "query", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间排序。 1:BYSCOREDESC,按分数降序。 2:BYSCOREASC,按分数排序。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "每页请求数目,最大100条每页,默认50条。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426", + "officialSlug": "agcapi-com-rating-0000001133889426", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/com-rating", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments com-rating --invoke", + "show": "agc comments com-rating --pretty" + } + }, + { + "documentation": { + "title": "查询应用评分列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921", + "updatedAt": "2026-04-29 19:20", + "checkedAt": "2026-10-07T02:57:13.089Z", + "status": "browser-read", + "readCommand": "agc comments com-rating-harmonyos --docs --pretty" + }, + "id": "com-rating-harmonyos", + "familyId": "comments", + "name": "查询应用评分列表", + "description": "开发者查询对应鸿蒙应用下的评分列表。", + "method": "GET", + "path": "/api/marketing-api/v2/reviews/manage/dev/ratings", + "command": "agc comments com-rating-harmonyos", + "requiredParams": [ + "appId", + "beginTime", + "endTime", + "countries" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "type": "integer", + "format": "int64", + "name": "beginTime", + "in": "query", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "type": "integer", + "format": "int64", + "name": "endTime", + "in": "query", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 说明 beginTime和endTime之间不能超过6个月的跨度。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "type": "string", + "name": "countries", + "in": "query", + "required": true, + "description": "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "type": "string", + "name": "ratings", + "in": "query", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”,则查询所有评分为5的评论。 如果传递参数“4,5”,则查询所有评分为4和5的评论。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "type": "string", + "name": "appVersions", + "in": "query", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。 该参数不设置时,默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "enum": [ + "0", + "1", + "2" + ], + "type": "integer", + "name": "sort", + "in": "query", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间降序排序。 1:BYSCOREDESC,按分数降序排序。 2:BYSCOREASC,按分数升序排序。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "每页请求数目,最大100条。每页默认50条。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921", + "officialSlug": "agcapi-com-rating-harmonyos-0000002503933921", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/com-rating-harmonyos", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments com-rating-harmonyos --invoke", + "show": "agc comments com-rating-harmonyos --pretty" + } + }, + { + "documentation": { + "title": "回复评论和回复", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:57:14.451Z", + "status": "browser-read", + "readCommand": "agc comments com-reviewreply --docs --pretty" + }, + "rules": [ + { + "id": "reply-target-exclusive", + "kind": "at_most_one", + "fields": [ + "body.toReplyId", + "body.updateReplyId" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "message": "toReplyId and updateReplyId cannot both be supplied.", + "suggestion": "Choose whether to reply to a user reply or modify an existing developer reply, and provide only its corresponding ID." + } + ], + "id": "com-reviewreply", + "familyId": "comments", + "name": "回复评论和回复", + "description": "开发者在自己的应用下回复用户的评论,并继续回复用户的回复。", + "method": "POST", + "path": "/api/reviews/v1/manage/dev/reviews", + "command": "agc comments com-reviewreply", + "requiredParams": [ + "requestId", + "lang", + "appId", + "reviewId", + "devReplyContent", + "countryCode" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section62259187482", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "header", + "required": true, + "description": "请求ID,最大长度64个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言(例:zh_CN),由语言(采用ISO-639-1标准)和国家/地区代码(参考国家码)中间加下划线\"_\"组成。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "type": "string", + "name": "reviewId", + "in": "body", + "required": true, + "description": "评论ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "type": "string", + "name": "devReplyContent", + "in": "body", + "required": true, + "description": "回复内容。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "type": "string", + "name": "countryCode", + "in": "body", + "required": true, + "description": "ISO标准国家码,取值请参考国家码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "type": "string", + "name": "toReplyId", + "in": "body", + "required": false, + "description": "回复ID(非必传参数,传递这个参数说明回复的是用户的回复)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "type": "string", + "name": "updateReplyId", + "in": "body", + "required": false, + "description": "回复ID(非必传参数,传递这个参数说明是对回复的修改)。 toReplyId和updateReplyId不能同时传递。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117", + "officialSlug": "agcapi-com-reviewreply-0000001162548117", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/com-reviewreply", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments com-reviewreply --invoke --body body.json", + "show": "agc comments com-reviewreply --pretty" + } + }, + { + "documentation": { + "title": "回复评论和回复", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974", + "updatedAt": "2026-07-30 11:38", + "checkedAt": "2026-10-07T02:57:15.378Z", + "status": "browser-read", + "readCommand": "agc comments com-reviewreply-harmonyos --docs --pretty" + }, + "id": "com-reviewreply-harmonyos", + "familyId": "comments", + "name": "回复评论和回复", + "description": "开发者在自己的鸿蒙应用下回复用户的评论,并支持继续回复用户的回复。", + "method": "POST", + "path": "/api/marketing-api/v2/", + "command": "agc comments com-reviewreply-harmonyos", + "requiredParams": [ + "lang", + "appId", + "reviewId", + "devReplyContent", + "countryCode" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "enum": [ + "zh", + "en", + "bo", + "ug" + ], + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言,支持: zh:中文 en:英文 bo:藏语 ug:维吾尔语" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "应用ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "type": "integer", + "format": "int64", + "name": "reviewId", + "in": "body", + "required": true, + "description": "评论ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "type": "string", + "name": "devReplyContent", + "in": "body", + "required": true, + "description": "回复内容。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "type": "string", + "name": "countryCode", + "in": "body", + "required": true, + "description": "ISO标准国家码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "type": "string", + "name": "toReplyId", + "in": "body", + "required": false, + "description": "回复ID。 说明 非必传参数,传递这个参数说明回复的是用户的回复。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974", + "officialSlug": "agcapi-com-reviewreply-harmonyos-0000002471053974", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/com-reviewreply-harmonyos", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments com-reviewreply-harmonyos --invoke --body body.json", + "show": "agc comments com-reviewreply-harmonyos --pretty" + } + }, + { + "documentation": { + "title": "查询评论列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:57:17.010Z", + "status": "browser-read", + "readCommand": "agc comments comapi-getreviews --docs --pretty" + }, + "id": "comapi-getreviews", + "familyId": "comments", + "name": "查询评论列表", + "description": "开发者查询对应应用下的评论列表。", + "method": "GET", + "path": "/api/reviews/v1/manage/dev/reviews", + "command": "agc comments comapi-getreviews", + "requiredParams": [ + "appId", + "beginTime", + "endTime", + "countries" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "content", + "in": "query", + "required": false, + "description": "评论内容的关键词,支持模糊匹配。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "integer", + "format": "int64", + "name": "beginTime", + "in": "query", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "integer", + "format": "int64", + "name": "endTime", + "in": "query", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 beginTime和endTime不能超过6个月的跨度。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "countries", + "in": "query", + "required": true, + "description": "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "ratings", + "in": "query", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”为查询所有评分为5的评论。 如果传递参数“4,5”为查询所有评分为4和5的评论。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "apkVersions", + "in": "query", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。该参数不设置时默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "auditStates", + "in": "query", + "required": false, + "description": "已废弃。 审核状态,该参数不设置时默认查询所有审核状态的评论内容。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "devReplyStates", + "in": "query", + "required": false, + "description": "答复状态,该参数不设置时默认查询所有答复状态的评论内容。 0:未答复,用户提交评论后的状态。 1:已答复,开发者已针对该评论发表了答复。 6:用户追加回复开发者,用户针对开发者的答复内容进行了追加回复。 3:答复内容被回复,开发者针对用户追加的回复进行了答复。 可以查询多个答复状态的评论数据,多个答复状态之间使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "string", + "name": "langs", + "in": "query", + "required": false, + "description": "语言(例:zh_CN),由语言(采用ISO-639-1标准)和国家/地区代码(参考国家码)中间加下划线\"_\"组成。 该参数不设置时默认查询所有语言类型的评论内容,否则请设置具体语言,查询多个语言的评论内容时使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "enum": [ + "0", + "1", + "2" + ], + "type": "integer", + "name": "sort", + "in": "query", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间排序。 1:BYSCOREDESC,按分数降序。 2:BYSCOREASC,按分数排序。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139", + "officialSlug": "agcapi-comapi-getreviews-0000001162468139", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/comapi-getreviews", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments comapi-getreviews --invoke", + "show": "agc comments comapi-getreviews --pretty" + } + }, + { + "documentation": { + "title": "查询应用评论列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976", + "updatedAt": "2026-04-29 19:20", + "checkedAt": "2026-10-07T02:57:18.274Z", + "status": "browser-read", + "readCommand": "agc comments comapi-getreviews-harmonyos --docs --pretty" + }, + "id": "comapi-getreviews-harmonyos", + "familyId": "comments", + "name": "查询应用评论列表", + "description": "开发者查询对应鸿蒙应用下的评论列表。", + "method": "GET", + "path": "/api/marketing-api/v2/reviews/manage/dev/reviews", + "command": "agc comments comapi-getreviews-harmonyos", + "requiredParams": [ + "appId", + "beginTime", + "endTime", + "countries" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "string", + "name": "content", + "in": "query", + "required": false, + "description": "评论内容的关键词,支持模糊匹配。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "integer", + "format": "int64", + "name": "beginTime", + "in": "query", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "integer", + "format": "int64", + "name": "endTime", + "in": "query", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 说明 beginTime和endTime之间不能超过6个月的跨度。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "string", + "name": "countries", + "in": "query", + "required": true, + "description": "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "string", + "name": "ratings", + "in": "query", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”,则查询所有评分为5的评论。 如果传递参数“4,5”,则查询所有评分为4和5的评论。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "string", + "name": "appVersions", + "in": "query", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。 该参数不设置时,默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "string", + "name": "devReplyStates", + "in": "query", + "required": false, + "description": "答复状态,该参数不设置时默认查询所有答复状态的评论内容。 0:未答复,用户提交评论后的状态。 1:已答复,开发者已针对该评论发表了答复。 6:用户追加回复开发者,用户针对开发者的答复内容进行了追加回复。 3:答复内容被回复,开发者针对用户追加的回复进行了答复。 可以查询多个答复状态的评论数据,多个答复状态之间使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "string", + "name": "langs", + "in": "query", + "required": false, + "description": "语言(例:zh),采用ISO-639-1标准。 该参数不设置时默认查询所有语言类型的评论内容,否则请设置具体语言,查询多个语言的评论内容时使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "enum": [ + "0", + "1", + "2" + ], + "type": "integer", + "name": "sort", + "in": "query", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间降序排序。 1:BYSCOREDESC,按分数降序排序。 2:BYSCOREASC,按分数升序排序。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976", + "officialSlug": "agcapi-comapi-getreviews-harmonyos-0000002470893976", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/comments/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/comments/endpoints/comapi-getreviews-harmonyos", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc comments comapi-getreviews-harmonyos --invoke", + "show": "agc comments comapi-getreviews-harmonyos --pretty" + } + }, + { + "documentation": { + "title": "创建商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:19.778Z", + "status": "browser-read", + "readCommand": "agc pms addproduct-android --docs --pretty" + }, + "id": "addproduct-android", + "familyId": "pms", + "name": "创建商品", + "description": "此接口用于创建商品定义信息,包含商品价格,展示语言等。", + "method": "POST", + "path": "/api/pms/product-price-service/v1/manage/product", + "command": "agc pms addproduct-android", + "requiredParams": [ + "appId", + "requestId", + "product" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section18899113085213", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section18899113085213", + "type": "object", + "name": "product", + "in": "body", + "required": true, + "description": "商品信息。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001", + "officialSlug": "agcapi-addproduct-android-0000002171407001", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/addproduct-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms addproduct-android --invoke --body body.json", + "show": "agc pms addproduct-android --pretty" + } + }, + { + "documentation": { + "title": "创建商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:57:21.491Z", + "status": "browser-read", + "readCommand": "agc pms addproduct-harmonyosnext --docs --pretty" + }, + "id": "addproduct-harmonyosnext", + "familyId": "pms", + "name": "创建商品", + "description": "此接口用于创建商品定义信息,包含商品价格,展示语言等。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/product", + "command": "agc pms addproduct-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "product" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section18899113085213", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section18899113085213", + "type": "object", + "name": "product", + "in": "body", + "required": true, + "description": "商品信息。" + } + ], + "body": "requestId,product", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844", + "officialSlug": "agcapi-addproduct-harmonyosnext-0000002131508844", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/addproduct-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms addproduct-harmonyosnext --invoke --body body.json", + "show": "agc pms addproduct-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "创建商品订阅分组信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:23.062Z", + "status": "browser-read", + "readCommand": "agc pms addproductgroup-android --docs --pretty" + }, + "id": "addproductgroup-android", + "familyId": "pms", + "name": "创建商品订阅分组信息", + "description": "此接口用于创建商品订阅分组信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v1/manage/product/group", + "command": "agc pms addproductgroup-android", + "requiredParams": [ + "appId", + "requestId", + "resource" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1039611495218", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1039611495218", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品订阅分组信息。" + } + ], + "body": "requestId,resource", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308", + "officialSlug": "agcapi-addproductgroup-android-0000002135929308", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/addproductgroup-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms addproductgroup-android --invoke --body body.json", + "show": "agc pms addproductgroup-android --pretty" + } + }, + { + "documentation": { + "title": "创建商品订阅分组信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:24.580Z", + "status": "browser-read", + "readCommand": "agc pms addproductgroup-harmonyosnext --docs --pretty" + }, + "id": "addproductgroup-harmonyosnext", + "familyId": "pms", + "name": "创建商品订阅分组信息", + "description": "此接口用于创建商品订阅分组信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/product/group", + "command": "agc pms addproductgroup-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "resource" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1039611495218", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1039611495218", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品订阅分组信息。" + } + ], + "body": "requestId,resource", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", + "officialSlug": "agcapi-addproductgroup-harmonyosnext-0000002166748605", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/addproductgroup-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms addproductgroup-harmonyosnext --invoke --body body.json", + "show": "agc pms addproductgroup-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "创建商品促销信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:25.861Z", + "status": "browser-read", + "readCommand": "agc pms addpromotion-android --docs --pretty" + }, + "id": "addpromotion-android", + "familyId": "pms", + "name": "创建商品促销信息", + "description": "此接口用于创建商品促销信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v1/manage/product/promotion", + "command": "agc pms addpromotion-android", + "requiredParams": [ + "appId", + "requestId", + "resource" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1166073246", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1166073246", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品促销价格信息。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021", + "officialSlug": "agcapi-addpromotion-android-0000002171407021", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/addpromotion-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms addpromotion-android --invoke --body body.json", + "show": "agc pms addpromotion-android --pretty" + } + }, + { + "documentation": { + "title": "创建商品促销信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:27.930Z", + "status": "browser-read", + "readCommand": "agc pms addpromotion-harmonyosnext --docs --pretty" + }, + "id": "addpromotion-harmonyosnext", + "familyId": "pms", + "name": "创建商品促销信息", + "description": "此接口用于创建商品促销信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/product/promotion", + "command": "agc pms addpromotion-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "resource" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1166073246", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1166073246", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品促销价格信息。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856", + "officialSlug": "agcapi-addpromotion-harmonyosnext-0000002131508856", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/addpromotion-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms addpromotion-harmonyosnext --invoke --body body.json", + "show": "agc pms addpromotion-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "查询关联APP已有商品类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928", + "updatedAt": "2025-08-18 14:34", + "checkedAt": "2026-10-07T02:57:29.364Z", + "status": "browser-read", + "readCommand": "agc pms basicapplication-harmonyosnext --docs --pretty" + }, + "id": "basicapplication-harmonyosnext", + "familyId": "pms", + "name": "查询关联APP已有商品类型", + "description": "此接口用于查询关联APP已有商品类型。", + "method": "GET", + "path": "/api/pms/product-price-service/v2/manage/application/basic", + "command": "agc pms basicapplication-harmonyosnext", + "requiredParams": [ + "appId", + "purchaseType", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section48988321545", + "type": "string", + "name": "purchaseType", + "in": "body", + "required": true, + "description": "商品类型。如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non_renewing_subscription:非续期订阅型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section48988321545", + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928", + "officialSlug": "agcapi-basicapplication-harmonyosnext-0000002131519928", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/basicapplication-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms basicapplication-harmonyosnext --invoke", + "show": "agc pms basicapplication-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "批量激活商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:30.912Z", + "status": "browser-read", + "readCommand": "agc pms batchactproduct-android --docs --pretty" + }, + "id": "batchactproduct-android", + "familyId": "pms", + "name": "批量激活商品", + "description": "此接口用于批量激活商品。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product/batchActive", + "command": "agc pms batchactproduct-android", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7821124016311", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7821124016311", + "itemsType": "string", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品标识,只有下线状态的商品才能被激活。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617", + "officialSlug": "agcapi-batchactproduct-android-0000002171288617", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchactproduct-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchactproduct-android --invoke --body body.json", + "show": "agc pms batchactproduct-android --pretty" + } + }, + { + "documentation": { + "title": "批量激活商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:57:32.221Z", + "status": "browser-read", + "readCommand": "agc pms batchactproduct-harmonyosnext --docs --pretty" + }, + "id": "batchactproduct-harmonyosnext", + "familyId": "pms", + "name": "批量激活商品", + "description": "此接口用于批量激活商品 , 生效已下线商品,已结束的促销不会重新生效 。", + "method": "PUT", + "path": "/api/pms/product-price-service/v2/manage/product/batchActive", + "command": "agc pms batchactproduct-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7821124016311", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7821124016311", + "itemsType": "string", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品标识,只有下线状态的商品才能被激活。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712", + "officialSlug": "agcapi-batchactproduct-harmonyosnext-0000002131350712", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchactproduct-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchactproduct-harmonyosnext --invoke --body body.json", + "show": "agc pms batchactproduct-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "批量上线商品促销活动", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:33.713Z", + "status": "browser-read", + "readCommand": "agc pms batchactpromotion-android --docs --pretty" + }, + "id": "batchactpromotion-android", + "familyId": "pms", + "name": "批量上线商品促销活动", + "description": "此接口用于批量上线商品促销活动。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product/promotion/batchActive", + "command": "agc pms batchactpromotion-android", + "requiredParams": [ + "appId", + "requestId", + "promotions" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section37798271043", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section37798271043", + "maxItems": 100, + "itemsType": "string", + "type": "array", + "name": "promotions", + "in": "body", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + } + ], + "body": "requestId,promotions", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025", + "officialSlug": "agcapi-batchactpromotion-android-0000002171407025", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchactpromotion-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchactpromotion-android --invoke --body body.json", + "show": "agc pms batchactpromotion-android --pretty" + } + }, + { + "documentation": { + "title": "批量上线商品促销活动", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:34.992Z", + "status": "browser-read", + "readCommand": "agc pms batchactpromotion-harmonyosnext --docs --pretty" + }, + "id": "batchactpromotion-harmonyosnext", + "familyId": "pms", + "name": "批量上线商品促销活动", + "description": "此接口用于批量上线商品促销活动。", + "method": "PUT", + "path": "/api/pms/product-price-service/v2/manage/product/promotion/batchActive", + "command": "agc pms batchactpromotion-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "promotions" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section37798271043", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section37798271043", + "maxItems": 100, + "itemsType": "string", + "type": "array", + "name": "promotions", + "in": "body", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + } + ], + "body": "requestId,promotions", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "officialSlug": "agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchactpromotion-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchactpromotion-harmonyosnext --invoke --body body.json", + "show": "agc pms batchactpromotion-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "批量创建商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:57:38.960Z", + "status": "browser-read", + "readCommand": "agc pms batchaddproduct-android --docs --pretty" + }, + "id": "batchaddproduct-android", + "familyId": "pms", + "name": "批量创建商品", + "description": "此接口用于批量创建商品定义信息,展示语言,商品价格,促销活动信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v1/manage/product/batchImportProducts", + "command": "agc pms batchaddproduct-android", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19451915006", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "itemsRules": [ + { + "id": "subscription-subGroupId", + "kind": "required_if", + "field": "body.subGroupId", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subGroupId is required for auto_subscription", + "suggestion": "Supply subGroupId using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriod", + "kind": "required_if", + "field": "body.subPeriod", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subPeriod is required for auto_subscription", + "suggestion": "Supply subPeriod using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriodUnit", + "kind": "required_if", + "field": "body.subPeriodUnit", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subPeriodUnit is required for auto_subscription", + "suggestion": "Supply subPeriodUnit using the subscription group and period documented by ProductImportInfo." + } + ], + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "productNo", + "in": "body", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "active", + "inactive" + ], + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "商品状态,支持创建active和inactive状态的商品默认值:inactive。取值如下: active:上线 inactive:下线" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "默认商品描述信息。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "consumable", + "auto_subscription", + "non_consumable" + ], + "type": "string", + "name": "purchaseType", + "in": "body", + "required": true, + "description": "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "subGroupId", + "in": "body", + "required": false, + "description": "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "subPeriod", + "in": "body", + "required": false, + "description": "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "D", + "W", + "M", + "Y" + ], + "type": "string", + "name": "subPeriodUnit", + "in": "body", + "required": false, + "description": "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "force", + "in": "body", + "required": false, + "description": "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "defaultLocale", + "in": "body", + "required": true, + "description": "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "商品原始价格,如果商品为上线状态,则此字段不能为空。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "type": "string", + "name": "currency", + "in": "body", + "required": true, + "description": "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "object", + "name": "defaultPriceInfo", + "in": "body", + "required": false, + "description": "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "type": "string", + "name": "locale", + "in": "body", + "required": true, + "description": "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "商品描述。不支持特殊字符|。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645", + "type": "string", + "name": "price", + "in": "body", + "required": true, + "description": "定价,单位为分。 例如:1.99元此参数需要传入199。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "object", + "type": "array", + "name": "prices", + "in": "body", + "required": false, + "description": "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "promotionId", + "in": "body", + "required": false, + "description": "优惠唯一ID,批量创建时不需要传入,更新时必传。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "promotionTitle", + "in": "body", + "required": true, + "description": "促销名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "integer", + "name": "startDate", + "in": "body", + "required": true, + "description": "开始优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "integer", + "name": "endDate", + "in": "body", + "required": false, + "description": "结束优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "strategy", + "in": "body", + "required": true, + "description": "促销策略类型: trial:免费试用 说明 仅当关联商品的purchaseType为auto_subscription类型时支持配置trial。 introductory:按周期扣费" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "默认促销价格,单位为分,strategy取值为introductory时,必须传入。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "integer", + "name": "numberOfUnits", + "in": "body", + "required": false, + "description": "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "periodUnit", + "in": "body", + "required": false, + "description": "优惠周期单位: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "各个国家的语言信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "itemsType": "object", + "type": "array", + "name": "promotionPrice", + "in": "body", + "required": true, + "description": "各个国家的自定义价格信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "object", + "name": "promotion", + "in": "body", + "required": false, + "description": "促销信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "string", + "type": "array", + "name": "salesCountry", + "in": "body", + "required": false, + "description": "销售国家/地区。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "autoAddSaleCountry", + "in": "body", + "required": false, + "description": "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19451915006", + "itemsType": "object", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品列表信息。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605", + "officialSlug": "agcapi-batchaddproduct-android-0000002171288605", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchaddproduct-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchaddproduct-android --invoke --body body.json", + "show": "agc pms batchaddproduct-android --pretty" + } + }, + { + "documentation": { + "title": "批量创建商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "updatedAt": "2025-08-15 09:52", + "checkedAt": "2026-10-07T02:57:41.958Z", + "status": "browser-read", + "readCommand": "agc pms batchaddproduct-harmonyosnext --docs --pretty" + }, + "id": "batchaddproduct-harmonyosnext", + "familyId": "pms", + "name": "批量创建商品", + "description": "此接口用于批量创建商品定义信息,展示语言,商品价格,促销活动信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/product/batchImportProducts", + "command": "agc pms batchaddproduct-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19451915006", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "itemsRules": [ + { + "id": "subscription-subGroupId", + "kind": "required_if", + "field": "body.subGroupId", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subGroupId is required for auto_subscription", + "suggestion": "Supply subGroupId using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriod", + "kind": "required_if", + "field": "body.subPeriod", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subPeriod is required for auto_subscription", + "suggestion": "Supply subPeriod using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriodUnit", + "kind": "required_if", + "field": "body.subPeriodUnit", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subPeriodUnit is required for auto_subscription", + "suggestion": "Supply subPeriodUnit using the subscription group and period documented by ProductImportInfo." + } + ], + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "productNo", + "in": "body", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "drafts" + ], + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "商品状态,取值如下: drafts: 草稿,仅在批量创建时支持。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "默认商品描述信息。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "consumable", + "auto_subscription", + "non_consumable", + "non-renewing-subscription" + ], + "type": "string", + "name": "purchaseType", + "in": "body", + "required": true, + "description": "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non-renewing-subscription:非续期订阅型 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "subGroupId", + "in": "body", + "required": false, + "description": "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "subPeriod", + "in": "body", + "required": false, + "description": "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "D", + "W", + "M", + "Y" + ], + "type": "string", + "name": "subPeriodUnit", + "in": "body", + "required": false, + "description": "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "force", + "in": "body", + "required": false, + "description": "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "defaultLocale", + "in": "body", + "required": true, + "description": "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "商品原始价格,如果商品为上线状态,则此字段不能为空。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "type": "string", + "name": "currency", + "in": "body", + "required": true, + "description": "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "object", + "name": "defaultPriceInfo", + "in": "body", + "required": false, + "description": "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "type": "string", + "name": "locale", + "in": "body", + "required": true, + "description": "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "商品描述。不支持特殊字符|。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "string", + "name": "price", + "in": "body", + "required": true, + "description": "定价,单位为分。 例如:1.99元此参数需要传入199。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "integer", + "name": "startDate", + "in": "body", + "required": true, + "description": "价格调整开始时间。默认值:当前时间。 说明 价格调整计划必须连续,开始时间必须等于上一个调整计划的结束时间。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "integer", + "name": "endDate", + "in": "body", + "required": false, + "description": "价格调整结束时间。若不填写结束时间,则默认值:永久。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "string", + "name": "tag", + "in": "body", + "required": true, + "description": "价格调整标识。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "object", + "type": "array", + "name": "prices", + "in": "body", + "required": false, + "description": "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "promotionId", + "in": "body", + "required": false, + "description": "优惠唯一ID,批量创建时不需要传入,更新时必传。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "promotionTitle", + "in": "body", + "required": true, + "description": "促销名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "integer", + "name": "startDate", + "in": "body", + "required": true, + "description": "开始优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "integer", + "name": "endDate", + "in": "body", + "required": false, + "description": "结束优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "strategy", + "in": "body", + "required": true, + "description": "促销策略类型: trial:免费试用(仅自动续期型商品支持) introductory:按周期扣费(仅自动续期型商品支持) pay-up-front:提前支付(仅自动续期型商品支持) single-promotion:单商品优惠(仅消耗型,非消耗型,非续期型商品支持) 商品类型与策略类型映射关系请参见商品类型与促销类型、策略类型关系映射表。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "默认促销价格,单位为分,strategy取值为introductory、pay-up-front时,必须传入。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "integer", + "name": "numberOfUnits", + "in": "body", + "required": false, + "description": "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "periodUnit", + "in": "body", + "required": false, + "description": "优惠周期单位,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "各个国家的语言信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "itemsType": "object", + "type": "array", + "name": "promotionPrice", + "in": "body", + "required": true, + "description": "各个国家的自定义价格信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "object", + "name": "promotion", + "in": "body", + "required": false, + "description": "促销信息。 说明 消耗型、非消耗型、非续期订阅型商品不支持传入该字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "reviewResourceId", + "in": "body", + "required": false, + "description": "资源ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "reviewNote", + "in": "body", + "required": false, + "description": "审核文本。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "reviewPath", + "in": "body", + "required": false, + "description": "资源内路径。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "string", + "type": "array", + "name": "salesCountry", + "in": "body", + "required": false, + "description": "销售国家/地区。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "autoAddSaleCountry", + "in": "body", + "required": false, + "description": "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19451915006", + "itemsType": "object", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品列表信息。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "officialSlug": "agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchaddproduct-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchaddproduct-harmonyosnext --invoke --body body.json", + "show": "agc pms batchaddproduct-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "批量去激活商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:12.479Z", + "status": "browser-read", + "readCommand": "agc pms batchdeactproduct-android --docs --pretty" + }, + "id": "batchdeactproduct-android", + "familyId": "pms", + "name": "批量去激活商品", + "description": "此接口用于批量去激活商品。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product/batchDeactive", + "command": "agc pms batchdeactproduct-android", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section32521047636", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section32521047636", + "itemsType": "string", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品标识,只有上线状态的商品才能被去激活。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320", + "officialSlug": "agcapi-batchdeactproduct-android-0000002135929320", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchdeactproduct-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchdeactproduct-android --invoke --body body.json", + "show": "agc pms batchdeactproduct-android --pretty" + } + }, + { + "documentation": { + "title": "批量去激活商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:58:14.167Z", + "status": "browser-read", + "readCommand": "agc pms batchdeactproduct-harmonyosnext --docs --pretty" + }, + "id": "batchdeactproduct-harmonyosnext", + "familyId": "pms", + "name": "批量去激活商品", + "description": "此接口用于批量去激活商品 ,下线已生效商品,结束促销活动 。", + "method": "PUT", + "path": "/api/pms/product-price-service/v2/manage/product/batchDeactive", + "command": "agc pms batchdeactproduct-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section32521047636", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section32521047636", + "itemsType": "string", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品标识,只有上线状态的商品才能被去激活。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "officialSlug": "agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchdeactproduct-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchdeactproduct-harmonyosnext --invoke --body body.json", + "show": "agc pms batchdeactproduct-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "批量下线商品促销活动", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:15.604Z", + "status": "browser-read", + "readCommand": "agc pms batchdeactpromotion-android --docs --pretty" + }, + "id": "batchdeactpromotion-android", + "familyId": "pms", + "name": "批量下线商品促销活动", + "description": "此接口用于批量下线商品促销活动。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product/promotion/batchDeactive", + "command": "agc pms batchdeactpromotion-android", + "requiredParams": [ + "appId", + "requestId", + "promotions" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545", + "maxItems": 100, + "itemsType": "string", + "type": "array", + "name": "promotions", + "in": "body", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545", + "maxLength": 2, + "type": "string", + "name": "immediateEnd", + "in": "body", + "required": false, + "description": "值为1标识促销立即结束,更新促销结束时间,不传或者其它值不更新促销结束时间。" + } + ], + "body": "requestId,promotions,immediateEnd", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629", + "officialSlug": "agcapi-batchdeactpromotion-android-0000002171288629", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchdeactpromotion-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchdeactpromotion-android --invoke --body body.json", + "show": "agc pms batchdeactpromotion-android --pretty" + } + }, + { + "documentation": { + "title": "批量下线商品促销活动", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:17.063Z", + "status": "browser-read", + "readCommand": "agc pms batchdeactpromotion-harmonyosnext --docs --pretty" + }, + "id": "batchdeactpromotion-harmonyosnext", + "familyId": "pms", + "name": "批量下线商品促销活动", + "description": "此接口用于批量下线商品促销活动。", + "method": "PUT", + "path": "/api/pms/product-price-service/v2/manage/product/promotion/batchDeactive", + "command": "agc pms batchdeactpromotion-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "promotions" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545", + "maxItems": 100, + "itemsType": "string", + "type": "array", + "name": "promotions", + "in": "body", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545", + "maxLength": 2, + "type": "string", + "name": "immediateEnd", + "in": "body", + "required": false, + "description": "值为1标识促销立即结束,更新促销结束时间,不传或者其它值不更新促销结束时间。" + } + ], + "body": "requestId,promotions,immediateEnd", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "officialSlug": "agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchdeactpromotion-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchdeactpromotion-harmonyosnext --invoke --body body.json", + "show": "agc pms batchdeactpromotion-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "批量更新商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:18.434Z", + "status": "browser-read", + "readCommand": "agc pms batchupdateproduct-android --docs --pretty" + }, + "id": "batchupdateproduct-android", + "familyId": "pms", + "name": "批量更新商品", + "description": "此接口用于批量更新商品定义信息,展示语言,商品价格,促销活动信息。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product/batchImportProducts", + "command": "agc pms batchupdateproduct-android", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section13500173412311", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列ID,开发者自定义唯一标识符。" + }, + { + "itemsRules": [ + { + "id": "subscription-subGroupId", + "kind": "required_if", + "field": "body.subGroupId", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subGroupId is required for auto_subscription", + "suggestion": "Supply subGroupId using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriod", + "kind": "required_if", + "field": "body.subPeriod", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subPeriod is required for auto_subscription", + "suggestion": "Supply subPeriod using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriodUnit", + "kind": "required_if", + "field": "body.subPeriodUnit", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subPeriodUnit is required for auto_subscription", + "suggestion": "Supply subPeriodUnit using the subscription group and period documented by ProductImportInfo." + } + ], + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "productNo", + "in": "body", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "active", + "inactive" + ], + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "商品状态,支持创建active和inactive状态的商品默认值:inactive。取值如下: active:上线 inactive:下线" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "默认商品描述信息。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "consumable", + "auto_subscription", + "non_consumable" + ], + "type": "string", + "name": "purchaseType", + "in": "body", + "required": true, + "description": "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "subGroupId", + "in": "body", + "required": false, + "description": "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "subPeriod", + "in": "body", + "required": false, + "description": "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "D", + "W", + "M", + "Y" + ], + "type": "string", + "name": "subPeriodUnit", + "in": "body", + "required": false, + "description": "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "force", + "in": "body", + "required": false, + "description": "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "string", + "name": "defaultLocale", + "in": "body", + "required": true, + "description": "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "商品原始价格,如果商品为上线状态,则此字段不能为空。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "type": "string", + "name": "currency", + "in": "body", + "required": true, + "description": "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "object", + "name": "defaultPriceInfo", + "in": "body", + "required": false, + "description": "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "type": "string", + "name": "locale", + "in": "body", + "required": true, + "description": "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "商品描述。不支持特殊字符|。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645", + "type": "string", + "name": "price", + "in": "body", + "required": true, + "description": "定价,单位为分。 例如:1.99元此参数需要传入199。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "object", + "type": "array", + "name": "prices", + "in": "body", + "required": false, + "description": "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "promotionId", + "in": "body", + "required": false, + "description": "优惠唯一ID,批量创建时不需要传入,更新时必传。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "promotionTitle", + "in": "body", + "required": true, + "description": "促销名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "integer", + "name": "startDate", + "in": "body", + "required": true, + "description": "开始优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "integer", + "name": "endDate", + "in": "body", + "required": false, + "description": "结束优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "strategy", + "in": "body", + "required": true, + "description": "促销策略类型: trial:免费试用 说明 仅当关联商品的purchaseType为auto_subscription类型时支持配置trial。 introductory:按周期扣费" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "默认促销价格,单位为分,strategy取值为introductory时,必须传入。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "integer", + "name": "numberOfUnits", + "in": "body", + "required": false, + "description": "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "type": "string", + "name": "periodUnit", + "in": "body", + "required": false, + "description": "优惠周期单位: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "各个国家的语言信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "itemsType": "object", + "type": "array", + "name": "promotionPrice", + "in": "body", + "required": true, + "description": "各个国家的自定义价格信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "type": "object", + "name": "promotion", + "in": "body", + "required": false, + "description": "促销信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "string", + "type": "array", + "name": "salesCountry", + "in": "body", + "required": false, + "description": "销售国家/地区。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "autoAddSaleCountry", + "in": "body", + "required": false, + "description": "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section13500173412311", + "itemsType": "object", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品列表信息。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013", + "officialSlug": "agcapi-batchupdateproduct-android-0000002171407013", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchupdateproduct-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchupdateproduct-android --invoke --body body.json", + "show": "agc pms batchupdateproduct-android --pretty" + } + }, + { + "documentation": { + "title": "批量更新商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:20.551Z", + "status": "browser-read", + "readCommand": "agc pms batchupdateproduct-harmonyosnext --docs --pretty" + }, + "id": "batchupdateproduct-harmonyosnext", + "familyId": "pms", + "name": "批量更新商品", + "description": "此接口用于批量更新商品定义信息,展示语言,商品价格,促销活动信息。", + "method": "PUT", + "path": "/api/pms/product-price-service/v2/manage/product/batchImportProducts", + "command": "agc pms batchupdateproduct-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "products" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section13500173412311", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列ID,开发者自定义唯一标识符。" + }, + { + "itemsRules": [ + { + "id": "subscription-subGroupId", + "kind": "required_if", + "field": "body.subGroupId", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subGroupId is required for auto_subscription", + "suggestion": "Supply subGroupId using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriod", + "kind": "required_if", + "field": "body.subPeriod", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subPeriod is required for auto_subscription", + "suggestion": "Supply subPeriod using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriodUnit", + "kind": "required_if", + "field": "body.subPeriodUnit", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subPeriodUnit is required for auto_subscription", + "suggestion": "Supply subPeriodUnit using the subscription group and period documented by ProductImportInfo." + } + ], + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "productNo", + "in": "body", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "drafts" + ], + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "商品状态,取值如下: drafts: 草稿,仅在批量创建时支持。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "默认商品描述信息。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "consumable", + "auto_subscription", + "non_consumable", + "non-renewing-subscription" + ], + "type": "string", + "name": "purchaseType", + "in": "body", + "required": true, + "description": "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non-renewing-subscription:非续期订阅型 更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "subGroupId", + "in": "body", + "required": false, + "description": "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "subPeriod", + "in": "body", + "required": false, + "description": "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "D", + "W", + "M", + "Y" + ], + "type": "string", + "name": "subPeriodUnit", + "in": "body", + "required": false, + "description": "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "force", + "in": "body", + "required": false, + "description": "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "defaultLocale", + "in": "body", + "required": true, + "description": "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "商品原始价格,如果商品为上线状态,则此字段不能为空。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "type": "string", + "name": "currency", + "in": "body", + "required": true, + "description": "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "object", + "name": "defaultPriceInfo", + "in": "body", + "required": false, + "description": "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "type": "string", + "name": "locale", + "in": "body", + "required": true, + "description": "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": true, + "description": "商品名称。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "maxLength": 100, + "type": "string", + "name": "productDesc", + "in": "body", + "required": true, + "description": "商品描述。不支持特殊字符|。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "string", + "name": "price", + "in": "body", + "required": true, + "description": "定价,单位为分。 例如:1.99元此参数需要传入199。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "integer", + "name": "startDate", + "in": "body", + "required": true, + "description": "价格调整开始时间。默认值:当前时间。 说明 价格调整计划必须连续,开始时间必须等于上一个调整计划的结束时间。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "integer", + "name": "endDate", + "in": "body", + "required": false, + "description": "价格调整结束时间。若不填写结束时间,则默认值:永久。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "type": "string", + "name": "tag", + "in": "body", + "required": true, + "description": "价格调整标识。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "object", + "type": "array", + "name": "prices", + "in": "body", + "required": false, + "description": "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "promotionId", + "in": "body", + "required": false, + "description": "优惠唯一ID,批量创建时不需要传入,更新时必传。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "promotionTitle", + "in": "body", + "required": true, + "description": "促销名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "integer", + "name": "startDate", + "in": "body", + "required": true, + "description": "开始优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "integer", + "name": "endDate", + "in": "body", + "required": false, + "description": "结束优惠时间,格式为毫秒单位的时间戳。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "strategy", + "in": "body", + "required": true, + "description": "促销策略类型: trial:免费试用(仅自动续期型商品支持) introductory:按周期扣费(仅自动续期型商品支持) pay-up-front:提前支付(仅自动续期型商品支持) single-promotion:单商品优惠(仅消耗型,非消耗型,非续期型商品支持) 商品类型与策略类型映射关系请参见商品类型与促销类型、策略类型关系映射表。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "price", + "in": "body", + "required": false, + "description": "默认促销价格,单位为分,strategy取值为introductory、pay-up-front时,必须传入。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "integer", + "name": "numberOfUnits", + "in": "body", + "required": false, + "description": "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "type": "string", + "name": "periodUnit", + "in": "body", + "required": false, + "description": "优惠周期单位,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "itemsType": "object", + "type": "array", + "name": "languages", + "in": "body", + "required": false, + "description": "各个国家的语言信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "itemsType": "object", + "type": "array", + "name": "promotionPrice", + "in": "body", + "required": true, + "description": "各个国家的自定义价格信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "object", + "name": "promotion", + "in": "body", + "required": false, + "description": "促销信息。 说明 消耗型、非消耗型、非续期订阅型商品不支持传入该字段。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "reviewResourceId", + "in": "body", + "required": false, + "description": "资源ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "reviewNote", + "in": "body", + "required": false, + "description": "审核文本。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "type": "string", + "name": "reviewPath", + "in": "body", + "required": false, + "description": "资源内路径。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "string", + "type": "array", + "name": "salesCountry", + "in": "body", + "required": false, + "description": "销售国家/地区。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "autoAddSaleCountry", + "in": "body", + "required": false, + "description": "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section13500173412311", + "itemsType": "object", + "type": "array", + "name": "products", + "in": "body", + "required": true, + "description": "商品列表信息。" + } + ], + "body": "requestId,products", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "officialSlug": "agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/batchupdateproduct-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms batchupdateproduct-harmonyosnext --invoke --body body.json", + "show": "agc pms batchupdateproduct-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "按条件查询商品信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:21.986Z", + "status": "browser-read", + "readCommand": "agc pms bygetproductinfo-android --docs --pretty" + }, + "id": "bygetproductinfo-android", + "familyId": "pms", + "name": "按条件查询商品信息", + "description": "此接口用于商品查询,支持多条件过滤,根据productNo和AppId唯一查询一个商品信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v1/manage/product/list", + "command": "agc pms bygetproductinfo-android", + "requiredParams": [ + "appId", + "requestId", + "country" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "productNo", + "in": "body", + "required": false, + "description": "查询应用内指定商品标识的商品,如果不传值默认查询所有应用内商品。支持多个商品标识过滤查询,使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": false, + "description": "待查询的商品名称,支持按关键字模糊查询。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "purchaseType", + "in": "body", + "required": false, + "description": "如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "如果查多种商品状态,使用英文逗号分隔,取值如下: active:在线 inactive:下线 delete:删除" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "orderBy", + "in": "body", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: price:价格 updateTime:更新时间 value取值desc降序或者asc升序 例如:按价格price升序,更新时间updateTime降序, 则配置为{\"price\": \"asc\",\"updateTime\": \"desc\"}" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "beginTime", + "in": "body", + "required": false, + "description": "商品更新开始时间,格式为:yyyy-MM-dd HH:mm:ss。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "endTime", + "in": "body", + "required": false, + "description": "商品更新结束时间,格式为:yyyy-MM-dd HH:mm:ss。 beginTime和endTime设置后可以查询出updateTime在此时间段内的商品。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "integer", + "name": "pageNum", + "in": "body", + "required": false, + "description": "请求查询的起始页码,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "type": "string", + "name": "groupId", + "in": "body", + "required": false, + "description": "订阅组ID,如果不为空,则仅查询该组下商品。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316", + "officialSlug": "agcapi-bygetproductinfo-android-0000002135929316", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/bygetproductinfo-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms bygetproductinfo-android --invoke --body body.json", + "show": "agc pms bygetproductinfo-android --pretty" + } + }, + { + "documentation": { + "title": "按条件查询商品信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:23.893Z", + "status": "browser-read", + "readCommand": "agc pms bygetproductinfo-harmonyosnext --docs --pretty" + }, + "id": "bygetproductinfo-harmonyosnext", + "familyId": "pms", + "name": "按条件查询商品信息", + "description": "此接口用于商品查询,支持多条件过滤,根据productNo和AppId唯一查询一个商品信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/product/list", + "command": "agc pms bygetproductinfo-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "country" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "productNo", + "in": "body", + "required": false, + "description": "查询应用内指定商品标识的商品,如果不传值默认查询所有应用内商品。支持多个商品标识过滤查询,使用英文逗号分隔。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "maxLength": 55, + "type": "string", + "name": "productName", + "in": "body", + "required": false, + "description": "待查询的商品名称,支持按关键字模糊查询。不支持特殊字符|。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "purchaseType", + "in": "body", + "required": false, + "description": "如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non_renewing_subscription:非续期订阅型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "status", + "in": "body", + "required": false, + "description": "如果查多种商品状态,使用英文逗号分隔,取值如下: active:在线 inactive:下线 delete:删除 drafts: 草稿 toBeSubmitted: 待提交 underReview:审核中 rejected: 审核不通过" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "orderBy", + "in": "body", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: price:价格 updateTime:更新时间 value取值desc降序或者asc升序 例如:按价格price升序,更新时间updateTime降序, 则配置为{\"price\": \"asc\",\"updateTime\": \"desc\"}" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "beginTime", + "in": "body", + "required": false, + "description": "商品更新开始时间,格式为:yyyy-MM-dd HH:mm:ss。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "endTime", + "in": "body", + "required": false, + "description": "商品更新结束时间,格式为:yyyy-MM-dd HH:mm:ss。 beginTime和endTime设置后可以查询出updateTime在此时间段内的商品。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "integer", + "name": "pageNum", + "in": "body", + "required": false, + "description": "请求查询的起始页码,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "country", + "in": "body", + "required": true, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "type": "string", + "name": "groupId", + "in": "body", + "required": false, + "description": "订阅组ID,如果不为空,则仅查询该组下商品。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609", + "officialSlug": "agcapi-bygetproductinfo-harmonyosnext-0000002166748609", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/bygetproductinfo-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms bygetproductinfo-harmonyosnext --invoke --body body.json", + "show": "agc pms bygetproductinfo-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "按条件查询商品促销信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:25.557Z", + "status": "browser-read", + "readCommand": "agc pms bygetpromotioninfo-android --docs --pretty" + }, + "id": "bygetpromotioninfo-android", + "familyId": "pms", + "name": "按条件查询商品促销信息", + "description": "此接口用于商品促销查询,支持多条件过滤。", + "method": "POST", + "path": "/api/pms/product-price-service/v1/manage/product/promotion/list", + "command": "agc pms bygetpromotioninfo-android", + "requiredParams": [ + "appId", + "requestId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "type": "string", + "name": "productNo", + "in": "body", + "required": false, + "description": "查询指定的商品的促销信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "type": "string", + "name": "promotionId", + "in": "body", + "required": false, + "description": "预留字段,暂不启用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "type": "string", + "name": "strategy", + "in": "body", + "required": false, + "description": "策略类型: trial:免费 introductory:按周期扣费" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "type": "integer", + "name": "pageNum", + "in": "body", + "required": false, + "description": "请求查询的起始页码,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "type": "string", + "name": "orderBy", + "in": "body", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。 key取值范围为: createTime:创建时间 updateTime:更新时间 status:促销进行状态 startDate:开始促销时间 endDate:结束促销时间 value取值desc降序或者asc升序 例如:按createTime升序,updateTime降序,则配置为{\"createTime\": \"asc\",\"updateTime\": \"desc\"}" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "type": "string", + "name": "filterBy", + "in": "body", + "required": false, + "description": "支持按促销状态和时间过滤。配置JSON对象,key为属性名,value为过滤的值。 key值范围如下: status:促销状态取值范围为 0:正在进行中的促销 1:未开始的促销 2:已结束的促销 例如:单选{\"status\":\"0\"}和多选{\"status\":[\"0\", \"1\"]} startDate:促销开始时间范围 例如:{\"startDate\":{\"1621843475000\":\"1631435475000\"}} endDate:促销结束时间范围 例如:{\"endDate\":{\"1621843475000\":\"1631435475000\"}} date:该时间范围内开始的促销、结束的促销和进行中的促销活动 例如:{\"date\":{\"1621843475000\":\"1631435475000\"}} key值可以包含上面的所有取值进行组合过滤,比如同时使用status和startDate过滤可以用下面的JSON: {\"status\":[ \"0\",\"1\"],\"startDate\":{\"1021843475000\":\"1631435475000\"}}" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416", + "officialSlug": "agcapi-bygetpromotioninfo-android-0000002136087416", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/bygetpromotioninfo-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms bygetpromotioninfo-android --invoke --body body.json", + "show": "agc pms bygetpromotioninfo-android --pretty" + } + }, + { + "documentation": { + "title": "按条件查询商品促销信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:27.712Z", + "status": "browser-read", + "readCommand": "agc pms bygetpromotioninfo-harmonyosnext --docs --pretty" + }, + "id": "bygetpromotioninfo-harmonyosnext", + "familyId": "pms", + "name": "按条件查询商品促销信息", + "description": "此接口用于商品促销查询,支持多条件过滤。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/product/promotion/list", + "command": "agc pms bygetpromotioninfo-harmonyosnext", + "requiredParams": [ + "appId", + "requestId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "string", + "name": "productNo", + "in": "body", + "required": false, + "description": "查询指定的商品的促销信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "string", + "name": "promotionId", + "in": "body", + "required": false, + "description": "预留字段,暂不启用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "string", + "name": "strategy", + "in": "body", + "required": false, + "description": "策略类型: trial:免费(仅自动续期型商品支持) introductory:按周期扣费(仅自动续期型商品支持) pay-up-front:提前支付(仅自动续期型商品支持) single-promotion:单商品优惠(仅消耗型,非消耗型,非续期型商品支持)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "integer", + "name": "pageNum", + "in": "body", + "required": false, + "description": "请求查询的起始页码,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "string", + "name": "orderBy", + "in": "body", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。 key取值范围为: createTime:创建时间 updateTime:更新时间 status:促销进行状态 startDate:开始促销时间 endDate:结束促销时间 value取值desc降序或者asc升序 例如:按createTime升序,updateTime降序, 则配置为{\"createTime\": \"asc\",\"updateTime\": \"desc\"}" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "string", + "name": "filterBy", + "in": "body", + "required": false, + "description": "支持按促销状态和时间过滤。配置JSON对象,key为属性名,value为过滤的值。 key值范围如下: status:促销状态取值范围为 0:正在进行中的促销 1:未开始的促销 2:已结束的促销 例如:单选{\"status\":\"0\"}和多选{\"status\":[\"0\", \"1\"]} startDate:促销开始时间范围 例如:{\"startDate\":{\"1621843475000\":\"1631435475000\"}} endDate:促销结束时间范围 例如:{\"endDate\":{\"1621843475000\":\"1631435475000\"}} date:该时间范围内开始的促销、结束的促销和进行中的促销活动 例如:{\"date\":{\"1621843475000\":\"1631435475000\"}} key值可以包含上面的所有取值进行组合过滤,比如同时使用status和startDate过滤可以用下面的JSON: {\"status\":[ \"0\",\"1\"],\"startDate\":{\"1021843475000\":\"1631435475000\"}}" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "integer", + "name": "promotionType", + "in": "body", + "required": false, + "description": "促销类型,默认值:0。 0:新用户促销 1:自定义人群促销 4:退订挽留促销" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "type": "string", + "name": "offerId", + "in": "body", + "required": false, + "description": "优惠促销标识符,用于区分不同优惠促销,该ID当前商品下唯一,最大长度64个字符,需满足[0-9a-zA-Z],仅在促销类型为自定义人群促销时支持。" + } + ], + "body": "json", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "officialSlug": "agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/bygetpromotioninfo-harmonyosnext", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms bygetpromotioninfo-harmonyosnext --invoke --body body.json", + "show": "agc pms bygetpromotioninfo-harmonyosnext --pretty" + } + }, + { + "documentation": { + "title": "查询商品订阅分组信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:29.856Z", + "status": "browser-read", + "readCommand": "agc pms getproductgroup-android --docs --pretty" + }, + "id": "getproductgroup-android", + "familyId": "pms", + "name": "查询商品订阅分组信息", + "description": "此接口用于查询商品订阅分组信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v1/manage/product/group/list", + "command": "agc pms getproductgroup-android", + "requiredParams": [ + "appId", + "requestId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736", + "type": "integer", + "name": "pageNum", + "in": "body", + "required": false, + "description": "起始页数,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736", + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "返回数据每页的条数, 默认是20。 取值范围:1~300" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736", + "type": "string", + "name": "orderBy", + "in": "body", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: name:订阅分组名称 createTime:创建时间 updateTime:更新时间 value取值desc降序或者asc升序 例如:按name降序,按createTime升序,则配置为{\"name\": \"desc\",\"createTime\": \"asc\"}" + } + ], + "body": "requestId,pageNum,pageSize,orderBy", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009", + "officialSlug": "agcapi-getproductgroup-android-0000002171407009", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/getproductgroup-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms getproductgroup-android --invoke --body body.json", + "show": "agc pms getproductgroup-android --pretty" + } + }, + { + "documentation": { + "title": "查询商品订阅分组信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:32.112Z", + "status": "browser-read", + "readCommand": "agc pms getproductgroup-harmonyosnext --docs --pretty" + }, + "id": "getproductgroup-harmonyosnext", + "familyId": "pms", + "name": "查询商品订阅分组信息", + "description": "此接口用于查询商品订阅分组信息。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/product/group/list", + "command": "agc pms getproductgroup-harmonyosnext", + "requiredParams": [ + "appId", + "requestId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736", + "type": "integer", + "name": "pageNum", + "in": "body", + "required": false, + "description": "起始页数,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736", + "type": "integer", + "name": "pageSize", + "in": "body", + "required": false, + "description": "返回数据每页的条数, 默认是20。 取值范围:1~300" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736", + "type": "string", + "name": "orderBy", + "in": "body", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: name:订阅分组名称 createTime:创建时间 updateTime:更新时间 value取值desc降序或者asc升序 例如:按name降序,按createTime升序,则配置为{\"name\": \"desc\",\"createTime\": \"asc\"}" + } + ], + "body": "requestId,pageNum,pageSize,orderBy", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848", + "officialSlug": "agcapi-getproductgroup-harmonyosnext-0000002131508848", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/getproductgroup-harmonyosnext", + "method": "GET" } }, "affordances": { - "invoke": "agc publishing appid-list --invoke", - "show": "agc publishing appid-list --pretty" + "invoke": "agc pms getproductgroup-harmonyosnext --invoke --body body.json", + "show": "agc pms getproductgroup-harmonyosnext --pretty" } }, { - "id": "gms", - "familyId": "publishing", - "name": "设置应用GMS依赖属性", - "description": "此接口用于向AGC上报应用是否依赖GMS。", - "method": "PUT", - "path": "/api/publish/v2/properties/gms", - "command": "agc publishing gms", - "body": "json", + "documentation": { + "title": "查询商品详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:33.741Z", + "status": "browser-read", + "readCommand": "agc pms getproductinfo-android --docs --pretty" + }, + "id": "getproductinfo-android", + "familyId": "pms", + "name": "查询商品详情", + "description": "此接口用于商品详情查询,根据productNo和appId唯一查询一个商品信息。", + "method": "GET", + "path": "/api/pms/product-price-service/v1/manage/product", + "command": "agc pms getproductinfo-android", + "requiredParams": [ + "productNo", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1212175012015", + "type": "string", + "name": "productNo", + "in": "query", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1212175012015", + "type": "string", + "name": "country", + "in": "query", + "required": false, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094", - "officialSlug": "agcapi-gms-0000001111845094", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609", + "officialSlug": "agcapi-getproductinfo-android-0000002171288609", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/publishing/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/publishing/endpoints/gms", + "href": "/api/v1/pms/endpoints/getproductinfo-android", "method": "GET" } }, "affordances": { - "invoke": "agc publishing gms --invoke --body body.json", - "show": "agc publishing gms --pretty" + "invoke": "agc pms getproductinfo-android --invoke", + "show": "agc pms getproductinfo-android --pretty" } }, { - "id": "language-info-delete", - "familyId": "publishing", - "name": "删除语言描述信息", - "description": "此接口用于删除指定应用不需要的语言描述信息,默认语言不支持删除。", - "method": "DELETE", - "path": "/api/publish/v2/app-language-info", - "command": "agc publishing language-info-delete", + "documentation": { + "title": "查询商品详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:35.430Z", + "status": "browser-read", + "readCommand": "agc pms getproductinfo-harmonyosnext --docs --pretty" + }, + "id": "getproductinfo-harmonyosnext", + "familyId": "pms", + "name": "查询商品详情", + "description": "此接口用于商品详情查询,根据productNo和appId唯一查询一个商品信息。", + "method": "GET", + "path": "/api/pms/product-price-service/v2/manage/product", + "command": "agc pms getproductinfo-harmonyosnext", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015", + "type": "string", + "name": "productNo", + "in": "query", + "required": false, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 注意 productNo和productId必须至少传一个。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015", + "type": "string", + "name": "productId", + "in": "query", + "required": false, + "description": "注意 productNo和productId必须至少传一个。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015", + "type": "string", + "name": "country", + "in": "query", + "required": false, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-delete-0000001111845088", - "officialSlug": "agcapi-language-info-delete-0000001111845088", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", + "officialSlug": "agcapi-getproductinfo-harmonyosnext-0000002131350708", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/publishing/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/publishing/endpoints/language-info-delete", + "href": "/api/v1/pms/endpoints/getproductinfo-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc publishing language-info-delete --invoke", - "show": "agc publishing language-info-delete --pretty" + "invoke": "agc pms getproductinfo-harmonyosnext --invoke", + "show": "agc pms getproductinfo-harmonyosnext --pretty" } }, { - "id": "language-info-update", - "familyId": "publishing", - "name": "更新语言描述信息", - "description": "此接口用于更新指定应用的语言描述信息,如果当前没有语言描述信息则新增。", - "method": "PUT", - "path": "/api/publish/v2/app-language-info", - "command": "agc publishing language-info-update", - "body": "json", + "documentation": { + "title": "查询商品促销详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:37.263Z", + "status": "browser-read", + "readCommand": "agc pms getpromotioninfo-android --docs --pretty" + }, + "id": "getpromotioninfo-android", + "familyId": "pms", + "name": "查询商品促销详情", + "description": "此接口用于查询商品促销信息。", + "method": "GET", + "path": "/api/pms/product-price-service/v1/manage/product/promotion", + "command": "agc pms getpromotioninfo-android", + "requiredParams": [ + "promotionId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section538885302312", + "type": "string", + "name": "promotionId", + "in": "query", + "required": true, + "description": "促销优惠活动唯一ID。 获取来源: 调用创建商品促销信息接口,返回promotionId 。 调用按条件查询商品促销信息接口,会返回promotionId。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057", - "officialSlug": "agcapi-language-info-update-0000001158245057", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328", + "officialSlug": "agcapi-getpromotioninfo-android-0000002135929328", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/publishing/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/publishing/endpoints/language-info-update", + "href": "/api/v1/pms/endpoints/getpromotioninfo-android", "method": "GET" } }, "affordances": { - "invoke": "agc publishing language-info-update --invoke --body body.json", - "show": "agc publishing language-info-update --pretty" + "invoke": "agc pms getpromotioninfo-android --invoke", + "show": "agc pms getpromotioninfo-android --pretty" } }, { - "id": "obbfile-package-list", - "familyId": "publishing", - "name": "查询软件包列表", - "description": "此接口用于查询应用当前关联的软件包列表信息。", + "documentation": { + "title": "查询商品促销详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:40.079Z", + "status": "browser-read", + "readCommand": "agc pms getpromotioninfo-harmonyosnext --docs --pretty" + }, + "id": "getpromotioninfo-harmonyosnext", + "familyId": "pms", + "name": "查询商品促销详情", + "description": "此接口用于查询商品促销信息。", "method": "GET", - "path": "/api/publish/v2/package-list", - "command": "agc publishing obbfile-package-list", + "path": "/api/pms/product-price-service/v2/manage/product/promotion", + "command": "agc pms getpromotioninfo-harmonyosnext", + "requiredParams": [ + "promotionId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section538885302312", + "type": "string", + "name": "promotionId", + "in": "query", + "required": true, + "description": "促销优惠活动唯一ID。 获取来源: 调用创建商品促销信息接口,返回promotionId。 调用按条件查询商品促销信息接口,返回promotionId。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210", - "officialSlug": "agcapi-obbfile-package-list-0000001111685210", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617", + "officialSlug": "agcapi-getpromotioninfo-harmonyosnext-0000002166748617", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/publishing/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/publishing/endpoints/obbfile-package-list", + "href": "/api/v1/pms/endpoints/getpromotioninfo-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc publishing obbfile-package-list --invoke", - "show": "agc publishing obbfile-package-list --pretty" + "invoke": "agc pms getpromotioninfo-harmonyosnext --invoke", + "show": "agc pms getpromotioninfo-harmonyosnext --pretty" } }, { - "id": "phased-release", - "familyId": "publishing", - "name": "更新分阶段发布", - "description": "此接口用于将分阶段发布修改为全网发布,或者更新分阶段发布的设置。", - "method": "PUT", - "path": "/api/publish/v2/phased-release", - "command": "agc publishing phased-release", - "body": "json", + "documentation": { + "title": "查询是否有在线商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:42.070Z", + "status": "browser-read", + "readCommand": "agc pms isproductactive-android --docs --pretty" + }, + "id": "isproductactive-android", + "familyId": "pms", + "name": "查询是否有在线商品", + "description": "此接口用于根据AppId查询是否有激活的商品。", + "method": "GET", + "path": "/api/pms/product-price-service/v1/manage/product/check", + "command": "agc pms isproductactive-android", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + } + ], + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412", + "officialSlug": "agcapi-isproductactive-android-0000002136087412", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/pms/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/pms/endpoints/isproductactive-android", + "method": "GET" + } + }, + "affordances": { + "invoke": "agc pms isproductactive-android --invoke", + "show": "agc pms isproductactive-android --pretty" + } + }, + { + "documentation": { + "title": "查询是否有在线商品", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:43.639Z", + "status": "browser-read", + "readCommand": "agc pms isproductactive-harmonyosnext --docs --pretty" + }, + "id": "isproductactive-harmonyosnext", + "familyId": "pms", + "name": "查询是否有在线商品", + "description": "此接口用于根据AppId查询是否有激活的商品。", + "method": "GET", + "path": "/api/pms/product-price-service/v2/manage/product/check", + "command": "agc pms isproductactive-harmonyosnext", + "requiredParams": [ + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204", - "officialSlug": "agcapi-phased-release-0000001111685204", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145", + "officialSlug": "agcapi-isproductactive-harmonyosnext-0000002166670145", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/publishing/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/publishing/endpoints/phased-release", + "href": "/api/v1/pms/endpoints/isproductactive-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc publishing phased-release --invoke --body body.json", - "show": "agc publishing phased-release --pretty" + "invoke": "agc pms isproductactive-harmonyosnext --invoke", + "show": "agc pms isproductactive-harmonyosnext --pretty" } }, { - "id": "query-aabfile", - "familyId": "publishing", - "name": "查询软件包编译状态", - "description": "此接口用于查询软件包的编译状态。", - "method": "GET", - "path": "/api/publish/v2/package/compile/status", - "command": "agc publishing query-aabfile", + "documentation": { + "title": "更新商品订阅分组等级信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:45.160Z", + "status": "browser-read", + "readCommand": "agc pms levelgroup-harmonyosnext --docs --pretty" + }, + "id": "levelgroup-harmonyosnext", + "familyId": "pms", + "name": "更新商品订阅分组等级信息", + "description": "此接口用于更新商品订阅分组等级信息。", + "method": "PUT", + "path": "/api/pms/product-price-service/v2/manage/product/group/level", + "command": "agc pms levelgroup-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "groupId", + "productGroupInfoList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545", + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545", + "type": "string", + "name": "groupId", + "in": "body", + "required": true, + "description": "订阅组ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545", + "itemsType": "object", + "type": "array", + "name": "productGroupInfoList", + "in": "body", + "required": true, + "description": "订阅组等级信息列表。" + } + ], + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206", - "officialSlug": "agcapi-query-aabfile-0000001111685206", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485", + "officialSlug": "agcapi-levelgroup-harmonyosnext-0000002175107485", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/publishing/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/publishing/endpoints/query-aabfile", + "href": "/api/v1/pms/endpoints/levelgroup-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc publishing query-aabfile --invoke", - "show": "agc publishing query-aabfile --pretty" + "invoke": "agc pms levelgroup-harmonyosnext --invoke --body body.json", + "show": "agc pms levelgroup-harmonyosnext --pretty" } }, { - "id": "update-releasetime", - "familyId": "publishing", - "name": "更新版本上架时间", - "description": "此接口用于设置版本的上架时间。", - "method": "PUT", - "path": "/api/publish/v2/on-shelf-time", - "command": "agc publishing update-releasetime", + "documentation": { + "title": "上传资源", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T05:10:35.009Z", + "status": "browser-read", + "readCommand": "agc pms resourcemanage-harmonyosnext --docs --pretty" + }, + "id": "resourcemanage-harmonyosnext", + "familyId": "pms", + "name": "上传资源", + "description": "此接口用于提交上传资源。", + "method": "POST", + "path": "/api/pms/product-price-service/v2/manage/resource", + "command": "agc pms resourcemanage-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "file", + "fileType", + "zoneId", + "fileName" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "type": "file", + "name": "file", + "in": "file", + "required": true, + "description": "上传的文件。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "enum": [ + "1" + ], + "type": "string", + "name": "fileType", + "in": "body", + "required": true, + "description": "上传文件的类型,固定取值: 1:图片" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "enum": [ + "1" + ], + "type": "string", + "name": "zoneId", + "in": "body", + "required": true, + "description": "上传区域的ID,固定取值: 1:中国区" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "type": "string", + "name": "fileName", + "in": "body", + "required": true, + "description": "上传文件的名称。" + } + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-update-releasetime-0000001158365053", - "officialSlug": "agcapi-update-releasetime-0000001158365053", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792", + "officialSlug": "agcapi-resourcemanage-harmonyosnext-0000002131361792", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/publishing/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/publishing/endpoints/update-releasetime", + "href": "/api/v1/pms/endpoints/resourcemanage-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc publishing update-releasetime --invoke --body body.json", - "show": "agc publishing update-releasetime --pretty" + "invoke": "agc pms resourcemanage-harmonyosnext --invoke --body body.json", + "show": "agc pms resourcemanage-harmonyosnext --pretty" } }, { - "id": "obbfile-compose", - "familyId": "upload", - "name": "合并分片", - "description": "此接口用于将已经上传成功后的分片合并为一个文件。", + "documentation": { + "title": "提交商品审核", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:59:33.769Z", + "status": "browser-read", + "readCommand": "agc pms reviewproduct-harmonyosnext --docs --pretty" + }, + "id": "reviewproduct-harmonyosnext", + "familyId": "pms", + "name": "提交商品审核", + "description": "此接口用于提交商品审核。", "method": "POST", - "path": "/api/publish/v2/upload/multipart/compose", - "command": "agc upload obbfile-compose", + "path": "/api/pms/product-price-service/v2/manage/product/review", + "command": "agc pms reviewproduct-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "productIdList" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section48988321545", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section48988321545", + "itemsType": "string", + "type": "array", + "name": "productIdList", + "in": "body", + "required": true, + "description": "待审核商品列表,一次最多提交20个商品审核。商品ID是系统生成的ID,非用户指定,商品ID可以通过查询商品详情接口进行查询。" + } + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098", - "officialSlug": "agcapi-obbfile-compose-0000001111845098", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241", + "officialSlug": "agcapi-reviewproduct-harmonyosnext-0000002166681241", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/upload/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/upload/endpoints/obbfile-compose", + "href": "/api/v1/pms/endpoints/reviewproduct-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc upload obbfile-compose --invoke --body body.json", - "show": "agc upload obbfile-compose --pretty" + "invoke": "agc pms reviewproduct-harmonyosnext --invoke --body body.json", + "show": "agc pms reviewproduct-harmonyosnext --pretty" } }, { - "id": "obbfile-init", - "familyId": "upload", - "name": "分片上传初始化", - "description": "此接口用于分片信息初始化,在获取分片文件上传地址前调用。", - "method": "POST", - "path": "/api/publish/v2/upload/multipart/init", - "command": "agc upload obbfile-init", + "documentation": { + "title": "更新商品信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:35.451Z", + "status": "browser-read", + "readCommand": "agc pms updateproduct-android --docs --pretty" + }, + "id": "updateproduct-android", + "familyId": "pms", + "name": "更新商品信息", + "description": "此接口用于更新商品定义信息,包含商品价格,展示语言和商品状态。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product", + "command": "agc pms updateproduct-android", + "requiredParams": [ + "appId", + "requestId", + "resource" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section1692522315316", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section1692522315316", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品信息。" + } + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", - "officialSlug": "agcapi-obbfile-init-0000001158365055", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404", + "officialSlug": "agcapi-updateproduct-android-0000002136087404", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/upload/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/upload/endpoints/obbfile-init", + "href": "/api/v1/pms/endpoints/updateproduct-android", "method": "GET" } }, "affordances": { - "invoke": "agc upload obbfile-init --invoke --body body.json", - "show": "agc upload obbfile-init --pretty" + "invoke": "agc pms updateproduct-android --invoke --body body.json", + "show": "agc pms updateproduct-android --pretty" } }, { - "id": "obbfile-upload", - "familyId": "upload", - "name": "上传分片实体", - "description": "将单个分片上传到获取分片上传地址接口返回的上传地址。", + "documentation": { + "title": "更新商品信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:37.159Z", + "status": "browser-read", + "readCommand": "agc pms updateproduct-harmonyosnext --docs --pretty" + }, + "id": "updateproduct-harmonyosnext", + "familyId": "pms", + "name": "更新商品信息", + "description": "此接口用于更新商品定义信息,包含商品价格,展示语言和商品状态。", "method": "PUT", - "path": "{uploadUrl}", - "command": "agc upload obbfile-upload", + "path": "/api/pms/product-price-service/v2/manage/product", + "command": "agc pms updateproduct-harmonyosnext", "requiredParams": [ - "uploadUrl" + "appId", + "requestId", + "resource" ], "parameters": [ { - "name": "uploadUrl", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section1692522315316", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section1692522315316", + "type": "object", + "name": "resource", + "in": "body", "required": true, - "description": "uploadUrl parameter" + "description": "商品信息。" } ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", - "officialSlug": "agcapi-obbfile-upload-0000001158245067", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141", + "officialSlug": "agcapi-updateproduct-harmonyosnext-0000002166670141", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/upload/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/upload/endpoints/obbfile-upload", + "href": "/api/v1/pms/endpoints/updateproduct-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc upload obbfile-upload --invoke --body body.json", - "show": "agc upload obbfile-upload --pretty" + "invoke": "agc pms updateproduct-harmonyosnext --invoke --body body.json", + "show": "agc pms updateproduct-harmonyosnext --pretty" } }, { - "id": "obbfile-uploadurl", - "familyId": "upload", - "name": "获取分片上传地址", - "description": "此接口用于获取文件所有分片的上传地址,调用此接口前必须先调用 分片上传初始化 接口完成分片初始化。", - "method": "POST", - "path": "/api/publish/v2/upload/multipart/parts", - "command": "agc upload obbfile-uploadurl", - "body": "json", + "documentation": { + "title": "更新商品订阅分组信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:38.602Z", + "status": "browser-read", + "readCommand": "agc pms updateproductgroup-android --docs --pretty" + }, + "id": "updateproductgroup-android", + "familyId": "pms", + "name": "更新商品订阅分组信息", + "description": "此接口用于更新商品订阅分组信息。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product/group", + "command": "agc pms updateproductgroup-android", + "requiredParams": [ + "appId", + "requestId", + "resource" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section46842575213", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section46842575213", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品分组信息。" + } + ], + "body": "requestId,resource", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", - "officialSlug": "agcapi-obbfile-uploadurl-0000001111685208", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400", + "officialSlug": "agcapi-updateproductgroup-android-0000002136087400", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/upload/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/upload/endpoints/obbfile-uploadurl", + "href": "/api/v1/pms/endpoints/updateproductgroup-android", "method": "GET" } }, "affordances": { - "invoke": "agc upload obbfile-uploadurl --invoke --body body.json", - "show": "agc upload obbfile-uploadurl --pretty" + "invoke": "agc pms updateproductgroup-android --invoke --body body.json", + "show": "agc pms updateproductgroup-android --pretty" } }, { - "id": "upload-file-new", - "familyId": "upload", - "name": "上传文件", - "description": "将文件上传到获取文件上传地址接口返回的上传地址。", + "documentation": { + "title": "更新商品订阅分组信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:40.203Z", + "status": "browser-read", + "readCommand": "agc pms updateproductgroup-harmonyosnext --docs --pretty" + }, + "id": "updateproductgroup-harmonyosnext", + "familyId": "pms", + "name": "更新商品订阅分组信息", + "description": "此接口用于更新商品订阅分组信息。", "method": "PUT", - "path": "{uploadUrl}", - "command": "agc upload upload-file-new", + "path": "/api/pms/product-price-service/v2/manage/product/group", + "command": "agc pms updateproductgroup-harmonyosnext", "requiredParams": [ - "uploadUrl" + "appId", + "requestId", + "resource" ], "parameters": [ { - "name": "uploadUrl", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908", + "type": "string", + "name": "appId", + "in": "header", "required": true, - "description": "uploadUrl parameter" + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section46842575213", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section46842575213", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品分组信息。" } ], - "body": "json", + "body": "requestId,resource", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", - "officialSlug": "agcapi-upload-file-new-0000001111845090", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137", + "officialSlug": "agcapi-updateproductgroup-harmonyosnext-0000002166670137", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/upload/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/upload/endpoints/upload-file-new", + "href": "/api/v1/pms/endpoints/updateproductgroup-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc upload upload-file-new --invoke --body body.json", - "show": "agc upload upload-file-new --pretty" + "invoke": "agc pms updateproductgroup-harmonyosnext --invoke --body body.json", + "show": "agc pms updateproductgroup-harmonyosnext --pretty" } }, { - "id": "upload-url-new", - "familyId": "upload", - "name": "获取文件上传地址", - "description": "上传文件至AppGallery Connect前需要先调用此接口获取上传地址,包括图片、视频、PDF等文件。", - "method": "GET", - "path": "/api/publish/v2/upload-url/for-obs", - "command": "agc upload upload-url-new", + "documentation": { + "title": "更新商品促销信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621", + "updatedAt": "2026-02-11 14:07", + "checkedAt": "2026-10-07T02:59:41.916Z", + "status": "browser-read", + "readCommand": "agc pms updatepromotion-android --docs --pretty" + }, + "id": "updatepromotion-android", + "familyId": "pms", + "name": "更新商品促销信息", + "description": "此接口用于更新商品促销信息。", + "method": "PUT", + "path": "/api/pms/product-price-service/v1/manage/product/promotion", + "command": "agc pms updatepromotion-android", "requiredParams": [ - "contentLength" + "appId", + "requestId", + "resource" ], "parameters": [ { - "name": "contentLength", - "in": "query", - "required": true, - "description": "Upload file length in bytes" - }, - { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818", + "type": "string", "name": "appId", - "in": "query", - "required": false, - "description": "Huawei application ID" + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" }, { - "name": "suffix", - "in": "query", - "required": false, - "description": "Upload file suffix" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section281217918413", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" }, { - "name": "fileName", - "in": "query", - "required": false, - "description": "Upload file name" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section281217918413", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品促销价格信息。" } ], + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", - "officialSlug": "agcapi-upload-url-new-0000001111685200", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621", + "officialSlug": "agcapi-updatepromotion-android-0000002171288621", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/upload/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/upload/endpoints/upload-url-new", + "href": "/api/v1/pms/endpoints/updatepromotion-android", "method": "GET" } }, "affordances": { - "invoke": "agc upload upload-url-new --invoke", - "show": "agc upload upload-url-new --pretty" + "invoke": "agc pms updatepromotion-android --invoke --body body.json", + "show": "agc pms updatepromotion-android --pretty" } }, { - "id": "provision-api-add-device", - "familyId": "provisioning", - "name": "批量添加设备", - "description": "此接口用于批量添加调试/测试设备。", - "method": "POST", - "path": "/api/publish/v2/device", - "command": "agc provisioning provision-api-add-device", + "documentation": { + "title": "更新商品促销信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:44.161Z", + "status": "browser-read", + "readCommand": "agc pms updatepromotion-harmonyosnext --docs --pretty" + }, + "id": "updatepromotion-harmonyosnext", + "familyId": "pms", + "name": "更新商品促销信息", + "description": "此接口用于更新商品促销信息。", + "method": "PUT", + "path": "/api/pms/product-price-service/v2/manage/product/promotion", + "command": "agc pms updatepromotion-harmonyosnext", + "requiredParams": [ + "appId", + "requestId", + "resource" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818", + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section281217918413", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section281217918413", + "type": "object", + "name": "resource", + "in": "body", + "required": true, + "description": "商品促销价格信息。" + } + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498", - "officialSlug": "agc-help-provision-api-add-device-0000002236041498", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716", + "officialSlug": "agcapi-updatepromotion-harmonyosnext-0000002131350716", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/pms/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-add-device", + "href": "/api/v1/pms/endpoints/updatepromotion-harmonyosnext", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-add-device --invoke --body body.json", - "show": "agc provisioning provision-api-add-device --pretty" + "invoke": "agc pms updatepromotion-harmonyosnext --invoke --body body.json", + "show": "agc pms updatepromotion-harmonyosnext --pretty" } }, { - "id": "provision-api-add-fingerprints", - "familyId": "provisioning", - "name": "新增证书指纹", - "description": "此接口用于新增证书指纹。", + "documentation": { + "title": "查询资产明细", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:45.882Z", + "status": "browser-read", + "readCommand": "agc gameplay asset-details --docs --pretty" + }, + "id": "asset-details", + "familyId": "gameplay", + "name": "查询资产明细", + "description": "华为游戏服务器调用此接口查询玩家在玩游戏的资产明细数据,并将信息展示在游戏中心的“在玩”页面上。", "method": "POST", - "path": "/api/provision/v1/fingerprints", - "command": "agc provisioning provision-api-add-fingerprints", + "path": "{callbackUrl}", + "command": "agc gameplay asset-details", "requiredParams": [ + "callbackUrl", "appId", - "fingerprintList" + "timestamp", + "nonce", + "sign", + "appId", + "userId", + "userIdType", + "assetType", + "pageNo", + "pageSize", + "lang" ], "parameters": [ { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 32, + "type": "string", "name": "appId", "in": "header", "required": true, - "description": "Huawei application ID" + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 32, + "type": "string", + "name": "timestamp", + "in": "header", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 64, + "type": "string", + "name": "nonce", + "in": "header", + "required": true, + "description": "随机字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "header", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" }, { - "minItems": 1, - "maxItems": 50, - "itemsType": "string", - "type": "array", - "name": "fingerprintList", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "serverId", "in": "body", - "required": true, - "description": "SHA-256 证书指纹列表;只修改专用应用的测试指纹" - } - ], - "body": "fingerprintList", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480", - "officialSlug": "agc-help-provision-api-add-fingerprints-0000002431201480", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/provisioning/endpoints", - "method": "GET" + "required": false, + "description": "区服ID。" }, - "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-add-fingerprints", - "method": "GET" - } - }, - "affordances": { - "invoke": "agc provisioning provision-api-add-fingerprints --invoke --body body.json", - "show": "agc provisioning provision-api-add-fingerprints --pretty" - } - }, - { - "id": "provision-api-apply-cent", - "familyId": "provisioning", - "name": "申请证书", - "description": "此接口用于申请二进制证书、In-house发布证书、调试证书或发布证书。", - "method": "POST", - "path": "/api/publish/v3/cert", - "command": "agc provisioning provision-api-apply-cent", - "requiredParams": [ - "csr", - "certName", - "certType" - ], - "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32, "type": "string", - "name": "csr", + "name": "roleId", + "in": "body", + "required": false, + "description": "角色ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "assetType", "in": "body", "required": true, - "description": "公钥 CSR;私钥不得上传" + "description": "资产类型,例如:“skin”。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32, "type": "string", - "name": "certName", + "name": "category", + "in": "body", + "required": false, + "description": "资产分类标签值,例如“SSS”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "minimum": 1, + "type": "integer", + "name": "pageNo", "in": "body", "required": true, - "description": "专用证书名称" + "description": "页码。起始页码为1。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maximum": 100, "type": "integer", - "name": "certType", + "name": "pageSize", + "in": "body", + "required": true, + "description": "每页数量,默认20个,最大100个。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 20, + "type": "string", + "name": "lang", "in": "body", "required": true, - "description": "1:调试;2:发布;3:In-house;4:受限二进制证书" + "description": "语言,用于获取不同语言的资源明细数据,至少需要支持zh_CN(中文)和en_US(英文)。" } ], - "body": "csr,certName,certType", + "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302", - "officialSlug": "agc-help-provision-api-apply-cent-0000002236201302", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253", + "officialSlug": "agcapi-asset-details-0000002022225253", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-apply-cent", + "href": "/api/v1/gameplay/endpoints/asset-details", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-apply-cent --invoke --body body.json", - "show": "agc provisioning provision-api-apply-cent --pretty" + "invoke": "agc gameplay asset-details --invoke --body body.json", + "show": "agc gameplay asset-details --pretty" } }, { - "id": "provision-api-apply-provision", - "familyId": "provisioning", - "name": "申请Profile", - "description": "此接口用于申请指定设备发布Profile、In-house发布Profile、调试Profile或发布Profile。", + "documentation": { + "title": "查询资产概要", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:47.368Z", + "status": "browser-read", + "readCommand": "agc gameplay asset-summary --docs --pretty" + }, + "id": "asset-summary", + "familyId": "gameplay", + "name": "查询资产概要", + "description": "华为游戏服务器调用此接口查询玩家在玩游戏的资产概要数据,并将信息展示在游戏中心的“在玩”页面上。", "method": "POST", - "path": "/api/publish/v3/provision", - "command": "agc provisioning provision-api-apply-provision", + "path": "{callbackUrl}", + "command": "agc gameplay asset-summary", "requiredParams": [ - "provisionName", - "provisionType", - "certId", - "appId" + "callbackUrl", + "appId", + "timestamp", + "nonce", + "sign", + "appId", + "userId", + "userIdType", + "lang" ], "parameters": [ { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 32, "type": "string", - "name": "provisionName", - "in": "body", + "name": "appId", + "in": "header", "required": true, - "description": "专用 Profile 名称" + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" }, { - "type": "integer", - "name": "provisionType", - "in": "body", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 32, + "type": "string", + "name": "timestamp", + "in": "header", "required": true, - "description": "1:调试;2:发布;3:In-house;6:指定设备" + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 64, "type": "string", - "name": "certId", - "in": "body", + "name": "nonce", + "in": "header", + "required": true, + "description": "随机字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "header", "required": true, - "description": "本次生成的专用证书 ID" + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 32, "type": "string", "name": "appId", "in": "body", "required": true, - "description": "专用测试应用 ID" + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" }, { - "type": "array", - "name": "deviceIdList", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 32, + "type": "string", + "name": "serverId", "in": "body", "required": false, - "description": "真实设备 ID 列表,最多 4000 项" + "description": "区服ID。" }, { - "type": "array", - "name": "aclPermissionList", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 32, + "type": "string", + "name": "roleId", "in": "body", "required": false, - "description": "已获审批的 ACL 列表,最多 1000 项" - } - ], - "body": "provisionName,provisionType,certId,appId,deviceIdList,aclPermissionList", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689", - "officialSlug": "agc-help-provision-api-apply-provision-0000002271000689", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/provisioning/endpoints", - "method": "GET" + "description": "角色ID。" }, - "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-apply-provision", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 20, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言,用于获取不同语言的资产概要统计数据和资产明细数据,至少需要支持zh_CN(中文)和en_US(英文)。" } - }, - "affordances": { - "invoke": "agc provisioning provision-api-apply-provision --invoke --body body.json", - "show": "agc provisioning provision-api-apply-provision --pretty" - } - }, - { - "id": "provision-api-applyacl", - "familyId": "provisioning", - "name": "申请受限ACL权限", - "description": "此接口用于申请受限ACL权限。", - "method": "POST", - "path": "/api/provision/v1/user/permission/apply", - "command": "agc provisioning provision-api-applyacl", + ], "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721", - "officialSlug": "agc-help-provision-api-applyacl-0000002502198721", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", + "officialSlug": "agcapi-asset-summary-0000002022105729", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-applyacl", + "href": "/api/v1/gameplay/endpoints/asset-summary", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-applyacl --invoke --body body.json", - "show": "agc provisioning provision-api-applyacl --pretty" + "invoke": "agc gameplay asset-summary --invoke --body body.json", + "show": "agc gameplay asset-summary --pretty" } }, { - "id": "provision-api-delete-cent", - "familyId": "provisioning", - "name": "删除证书", - "description": "此接口用于删除创建的证书。", + "documentation": { + "title": "批量查询玩家基本信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:49.144Z", + "status": "browser-read", + "readCommand": "agc gameplay basic-info --docs --pretty" + }, + "id": "basic-info", + "familyId": "gameplay", + "name": "批量查询玩家基本信息", + "description": "华为游戏服务器调用此接口批量查询玩家基本信息,并将信息展示在游戏中心的“在玩”页面上。", "method": "POST", - "path": "/api/publish/v2/cert/delete", - "command": "agc provisioning provision-api-delete-cent", + "path": "{callbackUrl}", + "command": "agc gameplay basic-info", "requiredParams": [ - "certIds" + "callbackUrl", + "appId", + "timestamp", + "nonce", + "sign", + "appId", + "userIds", + "lang" ], "parameters": [ { - "minItems": 1, - "maxItems": 100, - "itemsType": "string", - "type": "array", - "name": "certIds", + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 32, + "type": "string", + "name": "timestamp", + "in": "header", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 64, + "type": "string", + "name": "nonce", + "in": "header", + "required": true, + "description": "随机字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "header", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "maxLength": 32, + "type": "string", + "name": "appId", "in": "body", "required": true, - "description": "待删除的本次运行专用证书 ID 列表" - } - ], - "body": "certIds", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685", - "officialSlug": "agc-help-provision-api-delete-cent-0000002271000685", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/provisioning/endpoints", - "method": "GET" + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" }, - "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-delete-cent", - "method": "GET" + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "itemsType": "object", + "type": "array", + "name": "userIds", + "in": "body", + "required": true, + "description": "玩家标识列表,最多返回20个玩家信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "maxLength": 20, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言,用于获取不同语言的玩家信息,至少需要支持zh_CN(中文)和en_US(英文)。" } - }, - "affordances": { - "invoke": "agc provisioning provision-api-delete-cent --invoke --body body.json", - "show": "agc provisioning provision-api-delete-cent --pretty" - } - }, - { - "id": "provision-api-delete-device", - "familyId": "provisioning", - "name": "删除设备", - "description": "此接口用于删除已添加的设备。", - "method": "POST", - "path": "/api/publish/v2/device/delete", - "command": "agc provisioning provision-api-delete-device", + ], "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633", - "officialSlug": "agc-help-provision-api-delete-device-0000002271160633", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322", + "officialSlug": "agcapi-basic-info-0000002038975322", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-delete-device", + "href": "/api/v1/gameplay/endpoints/basic-info", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-delete-device --invoke --body body.json", - "show": "agc provisioning provision-api-delete-device --pretty" + "invoke": "agc gameplay basic-info --invoke --body body.json", + "show": "agc gameplay basic-info --pretty" } }, { - "id": "provision-api-delete-fingerprints", - "familyId": "provisioning", - "name": "删除证书指纹", - "description": "此接口用于删除证书指纹。", - "method": "DELETE", - "path": "/api/provision/v1/fingerprints", - "command": "agc provisioning provision-api-delete-fingerprints", + "documentation": { + "title": "查询战绩筛选标签", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:52.248Z", + "status": "browser-read", + "readCommand": "agc gameplay label --docs --pretty" + }, + "id": "label", + "familyId": "gameplay", + "name": "查询战绩筛选标签", + "description": "华为游戏服务器调用此接口查询玩家在玩游戏战绩的筛选标签,并将信息展示在游戏中心的“在玩”页面上。", + "method": "POST", + "path": "{callbackUrl}", + "command": "agc gameplay label", "requiredParams": [ + "callbackUrl", "appId", - "fingerprintList" + "timestamp", + "nonce", + "sign", + "appId", + "lang" ], "parameters": [ { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 32, + "type": "string", "name": "appId", "in": "header", "required": true, - "description": "Huawei application ID" + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" }, { - "minItems": 1, - "maxItems": 50, - "itemsType": "string", - "type": "array", - "name": "fingerprintList", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 32, + "type": "string", + "name": "timestamp", + "in": "header", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 64, + "type": "string", + "name": "nonce", + "in": "header", + "required": true, + "description": "随机字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "header", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8202184551317", + "maxLength": 20, + "type": "string", + "name": "lang", "in": "body", "required": true, - "description": "SHA-256 证书指纹列表;只修改专用应用的测试指纹" + "description": "语言,用于获取不同语言的分类标签名称,至少需要支持zh_CN(中文)和en_US(英文)。" } ], + "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925", - "officialSlug": "agc-help-provision-api-delete-fingerprints-0000002464839925", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", + "officialSlug": "agcapi-label-0000001985625670", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-delete-fingerprints", + "href": "/api/v1/gameplay/endpoints/label", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-delete-fingerprints --invoke", - "show": "agc provisioning provision-api-delete-fingerprints --pretty" + "invoke": "agc gameplay label --invoke --body body.json", + "show": "agc gameplay label --pretty" } }, { - "id": "provision-api-delete-provision", - "familyId": "provisioning", - "name": "删除Profile", - "description": "此接口用于删除申请的Profile。", - "method": "DELETE", - "path": "/api/publish/v2/provision", - "command": "agc provisioning provision-api-delete-provision", + "defaultBaseUrl": "https://jos-open-api.cloud.huawei.com", + "authentication": "body-signature", + "requestContentType": "application/x-www-form-urlencoded", + "documentation": { + "title": "上传/下架游戏资源", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:54.087Z", + "status": "browser-read", + "readCommand": "agc gameplay resources --docs --pretty" + }, + "id": "resources", + "familyId": "gameplay", + "name": "上传/下架游戏资源", + "description": "开发者服务器调用此接口同步华为服务器的游戏资源,用于上传或下架“在玩”页面上的图片或视频。", + "method": "POST", + "path": "/gameservice/api/gbClientApi", + "command": "agc gameplay resources", "requiredParams": [ - "id" + "method", + "appId", + "resources", + "ts", + "sign" ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 64, + "enum": [ + "external.hms.gs.syncGameResources" + ], "type": "string", - "name": "id", - "in": "query", + "name": "method", + "in": "body", "required": true, - "description": "本次创建并登记的专用 Profile ID" - } - ], - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310", - "officialSlug": "agc-help-provision-api-delete-provision-0000002236201310", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/provisioning/endpoints", - "method": "GET" + "description": "固定传入“external.hms.gs.syncGameResources”。" }, - "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-delete-provision", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "encodedJson": { + "itemsRules": [ + { + "id": "upload-resource-url", + "kind": "required_if", + "field": "body.url", + "when": { + "field": "body.operType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "message": "url is required when uploading a resource.", + "suggestion": "Supply a publicly downloadable resource URL with its file extension." + } + ], + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 128, + "type": "string", + "name": "index", + "in": "body", + "required": true, + "description": "资源索引,取值由开发者定义,在该游戏内必须全局唯一。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 128, + "type": "string", + "name": "name", + "in": "body", + "required": true, + "description": "资源名称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "enum": [ + "1", + "2" + ], + "type": "integer", + "name": "type", + "in": "body", + "required": true, + "description": "资源类型。 1:图片,大小不超过500KB,格式支持jpg、jpeg、bmp、png。 2:视频,大小不超过500MB,格式支持mp4、avi、mov。 说明 请按要求上传如下特殊位置的图片,否则页面展示可能会失真: 要求各勋章图片均保持相同的尺寸和1:1的宽高比。 用于战绩信息背景的皮肤要求大小不超过500KB,尺寸为1080*1440。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 2048, + "type": "string", + "name": "url", + "in": "body", + "required": false, + "description": "可以公网访问的资源地址,需支持资源下载。 说明 上传游戏资源时,此参数必填。要求url中必须携带文件的后缀,并且图片地址需要https格式,例如https://test.abc.com/testPath/test.png。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "type": "integer", + "format": "int64", + "name": "updateTime", + "in": "body", + "required": false, + "description": "更新时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 64, + "type": "string", + "name": "resourceHash", + "in": "body", + "required": false, + "description": "图片资源的SHA256值。 说明 resourceHash和updateTime二选一,建议优先使用updateTime。如果资源的更新时间无法获取,则再传图片的散列值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "operType", + "in": "body", + "required": true, + "description": "对资源的操作。 0:上传资源 1:下架资源" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxItems": 50, + "itemsType": "object", + "type": "array", + "name": "", + "in": "", + "required": false + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 300000, + "type": "string", + "name": "resources", + "in": "body", + "required": true, + "description": "图片或视频资源,JSON字符串,JSON类型List,最大支持50个资源。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "type": "integer", + "format": "int64", + "name": "ts", + "in": "body", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "body", + "required": true, + "description": "用于华为游戏服务器对请求参数验签的签名字符串。 为防止请求被篡改,游戏需要根据签名机制中的方法生成签名字符串,华为服务器在收到请求后会对签名字符串进行验签,验签成功后才会进行后续处理,否则将返回失败错误码。请求中除sign、resources以外的所有Body参数均参与签名。" } - }, - "affordances": { - "invoke": "agc provisioning provision-api-delete-provision --invoke", - "show": "agc provisioning provision-api-delete-provision --pretty" - } - }, - { - "id": "provision-api-eligible-acl", - "familyId": "provisioning", - "name": "查询可申请的ACL权限列表", - "description": "此接口用于查询指定APP ID下所有可申请的ACL权限列表。", - "method": "POST", - "path": "/api/provision/v1/user/permission/apply/list", - "command": "agc provisioning provision-api-eligible-acl", + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044", - "officialSlug": "agc-help-provision-api-eligible-acl-0000002554975044", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725", + "officialSlug": "agcapi-resources-0000002022105725", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-eligible-acl", + "href": "/api/v1/gameplay/endpoints/resources", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-eligible-acl --invoke --body body.json", - "show": "agc provisioning provision-api-eligible-acl --pretty" + "formInput": "Supply raw unescaped values using --field or a JSON object using --body; the CLI performs UTF-8 form encoding once.", + "invoke": "agc gameplay resources --invoke --body body.json", + "show": "agc gameplay resources --pretty" } }, { - "id": "provision-api-get-fingerprints", - "familyId": "provisioning", - "name": "查询证书指纹", - "description": "此接口用于查询已创建的证书指纹。", - "method": "GET", - "path": "/api/provision/v1/fingerprints", - "command": "agc provisioning provision-api-get-fingerprints", + "documentation": { + "title": "批量查询玩家角色信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:55.831Z", + "status": "browser-read", + "readCommand": "agc gameplay role-info --docs --pretty" + }, + "id": "role-info", + "familyId": "gameplay", + "name": "批量查询玩家角色信息", + "description": "华为游戏服务器调用此接口批量查询玩家角色信息。", + "method": "POST", + "path": "{callbackUrl}", + "command": "agc gameplay role-info", "requiredParams": [ - "appId" + "callbackUrl", + "appId", + "timestamp", + "nonce", + "sign", + "appId", + "userId", + "userIdType", + "lang" ], "parameters": [ { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 32, + "type": "string", "name": "appId", "in": "header", "required": true, - "description": "Huawei application ID" + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 32, + "type": "string", + "name": "timestamp", + "in": "header", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 64, + "type": "string", + "name": "nonce", + "in": "header", + "required": true, + "description": "随机字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "header", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "maxLength": 20, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言,用于获取不同语言的玩家角色信息,至少需要支持zh_CN(中文)和en_US(英文)。" } ], + "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316", - "officialSlug": "agc-help-provision-api-get-fingerprints-0000002431361316", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", + "officialSlug": "agcapi-role-info-0000002075016173", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-get-fingerprints", + "href": "/api/v1/gameplay/endpoints/role-info", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-get-fingerprints --invoke", - "show": "agc provisioning provision-api-get-fingerprints --pretty" + "invoke": "agc gameplay role-info --invoke --body body.json", + "show": "agc gameplay role-info --pretty" } }, { - "id": "provision-api-getacl", - "familyId": "provisioning", - "name": "查询已申请的受限ACL权限", - "description": "此接口用于查询申请的受限ACL权限信息。", - "method": "GET", - "path": "/api/provision/v1/user/permission", - "command": "agc provisioning provision-api-getacl", + "documentation": { + "title": "分页查询玩家战绩", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:57.386Z", + "status": "browser-read", + "readCommand": "agc gameplay scores --docs --pretty" + }, + "id": "scores", + "familyId": "gameplay", + "name": "分页查询玩家战绩", + "description": "华为游戏服务器调用此接口分页查询玩家在玩游戏的战绩数据,并将信息展示在游戏中心的“在玩”页面上。", + "method": "POST", + "path": "{callbackUrl}", + "command": "agc gameplay scores", "requiredParams": [ - "appId" + "callbackUrl", + "appId", + "timestamp", + "nonce", + "sign", + "appId", + "userId", + "userIdType", + "pageNo", + "pageSize", + "lang" ], "parameters": [ { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 32, + "type": "string", "name": "appId", "in": "header", "required": true, - "description": "Huawei application ID" + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 32, + "type": "string", + "name": "timestamp", + "in": "header", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 64, + "type": "string", + "name": "nonce", + "in": "header", + "required": true, + "description": "随机字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "header", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "serverId", + "in": "body", + "required": false, + "description": "区服ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "roleId", + "in": "body", + "required": false, + "description": "角色ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "tag", + "in": "body", + "required": false, + "description": "分类标签值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "minimum": 1, + "type": "integer", + "name": "pageNo", + "in": "body", + "required": true, + "description": "页码。起始页码为1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maximum": 100, + "type": "integer", + "name": "pageSize", + "in": "body", + "required": true, + "description": "每页数量,默认20个,最大100个。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 20, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言,用于获取不同语言的战绩卡片信息,至少需要支持zh_CN(中文)和en_US(英文)。" } ], + "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113", - "officialSlug": "agc-help-provision-api-getacl-0000002465770113", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", + "officialSlug": "agcapi-scores-0000001985465938", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-getacl", + "href": "/api/v1/gameplay/endpoints/scores", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-getacl --invoke", - "show": "agc provisioning provision-api-getacl --pretty" + "invoke": "agc gameplay scores --invoke --body body.json", + "show": "agc gameplay scores --pretty" } }, { - "id": "provision-api-getaclapplystatus", - "familyId": "provisioning", - "name": "查询受限ACL权限的申请状态", - "description": "此接口用于查询受限ACL权限的申请状态,包含“申请中”和“审核通过”。", - "method": "GET", - "path": "/api/provision/v1/user/permission/apply/status", - "command": "agc provisioning provision-api-getaclapplystatus", + "documentation": { + "title": "查询游戏概要信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:58.981Z", + "status": "browser-read", + "readCommand": "agc gameplay summary --docs --pretty" + }, + "id": "summary", + "familyId": "gameplay", + "name": "查询游戏概要信息", + "description": "华为游戏服务器调用此接口查询玩家在玩游戏的概要数据,并将信息展示在游戏中心的“在玩”页面上。", + "method": "POST", + "path": "{callbackUrl}", + "command": "agc gameplay summary", + "requiredParams": [ + "callbackUrl", + "appId", + "timestamp", + "nonce", + "sign", + "appId", + "userId", + "userIdType", + "lang" + ], + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "header", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 32, + "type": "string", + "name": "timestamp", + "in": "header", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 64, + "type": "string", + "name": "nonce", + "in": "header", + "required": true, + "description": "随机字符串。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 1024, + "type": "string", + "name": "sign", + "in": "header", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "serverId", + "in": "body", + "required": false, + "description": "区服ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 32, + "type": "string", + "name": "roleId", + "in": "body", + "required": false, + "description": "角色ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 20, + "type": "string", + "name": "lang", + "in": "body", + "required": true, + "description": "语言,用于获取不同语言的统计值描述,至少需要支持zh_CN(中文)和en_US(英文)。" + } + ], + "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150", - "officialSlug": "agc-help-provision-api-getaclapplystatus-0000002469246150", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", + "officialSlug": "agcapi-summary-0000002022225249", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/gameplay/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-getaclapplystatus", + "href": "/api/v1/gameplay/endpoints/summary", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-getaclapplystatus --invoke", - "show": "agc provisioning provision-api-getaclapplystatus --pretty" + "invoke": "agc gameplay summary --invoke --body body.json", + "show": "agc gameplay summary --pretty" } }, { - "id": "provision-api-query-cent", - "familyId": "provisioning", - "name": "查询证书", - "description": "此接口用于查询创建的证书。", + "requestContentType": "application/x-www-form-urlencoded; charset=UTF-8", + "documentation": { + "title": "查询玩家区服角色", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377", + "updatedAt": "2026-02-11 14:07", + "checkedAt": "2026-10-07T03:00:00.519Z", + "status": "browser-read", + "readCommand": "agc game-items propapi-getroleinfo --docs --pretty" + }, + "id": "propapi-getroleinfo", + "familyId": "game-items", + "name": "查询玩家区服角色", + "description": "此接口用于查询玩家区服角色信息。", "method": "POST", - "path": "/api/publish/v3/cert/list", - "command": "agc provisioning provision-api-query-cent", + "path": "{callbackUrl}", + "command": "agc game-items propapi-getroleinfo", + "requiredParams": [ + "callbackUrl", + "userId", + "userIdType", + "ts", + "sign" + ], + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdUserId 说明 userId和userIdType配套使用,userId是值,userIdType是类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "type": "integer", + "name": "ts", + "in": "body", + "required": true, + "description": "当前时间(单位为:milliseconds),由System.currentTimeMillis()获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "maxLength": 8192, + "type": "string", + "name": "sign", + "in": "body", + "required": true, + "description": "RSA签名(使用游戏服务公钥进行验签,待验签内容生成方法见签名机制)。 签名算法SHA256WithRSA/PSS。 注意 考虑到自选参数格式多样化,本参数在\"utf-8\" urlencode后发送。 Java中request的getParameter()方法会隐含进行urldecode。" + } + ], "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629", - "officialSlug": "agc-help-provision-api-query-cent-0000002271160629", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377", + "officialSlug": "agcapi-propapi-getroleinfo-0000002355255377", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/game-items/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-query-cent", + "href": "/api/v1/game-items/endpoints/propapi-getroleinfo", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-query-cent --invoke --body body.json", - "show": "agc provisioning provision-api-query-cent --pretty" + "formInput": "Supply raw unescaped values using --field or a JSON object using --body; the CLI performs UTF-8 form encoding once.", + "invoke": "agc game-items propapi-getroleinfo --invoke --body body.json", + "show": "agc game-items propapi-getroleinfo --pretty" } }, { - "id": "provision-api-query-device", - "familyId": "provisioning", - "name": "查询设备列表", - "description": "此接口用于查询当前设备的信息。", - "method": "GET", - "path": "/api/publish/v2/device/list", - "command": "agc provisioning provision-api-query-device", + "requestContentType": "application/x-www-form-urlencoded; charset=UTF-8", + "documentation": { + "title": "下单", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:02.681Z", + "status": "browser-read", + "readCommand": "agc game-items propapi-order --docs --pretty" + }, + "id": "propapi-order", + "familyId": "game-items", + "name": "下单", + "description": "下单", + "method": "POST", + "path": "{callbackUrl}", + "command": "agc game-items propapi-order", + "requiredParams": [ + "callbackUrl", + "requestId", + "userId", + "userIdType", + "zoneId", + "roleId", + "productId", + "price", + "quantity", + "currency", + "ts", + "sign" + ], + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "required": true, + "description": "callbackUrl parameter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64, + "type": "string", + "name": "requestId", + "in": "body", + "required": true, + "description": "请求标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 256, + "type": "string", + "name": "userId", + "in": "body", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ], + "type": "integer", + "name": "userIdType", + "in": "body", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionid 4:gamePlayerId 5:teamPlayerId 6:thirdUserId 说明 userId和userIdType配套使用,userId是值,userIdType是类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64, + "type": "string", + "name": "zoneId", + "in": "body", + "required": true, + "description": "游戏内区服ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64, + "type": "string", + "name": "roleId", + "in": "body", + "required": true, + "description": "游戏内角色ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64, + "type": "string", + "name": "productId", + "in": "body", + "required": true, + "description": "商品ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "type": "integer", + "name": "price", + "in": "body", + "required": true, + "description": "商品价格,单位:分。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "type": "integer", + "name": "quantity", + "in": "body", + "required": true, + "description": "订购数量。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 4, + "type": "string", + "name": "currency", + "in": "body", + "required": true, + "description": "商品价格币种。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "type": "integer", + "name": "ts", + "in": "body", + "required": true, + "description": "当前时间(单位为:milliseconds),由System.currentTimeMillis()获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 8192, + "type": "string", + "name": "sign", + "in": "body", + "required": true, + "description": "RSA签名(使用游戏服务公钥进行验签,待验签内容生成方法见签名机制)。 签名算法为SHA256WithRSA/PSS。 注意 考虑到自选参数格式多样化,本参数在\"utf-8\" urlencode后发送。 Java中request的getParameter()方法会隐含进行urldecode。" + } + ], + "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306", - "officialSlug": "agc-help-provision-api-query-device-0000002236201306", - "direction": "developer-to-huawei", + "source": "Huawei AppGallery Connect inbound callback reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666", + "officialSlug": "agcapi-propapi-order-0000002321296666", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/game-items/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-query-device", + "href": "/api/v1/game-items/endpoints/propapi-order", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-query-device --invoke", - "show": "agc provisioning provision-api-query-device --pretty" + "formInput": "Supply raw unescaped values using --field or a JSON object using --body; the CLI performs UTF-8 form encoding once.", + "invoke": "agc game-items propapi-order --invoke --body body.json", + "show": "agc game-items propapi-order --pretty" } }, { - "id": "provision-api-query-provision", - "familyId": "provisioning", - "name": "查询Profile列表", - "description": "此接口用于查询申请的Profile。", - "method": "GET", - "path": "/api/publish/v3/provision/list", - "command": "agc provisioning provision-api-query-provision", + "documentation": { + "title": "新增资源包版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:04.166Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-addversion --docs --pretty" + }, + "id": "respackapi-addversion", + "familyId": "resources", + "name": "新增资源包版本", + "description": "创建“使用华为CDN”方式的资源包预下载任务。", + "method": "POST", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions", + "command": "agc resources respackapi-addversion", "requiredParams": [ - "appId" + "requestId", + "devId" ], "parameters": [ { - "name": "appId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section119494174419", + "maxLength": 128, + "type": "string", + "name": "requestId", "in": "header", "required": true, - "description": "Huawei application ID" + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section6704618182019", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "maxLength": 255, + "type": "string", + "name": "packageName", + "in": "body", + "required": false, + "description": "游戏包名。最大长度255个字符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "maximum": 999999999, + "type": "integer", + "name": "version", + "in": "body", + "required": true, + "description": "资源包版本号。要求是不超过9位的整数,且必须大于已创建任务的版本号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "type": "integer", + "name": "startTime", + "in": "body", + "required": true, + "description": "资源包预下载日期的开始时间。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "type": "integer", + "name": "endTime", + "in": "body", + "required": true, + "description": "资源包预下载日期的结束时间。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "type": "object", + "name": "resourceVersion", + "in": "body", + "required": false, + "description": "资源包版本信息。" } ], + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506", - "officialSlug": "agc-help-provision-api-query-provision-0000002236041506", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224", + "officialSlug": "agcapi-respackapi-addversion-0000002328396224", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-query-provision", + "href": "/api/v1/resources/endpoints/respackapi-addversion", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-query-provision --invoke", - "show": "agc provisioning provision-api-query-provision --pretty" + "invoke": "agc resources respackapi-addversion --invoke --body body.json", + "show": "agc resources respackapi-addversion --pretty" } }, { - "id": "provision-api-update-provision", - "familyId": "provisioning", - "name": "修改Profile绑定的设备", - "description": "此接口用于修改调试Profile绑定的调试设备,或者修改指定设备发布Profile绑定的测试设备。", - "method": "PUT", - "path": "/api/publish/v3/provision", - "command": "agc provisioning provision-api-update-provision", + "documentation": { + "title": "删除资源包文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228", + "updatedAt": "2025-11-20 11:58", + "checkedAt": "2026-10-07T03:00:05.599Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-deletefile --docs --pretty" + }, + "id": "respackapi-deletefile", + "familyId": "resources", + "name": "删除资源包文件", + "description": "删除资源包任务文件,要求该资源包任务为下线状态。", + "method": "DELETE", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-files", + "command": "agc resources respackapi-deletefile", "requiredParams": [ - "provisionId", - "deviceIdList" + "requestId", + "devId", + "appId" ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section119494174419", + "maxLength": 128, "type": "string", - "name": "provisionId", - "in": "body", + "name": "requestId", + "in": "header", "required": true, - "description": "本次创建的专用调试 Profile ID" + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" }, { - "minItems": 1, - "maxItems": 4000, - "itemsType": "string", - "type": "array", - "name": "deviceIdList", - "in": "body", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section6704618182019", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section985411610234", + "type": "string", + "name": "appId", + "in": "query", "required": true, - "description": "更新后的真实设备 ID 列表;真实接口不接受空列表" + "description": "游戏APP ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section985411610234", + "type": "string", + "name": "fileIds", + "in": "query", + "required": false, + "description": "资源包文件ID列表,使用英文逗号分隔。取值范围:[1,500]。" } ], - "body": "provisionId,deviceIdList", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766", - "officialSlug": "agc-help-provision-api-update-provision-0000002469198766", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228", + "officialSlug": "agcapi-respackapi-deletefile-0000002328396228", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/provisioning/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/provisioning/endpoints/provision-api-update-provision", + "href": "/api/v1/resources/endpoints/respackapi-deletefile", "method": "GET" } }, "affordances": { - "invoke": "agc provisioning provision-api-update-provision --invoke --body body.json", - "show": "agc provisioning provision-api-update-provision --pretty" + "invoke": "agc resources respackapi-deletefile --invoke", + "show": "agc resources respackapi-deletefile --pretty" } }, { - "id": "domain-api-download-domain-config", - "familyId": "domains", - "name": "下载域名配置文件", - "description": "此接口用于以文件流的形式进行直接下载域名配置文件。", + "documentation": { + "title": "查询资源包版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745", + "updatedAt": "2026-04-27 14:44", + "checkedAt": "2026-10-07T03:00:07.010Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-getversion --docs --pretty" + }, + "id": "respackapi-getversion", + "familyId": "resources", + "name": "查询资源包版本", + "description": "查询指定游戏下所有资源包版本的详细信息。", "method": "GET", - "path": "/api/dms/domain-manage/v1/app/domain/verify-file", - "command": "agc domains domain-api-download-domain-config", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions", + "command": "agc resources respackapi-getversion", + "requiredParams": [ + "devId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section119494174419", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求页码,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234", + "minimum": 1, + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "列表查询单页数量。取值范围[1,100]。 默认值:20。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653", - "officialSlug": "agc-help-domain-api-download-domain-config-0000002271160653", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745", + "officialSlug": "agcapi-respackapi-getversion-0000002362274745", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/domains/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/domains/endpoints/domain-api-download-domain-config", + "href": "/api/v1/resources/endpoints/respackapi-getversion", "method": "GET" } }, "affordances": { - "invoke": "agc domains domain-api-download-domain-config --invoke", - "show": "agc domains domain-api-download-domain-config --pretty" + "invoke": "agc resources respackapi-getversion --invoke", + "show": "agc resources respackapi-getversion --pretty" } }, { - "id": "domain-api-get-domain", - "familyId": "domains", - "name": "查询元服务的域名配置信息", - "description": "此接口用于查询元服务的域名配置信息。", - "method": "GET", - "path": "/api/dms/domain-manage/v1/app/domain", - "command": "agc domains domain-api-get-domain", + "documentation": { + "title": "修改资源包版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:24.360Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-modifyversion --docs --pretty" + }, + "id": "respackapi-modifyversion", + "familyId": "resources", + "name": "修改资源包版本", + "description": "若isDraft传参为0,提交资源包预下载任务。", + "method": "PUT", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions", + "command": "agc resources respackapi-modifyversion", "requiredParams": [ - "appId", - "category" + "requestId", + "devId", + "isDraft" ], "parameters": [ { - "name": "appId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section16852614454", + "maxLength": 128, + "type": "string", + "name": "requestId", "in": "header", "required": true, - "description": "Huawei application ID" + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" }, { - "name": "category", - "in": "query", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section6704618182019", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "isDraft", + "in": "body", "required": true, - "description": "Domain category" + "description": "是否草稿: 0:提交。提交之后进入预发布状态。 1:草稿。草稿状态支持重新编辑。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "type": "integer", + "name": "versionId", + "in": "body", + "required": true, + "description": "资源包版本ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "maxLength": 255, + "type": "string", + "name": "packageName", + "in": "body", + "required": false, + "description": "游戏包名。最大长度255个字符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "type": "integer", + "name": "version", + "in": "body", + "required": false, + "description": "版本号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "type": "integer", + "name": "startTime", + "in": "body", + "required": false, + "description": "开始下载时间。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "type": "integer", + "name": "endTime", + "in": "body", + "required": false, + "description": "结束下载时间。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "type": "object", + "name": "resourceVersion", + "in": "body", + "required": false, + "description": "修改的资源包版本信息。" } ], + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701", - "officialSlug": "agc-help-domain-api-get-domain-0000002271000701", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372", + "officialSlug": "agcapi-respackapi-modifyversion-0000002328236372", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/domains/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/domains/endpoints/domain-api-get-domain", + "href": "/api/v1/resources/endpoints/respackapi-modifyversion", "method": "GET" } }, "affordances": { - "invoke": "agc domains domain-api-get-domain --invoke", - "show": "agc domains domain-api-get-domain --pretty" + "invoke": "agc resources respackapi-modifyversion --invoke --body body.json", + "show": "agc resources respackapi-modifyversion --pretty" } }, { - "id": "domain-api-get-domain-config", - "familyId": "domains", - "name": "查询域名修改次数/配置上限", - "description": "此接口用于查询域名修改次数、配置上限等信息。", + "documentation": { + "title": "查询资源包文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T05:20:04.356Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-queryfile --docs --pretty" + }, + "rules": [ + { + "minItems": 1, + "maxItems": 500, + "id": "resource-file-id-count", + "kind": "csv_count", + "field": "query.fileIds", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "message": "fileIds requires 1 to 500 nonempty comma-separated file IDs.", + "suggestion": "Supply at most 500 file IDs separated by commas without empty entries, or select a versionId." + }, + { + "id": "resource-file-identity", + "kind": "at_least_one", + "fields": [ + "query.versionId", + "query.fileIds" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "message": "Supply versionId or fileIds to select resource files.", + "suggestion": "Provide the resource version ID or a comma-separated file ID list." + }, + { + "id": "resource-file-identity-exclusive", + "kind": "at_most_one", + "fields": [ + "query.versionId", + "query.fileIds" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "message": "Select either versionId or fileIds, as documented.", + "suggestion": "Keep one resource-file selector and remove the other." + } + ], + "id": "respackapi-queryfile", + "familyId": "resources", + "name": "查询资源包文件", + "description": "查询资源包文件。", "method": "GET", - "path": "/api/dms/domain-manage/v1/app/domain/config", - "command": "agc domains domain-api-get-domain-config", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-files", + "command": "agc resources respackapi-queryfile", + "requiredParams": [ + "devId", + "appId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section6704618182019", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "type": "integer", + "name": "versionId", + "in": "query", + "required": false, + "description": "资源包版本ID。 说明 versionId参数和fileIds参数,选择一个传入。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "type": "string", + "name": "fileIds", + "in": "query", + "required": false, + "description": "资源包文件ID列表,使用英文逗号分隔。取值范围:[1,500]。 说明 versionId参数和fileIds参数,选择一个传入。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "type": "integer", + "name": "page", + "in": "query", + "required": false, + "description": "请求页码,默认值:1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "minimum": 1, + "maximum": 100, + "type": "integer", + "name": "limit", + "in": "query", + "required": false, + "description": "列表查询单页数量。取值范围:[1,100]。 默认值:20" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326", - "officialSlug": "agc-help-domain-api-get-domain-config-0000002236201326", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749", + "officialSlug": "agcapi-respackapi-queryfile-0000002362274749", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/domains/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/domains/endpoints/domain-api-get-domain-config", + "href": "/api/v1/resources/endpoints/respackapi-queryfile", "method": "GET" } }, "affordances": { - "invoke": "agc domains domain-api-get-domain-config --invoke", - "show": "agc domains domain-api-get-domain-config --pretty" + "invoke": "agc resources respackapi-queryfile --invoke", + "show": "agc resources respackapi-queryfile --pretty" } }, { - "id": "domain-api-post-domain", - "familyId": "domains", - "name": "新增/更新元服务的域名配置信息", - "description": "此接口用于新增/更新元服务的域名配置信息。", + "documentation": { + "title": "发布资源包版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:27.040Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-releaseversion --docs --pretty" + }, + "id": "respackapi-releaseversion", + "familyId": "resources", + "name": "发布资源包版本", + "description": "发布资源包下载任务。", "method": "POST", - "path": "/api/dms/domain-manage/v1/app/domain", - "command": "agc domains domain-api-post-domain", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-version/publish", + "command": "agc resources respackapi-releaseversion", + "requiredParams": [ + "requestId", + "devId", + "appId", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section119494174419", + "maxLength": 128, + "type": "string", + "name": "requestId", + "in": "header", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section6704618182019", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section15718114214818", + "type": "string", + "name": "appId", + "in": "query", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section15718114214818", + "type": "integer", + "name": "versionId", + "in": "query", + "required": true, + "description": "资源包版本ID。" + } + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522", - "officialSlug": "agc-help-domain-api-post-domain-0000002236041522", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637", + "officialSlug": "agcapi-respackapi-releaseversion-0000002362394637", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/domains/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/domains/endpoints/domain-api-post-domain", + "href": "/api/v1/resources/endpoints/respackapi-releaseversion", "method": "GET" } }, "affordances": { - "invoke": "agc domains domain-api-post-domain --invoke --body body.json", - "show": "agc domains domain-api-post-domain --pretty" + "invoke": "agc resources respackapi-releaseversion --invoke --body body.json", + "show": "agc resources respackapi-releaseversion --pretty" } }, { - "id": "domain-api-precheck", - "familyId": "domains", - "name": "预检查业务域名配置", - "description": "此接口用于对业务域名配置进行预检查。", + "documentation": { + "title": "资源包文件上传申请", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376", + "updatedAt": "2026-02-12 17:29", + "checkedAt": "2026-10-07T05:16:45.382Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-uploadapplyfor --docs --pretty" + }, + "id": "respackapi-uploadapplyfor", + "familyId": "resources", + "name": "资源包文件上传申请", + "description": "获取上传地址和必要参数,根据申请返回的信息完成文件上传。", "method": "POST", - "path": "/api/dms/domain-manage/v1/app/domain/pre-check", - "command": "agc domains domain-api-precheck", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-file/apply", + "command": "agc resources respackapi-uploadapplyfor", + "requiredParams": [ + "requestId", + "devId", + "appId", + "versionId", + "fileName", + "fileSHA256", + "fileLength", + "fileType" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section119494174419", + "maxLength": 128, + "type": "string", + "name": "requestId", + "in": "header", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section6704618182019", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "type": "string", + "name": "appId", + "in": "body", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "type": "integer", + "name": "versionId", + "in": "body", + "required": true, + "description": "资源包版本ID。" + }, + { + "pattern": "^[^|:/\\\\*?\"<>]+$", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "maxLength": 255, + "type": "string", + "name": "fileName", + "in": "body", + "required": true, + "description": "应用包文件名称,最大长度为255个字符,且名称不能包含特殊字符(|)、(:)、(/)、(\\)、(*)、(?)、(\")、(<)、(>)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "type": "string", + "name": "fileSHA256", + "in": "body", + "required": true, + "description": "升级包文件SHA256值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "type": "integer", + "name": "fileLength", + "in": "body", + "required": true, + "description": "升级包文件大小(字节数)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "enum": [ + "0" + ], + "type": "integer", + "name": "fileType", + "in": "body", + "required": true, + "description": "升级包文件类型: 0:apk-resource" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "maxLength": 1024, + "type": "string", + "name": "partNo", + "in": "body", + "required": false, + "description": "分段序号。最大长度为1024个字符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "type": "string", + "name": "fileSHA256", + "in": "body", + "required": false, + "description": "分段升级包文件SHA256值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "type": "integer", + "name": "fileLength", + "in": "body", + "required": false, + "description": "分段升级包文件大小(字节数)。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "maxItems": 1000, + "itemsType": "object", + "type": "array", + "name": "filePartApplyInfo", + "in": "body", + "required": false, + "description": "分段上传信息,分段数取值[0,1000]。 要求待上传的资源包文件不能低于5MB。 若待上传的资源包文件超过5GB,建议分段上传文件。" + } + ], "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522", - "officialSlug": "agc-help-domain-api-precheck-0000002295134522", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376", + "officialSlug": "agcapi-respackapi-uploadapplyfor-0000002328236376", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/domains/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/domains/endpoints/domain-api-precheck", + "href": "/api/v1/resources/endpoints/respackapi-uploadapplyfor", "method": "GET" } }, "affordances": { - "invoke": "agc domains domain-api-precheck --invoke --body body.json", - "show": "agc domains domain-api-precheck --pretty" + "invoke": "agc resources respackapi-uploadapplyfor --invoke --body body.json", + "show": "agc resources respackapi-uploadapplyfor --pretty" } }, { - "id": "test-api-add-invite-code", - "familyId": "testing", - "name": "生成邀请码", - "description": "此接口用于邀请测试生成邀请码。", + "documentation": { + "title": "资源包文件上传确认", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641", + "updatedAt": "2025-08-08 14:18", + "checkedAt": "2026-10-07T03:00:29.824Z", + "status": "browser-read", + "readCommand": "agc resources respackapi-uploadconfirm --docs --pretty" + }, + "id": "respackapi-uploadconfirm", + "familyId": "resources", + "name": "资源包文件上传确认", + "description": "确认资源包文件已上传。", "method": "POST", - "path": "/api/app-test/v1/invitation-code", - "command": "agc testing test-api-add-invite-code", + "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-file/confirm", + "command": "agc resources respackapi-uploadconfirm", "requiredParams": [ - "appId", - "groupId", - "invitationCodeValidDays", - "invitationCodeInviteLimit" + "requestId", + "devId", + "uploadResult", + "versionId" ], "parameters": [ { - "name": "appId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section119494174419", + "maxLength": 128, + "type": "string", + "name": "requestId", "in": "header", "required": true, - "description": "Huawei application ID" + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section6704618182019", + "type": "integer", + "name": "devId", + "in": "path", + "required": true, + "description": "开发者ID。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", "type": "string", - "name": "groupId", + "name": "appId", "in": "body", - "required": true, - "description": "测试群组 ID" + "required": false, + "description": "游戏APP ID,获取方法参考查询应用信息。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", "type": "integer", - "name": "invitationCodeValidDays", + "name": "fileId", + "in": "body", + "required": false, + "description": "文件ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "uploadResult", "in": "body", "required": true, - "description": "有效期天数;官方正文要求 30 天" + "description": "上传结果: 0:成功 1:失败" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", "type": "integer", - "name": "invitationCodeInviteLimit", + "name": "versionId", "in": "body", "required": true, - "description": "可邀请人数上限,不超过 10000" + "description": "资源包版本ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 128, + "type": "string", + "name": "hotUpdateVersion", + "in": "body", + "required": false, + "description": "资源包子版本号。最长128个字符。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 1024, + "type": "string", + "name": "partNo", + "in": "body", + "required": false, + "description": "分段序号。最大长度1024个字符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 2048, + "type": "string", + "name": "partObjectId", + "in": "body", + "required": false, + "description": "分段对象,大文件创建接口响应获取。最大长度2048个字符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 2048, + "type": "string", + "name": "etag", + "in": "body", + "required": false, + "description": "分段Etag,上传至OBS响应的header中获取。最大长度2048个字符。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 2048, + "type": "string", + "name": "xGoogleGeneration", + "in": "body", + "required": false, + "description": "分段x_google_gengration,上传至OBS响应的header中获取。最大长度2048个字符。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "itemsType": "object", + "type": "array", + "name": "filePartConfirmInfos", + "in": "body", + "required": false, + "description": "文件分片确认信息。" } ], - "body": "groupId,invitationCodeValidDays,invitationCodeInviteLimit", + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342", - "officialSlug": "agc-help-test-api-add-invite-code-0000002236201342", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641", + "officialSlug": "agcapi-respackapi-uploadconfirm-0000002362394641", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/resources/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-add-invite-code", + "href": "/api/v1/resources/endpoints/respackapi-uploadconfirm", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-add-invite-code --invoke --body body.json", - "show": "agc testing test-api-add-invite-code --pretty" + "invoke": "agc resources respackapi-uploadconfirm --invoke --body body.json", + "show": "agc resources respackapi-uploadconfirm --pretty" } }, { - "id": "test-api-add-test-group", - "familyId": "testing", - "name": "新增测试群组", - "description": "此接口用于邀请测试创建内外部测试群组。", + "id": "build-hvigor", + "familyId": "cicd", + "name": "本地 Hvigor 构建", + "description": "Run local HarmonyOS Hvigor build and return artifact metadata.", "method": "POST", - "path": "/api/app-test/v1/test-group", - "command": "agc testing test-api-add-test-group", + "path": "/local/hvigor/build", + "command": "agc cicd build-hvigor", "requiredParams": [ - "appId", - "groupName" + "project" ], "parameters": [ { - "name": "appId", - "in": "header", + "type": "string", + "name": "project", + "in": "body", "required": true, - "description": "Huawei application ID" + "description": "本地 HarmonyOS 项目目录" }, { "type": "string", - "name": "groupName", + "name": "hvigorPath", "in": "body", - "required": true, - "description": "群组名称,最长 50 个字符" + "required": false, + "description": "Hvigor 可执行文件路径;默认检测 DevEco Studio 或 PATH" }, { - "type": "integer", - "name": "groupType", + "type": "string", + "name": "product", + "in": "body", + "required": false, + "description": "产品名,默认 default" + }, + { + "type": "string", + "name": "buildMode", + "in": "body", + "required": false, + "description": "debug 或 release,默认 debug" + }, + { + "type": "string", + "name": "task", "in": "body", "required": false, - "description": "0:外部群组;1:内部群组(需要 AppTest)" + "description": "assembleHap:模块 HAP;assembleApp:项目 APP,默认 assembleHap" } ], - "body": "groupName,groupType", + "body": "project,hvigorPath,product,buildMode,task", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661", - "officialSlug": "agc-help-test-api-add-test-group-0000002271160661", - "direction": "developer-to-huawei", + "source": "agc-cli local integration", + "sourceUrl": "docs/AGC_CLI_FULL_PLAN.md", + "officialSlug": "local-hvigor-build", + "direction": "local", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/cicd/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-add-test-group", + "href": "/api/v1/cicd/endpoints/build-hvigor", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-add-test-group --invoke --body body.json", - "show": "agc testing test-api-add-test-group --pretty" + "invoke": "agc cicd build-hvigor --invoke --body body.json", + "show": "agc cicd build-hvigor --pretty" } }, { - "id": "test-api-add-test-group-user", - "familyId": "testing", - "name": "新增测试群组成员", - "description": "此接口用于邀请测试新增测试群组成员。", + "authentication": "agcli-user-oauth", + "documentation": { + "title": "create-function", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-function --docs --pretty" + }, + "id": "create-function", + "familyId": "functions", + "name": "create-function", + "description": "", "method": "POST", - "path": "/api/publish/v2/test/user", - "command": "agc testing test-api-add-test-group-user", - "body": "json", + "path": "native:functions/create-function", + "command": "agc functions create-function", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338", - "officialSlug": "agc-help-test-api-add-test-group-user-0000002236201338", - "direction": "developer-to-huawei", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-function", + "direction": "native-workflow", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-add-test-group-user", + "href": "/api/v1/functions/endpoints/create-function", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-add-test-group-user --invoke --body body.json", - "show": "agc testing test-api-add-test-group-user --pretty" + "docs": "agc functions create-function --docs --pretty", + "invoke": "agc functions create-function --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions create-function --pretty" } }, { - "id": "test-api-add-test-package", - "familyId": "testing", - "name": "添加软件包", - "description": "此接口用于测试版本上传软件包。", + "authentication": "agcli-user-oauth", + "documentation": { + "title": "update-function-code", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions update-function-code --docs --pretty" + }, + "id": "update-function-code", + "familyId": "functions", + "name": "update-function-code", + "description": "", "method": "POST", - "path": "/api/publish/v2/test/version/pkg", - "command": "agc testing test-api-add-test-package", - "body": "json", + "path": "native:functions/update-function-code", + "command": "agc functions update-function-code", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330", - "officialSlug": "agc-help-test-api-add-test-package-0000002236201330", - "direction": "developer-to-huawei", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-update-function-code", + "direction": "native-workflow", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-add-test-package", + "href": "/api/v1/functions/endpoints/update-function-code", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-add-test-package --invoke --body body.json", - "show": "agc testing test-api-add-test-package --pretty" + "docs": "agc functions update-function-code --docs --pretty", + "invoke": "agc functions update-function-code --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions update-function-code --pretty" } }, { - "id": "test-api-add-test-version", - "familyId": "testing", - "name": "新建测试版本", - "description": "此接口用于创建HarmonyOS应用/元服务的测试版本。", + "authentication": "agcli-user-oauth", + "documentation": { + "title": "update-function-config", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions update-function-config --docs --pretty" + }, + "id": "update-function-config", + "familyId": "functions", + "name": "update-function-config", + "description": "", "method": "POST", - "path": "/api/publish/v2/test/app/version", - "command": "agc testing test-api-add-test-version", - "requiredParams": [ - "appId", - "releaseType", - "testType", - "testDesc" - ], - "parameters": [ - { - "type": "string", - "name": "appId", - "in": "query", - "required": true, - "description": "应用 ID" + "path": "native:functions/update-function-config", + "command": "agc functions update-function-config", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-update-function-config", + "direction": "native-workflow", + "_links": { + "family": { + "href": "/api/v1/functions/endpoints", + "method": "GET" }, - { - "type": "integer", - "name": "releaseType", - "in": "body", - "required": true, - "description": "HarmonyOS 测试发布方式,默认 6" + "self": { + "href": "/api/v1/functions/endpoints/update-function-config", + "method": "GET" + } + }, + "affordances": { + "docs": "agc functions update-function-config --docs --pretty", + "invoke": "agc functions update-function-config --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions update-function-config --pretty" + } + }, + { + "authentication": "agcli-user-oauth", + "documentation": { + "title": "publish-function", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions publish-function --docs --pretty" + }, + "id": "publish-function", + "familyId": "functions", + "name": "publish-function", + "description": "", + "method": "POST", + "path": "native:functions/publish-function", + "command": "agc functions publish-function", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-publish-function", + "direction": "native-workflow", + "_links": { + "family": { + "href": "/api/v1/functions/endpoints", + "method": "GET" }, - { - "type": "integer", - "name": "testType", - "in": "body", - "required": true, - "description": "3:邀请测试;4:公开测试" + "self": { + "href": "/api/v1/functions/endpoints/publish-function", + "method": "GET" + } + }, + "affordances": { + "docs": "agc functions publish-function --docs --pretty", + "invoke": "agc functions publish-function --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions publish-function --pretty" + } + }, + { + "authentication": "agcli-user-oauth", + "documentation": { + "title": "update-and-publish-function", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions update-and-publish-function --docs --pretty" + }, + "id": "update-and-publish-function", + "familyId": "functions", + "name": "update-and-publish-function", + "description": "", + "method": "POST", + "path": "native:functions/update-and-publish-function", + "command": "agc functions update-and-publish-function", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-update-and-publish-function", + "direction": "native-workflow", + "_links": { + "family": { + "href": "/api/v1/functions/endpoints", + "method": "GET" }, - { - "type": "string", - "name": "testDesc", - "in": "body", - "required": true, - "description": "测试版本描述,最长 50 字符" + "self": { + "href": "/api/v1/functions/endpoints/update-and-publish-function", + "method": "GET" + } + }, + "affordances": { + "docs": "agc functions update-and-publish-function --docs --pretty", + "invoke": "agc functions update-and-publish-function --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions update-and-publish-function --pretty" + } + }, + { + "authentication": "agcli-user-oauth", + "documentation": { + "title": "invoke", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions invoke --docs --pretty" + }, + "id": "invoke", + "familyId": "functions", + "name": "invoke", + "description": "", + "method": "POST", + "path": "native:functions/invoke", + "command": "agc functions invoke", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-invoke", + "direction": "native-workflow", + "_links": { + "family": { + "href": "/api/v1/functions/endpoints", + "method": "GET" }, - { - "type": "integer", - "name": "onshelfSelfDetect", - "in": "body", - "required": false, - "description": "0:不进行正式上架自检;1:进行自检" + "self": { + "href": "/api/v1/functions/endpoints/invoke", + "method": "GET" } - ], - "body": "releaseType,testType,testDesc,onshelfSelfDetect", + }, + "affordances": { + "docs": "agc functions invoke --docs --pretty", + "invoke": "agc functions invoke --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions invoke --pretty" + } + }, + { + "authentication": "agcli-user-oauth", + "documentation": { + "title": "list-functions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-functions --docs --pretty" + }, + "id": "list-functions", + "familyId": "functions", + "name": "list-functions", + "description": "", + "method": "POST", + "path": "native:functions/list-functions", + "command": "agc functions list-functions", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526", - "officialSlug": "agc-help-test-api-add-test-version-0000002236041526", - "direction": "developer-to-huawei", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-functions", + "direction": "native-workflow", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-add-test-version", + "href": "/api/v1/functions/endpoints/list-functions", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-add-test-version --invoke --body body.json", - "show": "agc testing test-api-add-test-version --pretty" + "docs": "agc functions list-functions --docs --pretty", + "invoke": "agc functions list-functions --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions list-functions --pretty" } }, { - "id": "test-api-create-open-test-link", - "familyId": "testing", - "name": "创建公开链接", - "description": "此接口用于创建群组级公开测试链接。", + "authentication": "agcli-user-oauth", + "documentation": { + "title": "query-function-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions query-function-version --docs --pretty" + }, + "id": "query-function-version", + "familyId": "functions", + "name": "query-function-version", + "description": "", "method": "POST", - "path": "/api/app-test/v1/test-group/public-link", - "command": "agc testing test-api-create-open-test-link", - "body": "json", + "path": "native:functions/query-function-version", + "command": "agc functions query-function-version", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-create-open-test-link-0000002665117715", - "officialSlug": "agc-help-test-api-create-open-test-link-0000002665117715", - "direction": "developer-to-huawei", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-query-function-version", + "direction": "native-workflow", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-create-open-test-link", + "href": "/api/v1/functions/endpoints/query-function-version", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-create-open-test-link --invoke --body body.json", - "show": "agc testing test-api-create-open-test-link --pretty" + "docs": "agc functions query-function-version --docs --pretty", + "invoke": "agc functions query-function-version --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions query-function-version --pretty" } }, { - "id": "test-api-delete-feedback", - "familyId": "testing", - "name": "删除测试问题反馈", - "description": "此接口用于删除测试问题反馈。", - "method": "DELETE", - "path": "/api/app-test/v1/mgmt/tester-feedback", - "command": "agc testing test-api-delete-feedback", + "authentication": "agcli-user-oauth", + "documentation": { + "title": "list-function-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-function-versions --docs --pretty" + }, + "id": "list-function-versions", + "familyId": "functions", + "name": "list-function-versions", + "description": "", + "method": "POST", + "path": "native:functions/list-function-versions", + "command": "agc functions list-function-versions", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668", - "officialSlug": "agc-help-test-api-delete-feedback-0000002634718668", - "direction": "developer-to-huawei", + "source": "Huawei official AGCLI 1.12.0 source", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-function-versions", + "direction": "native-workflow", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-delete-feedback", + "href": "/api/v1/functions/endpoints/list-function-versions", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-delete-feedback --invoke", - "show": "agc testing test-api-delete-feedback --pretty" + "docs": "agc functions list-function-versions --docs --pretty", + "invoke": "agc functions list-function-versions --invoke --name FUNCTION --session-file SESSION.json", + "show": "agc functions list-function-versions --pretty" } }, { - "id": "test-api-delete-invite-code", - "familyId": "testing", - "name": "删除邀请码", - "description": "此接口用于邀请测试删除邀请码。", - "method": "DELETE", - "path": "/api/app-test/v1/invitation-code", - "command": "agc testing test-api-delete-invite-code", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "get-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-alias --docs --pretty" + }, + "id": "get-alias", + "familyId": "functions", + "name": "get-alias", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases/{aliasName}", + "command": "agc functions get-alias", "requiredParams": [ - "appId", - "invitationCodeId" + "functionName", + "aliasName" ], "parameters": [ { - "name": "appId", - "in": "header", - "required": true, - "description": "Huawei application ID" + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "functionName", + "in": "path", + "required": true }, { + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", "type": "string", - "name": "invitationCodeId", - "in": "query", - "required": true, - "description": "要删除的邀请码 ID;AppTest 邀请测试不支持此接口" + "name": "aliasName", + "in": "path", + "required": true } ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570", - "officialSlug": "agc-help-test-api-delete-invite-code-0000002634878570", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-get-alias", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-delete-invite-code", + "href": "/api/v1/functions/endpoints/get-alias", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-delete-invite-code --invoke", - "show": "agc testing test-api-delete-invite-code --pretty" + "docs": "agc functions get-alias --docs --pretty", + "invoke": "agc functions get-alias --invoke --session-file SESSION.json", + "show": "agc functions get-alias --pretty" } }, { - "id": "test-api-delete-test-group", - "familyId": "testing", - "name": "删除测试群组", - "description": "此接口用于邀请测试删除测试群组。", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "delete-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions delete-alias --docs --pretty" + }, + "id": "delete-alias", + "familyId": "functions", + "name": "delete-alias", + "description": "Reviewed native management transport; explicit user session required. ", "method": "DELETE", - "path": "/api/app-test/v1/publish-api/test-group", - "command": "agc testing test-api-delete-test-group", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases/{aliasName}", + "command": "agc functions delete-alias", "requiredParams": [ - "appId", - "groupId" + "functionName", + "aliasName" ], "parameters": [ { - "name": "appId", - "in": "header", - "required": true, - "description": "Huawei application ID" + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "functionName", + "in": "path", + "required": true }, { + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", "type": "string", - "name": "groupId", - "in": "query", - "required": true, - "description": "待删除的专用群组 ID" + "name": "aliasName", + "in": "path", + "required": true } ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534", - "officialSlug": "agc-help-test-api-delete-test-group-0000002236041534", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-delete-alias", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-delete-test-group", + "href": "/api/v1/functions/endpoints/delete-alias", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-delete-test-group --invoke", - "show": "agc testing test-api-delete-test-group --pretty" + "docs": "agc functions delete-alias --docs --pretty", + "invoke": "agc functions delete-alias --invoke --session-file SESSION.json", + "show": "agc functions delete-alias --pretty" } }, { - "id": "test-api-delete-test-group-user", - "familyId": "testing", - "name": "删除测试群组成员", - "description": "此接口用于邀请测试删除测试群组中的成员。", - "method": "DELETE", - "path": "/api/publish/v2/test/user", - "command": "agc testing test-api-delete-test-group-user", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721", - "officialSlug": "agc-help-test-api-delete-test-group-user-0000002271000721", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/testing/endpoints", - "method": "GET" - }, - "self": { - "href": "/api/v1/testing/endpoints/test-api-delete-test-group-user", - "method": "GET" - } + "authentication": "agcli-management-oauth", + "documentation": { + "title": "list-aliases", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-aliases --docs --pretty" }, - "affordances": { - "invoke": "agc testing test-api-delete-test-group-user --invoke", - "show": "agc testing test-api-delete-test-group-user --pretty" - } - }, - { - "id": "test-api-delete-test-version", - "familyId": "testing", - "name": "删除测试版本", - "description": "此接口用于删除测试版本。", - "method": "DELETE", - "path": "/api/publish/v2/test/app/version", - "command": "agc testing test-api-delete-test-version", + "id": "list-aliases", + "familyId": "functions", + "name": "list-aliases", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases", + "command": "agc functions list-aliases", "requiredParams": [ - "appId", - "versionId" + "functionName" ], "parameters": [ { + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", "type": "string", - "name": "appId", - "in": "query", - "required": true, - "description": "应用 ID" + "name": "functionName", + "in": "path", + "required": true }, { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", "type": "string", - "name": "versionId", + "name": "functionVersion", "in": "query", - "required": true, - "description": "本次创建的测试草稿版本 ID" + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "pageSize", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "type": "integer", + "name": "pageIndex", + "in": "query", + "required": false } ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346", - "officialSlug": "agc-help-test-api-delete-test-version-0000002236201346", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-aliases", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-delete-test-version", + "href": "/api/v1/functions/endpoints/list-aliases", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-delete-test-version --invoke", - "show": "agc testing test-api-delete-test-version --pretty" + "docs": "agc functions list-aliases --docs --pretty", + "invoke": "agc functions list-aliases --invoke --session-file SESSION.json", + "show": "agc functions list-aliases --pretty" } }, { - "id": "test-api-edit-open-test-link", - "familyId": "testing", - "name": "修改公开链接", - "description": "此接口用于编辑群组级公开测试链接。", - "method": "PUT", - "path": "/api/app-test/v1/test-group/public-link", - "command": "agc testing test-api-edit-open-test-link", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666", - "officialSlug": "agc-help-test-api-edit-open-test-link-0000002634718666", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/testing/endpoints", - "method": "GET" - }, - "self": { - "href": "/api/v1/testing/endpoints/test-api-edit-open-test-link", - "method": "GET" - } + "authentication": "agcli-management-oauth", + "documentation": { + "title": "create-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-alias --docs --pretty" }, - "affordances": { - "invoke": "agc testing test-api-edit-open-test-link --invoke --body body.json", - "show": "agc testing test-api-edit-open-test-link --pretty" - } - }, - { - "id": "test-api-edit-test-group", - "familyId": "testing", - "name": "修改测试群组", - "description": "此接口用于邀请测试修改测试群组。", - "method": "PUT", - "path": "/api/app-test/v2/test-group", - "command": "agc testing test-api-edit-test-group", + "id": "create-alias", + "familyId": "functions", + "name": "create-alias", + "description": "Reviewed native management transport; explicit user session required. Provide one or two explicit version weights totaling 100; no implicit selection of latest published version.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases", + "command": "agc functions create-alias", "requiredParams": [ - "appId", - "groupId", - "groupName" + "functionName", + "name", + "functionVersion", + "routingConfig" ], "parameters": [ { - "name": "appId", - "in": "header", - "required": true, - "description": "Huawei application ID" + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "functionName", + "in": "path", + "required": true }, { + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", "type": "string", - "name": "groupId", + "name": "name", "in": "body", - "required": true, - "description": "专用测试群组 ID" + "required": true }, { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", "type": "string", - "name": "groupName", + "name": "functionVersion", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "description", + "in": "body", + "required": false + }, + { + "additionalProperties": { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 0, + "maximum": 100, + "type": "integer", + "name": "weight", + "in": "body", + "required": true + }, + "propertyNamesPattern": "^(\\$latest|[1-9][0-9]{0,2}|1000)$", + "minProperties": 1, + "maxProperties": 2, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "routingConfig", "in": "body", "required": true, - "description": "群组名称,最长 50 个字符" + "description": "One or two version weights totaling 100; explicit complete routing required by this CLI." } ], - "body": "groupId,groupName", + "body": "name,functionVersion,description,routingConfig", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664", - "officialSlug": "agc-help-test-api-edit-test-group-0000002634718664", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-alias", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-edit-test-group", + "href": "/api/v1/functions/endpoints/create-alias", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-edit-test-group --invoke --body body.json", - "show": "agc testing test-api-edit-test-group --pretty" + "docs": "agc functions create-alias --docs --pretty", + "invoke": "agc functions create-alias --invoke --session-file SESSION.json --body body.json", + "show": "agc functions create-alias --pretty" } }, { - "id": "test-api-get-detect-task", - "familyId": "testing", - "name": "查询上架自检报告信息", - "description": "此接口用于查询邀请测试进行上架自检的报告信息。", - "method": "GET", - "path": "/api/publish/v2/test/app/version/detect-report", - "command": "agc testing test-api-get-detect-task", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "update-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions update-alias --docs --pretty" + }, + "id": "update-alias", + "familyId": "functions", + "name": "update-alias", + "description": "Reviewed native management transport; explicit user session required. Read get-alias first and provide revisionId plus the full intended routing configuration.", + "method": "PUT", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases/{aliasName}", + "command": "agc functions update-alias", + "requiredParams": [ + "functionName", + "aliasName", + "functionVersion", + "revisionId", + "routingConfig" + ], + "parameters": [ + { + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "functionName", + "in": "path", + "required": true + }, + { + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "aliasName", + "in": "path", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "functionVersion", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "revisionId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "description", + "in": "body", + "required": false + }, + { + "additionalProperties": { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 0, + "maximum": 100, + "type": "integer", + "name": "weight", + "in": "body", + "required": true + }, + "propertyNamesPattern": "^(\\$latest|[1-9][0-9]{0,2}|1000)$", + "minProperties": 1, + "maxProperties": 2, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "routingConfig", + "in": "body", + "required": true, + "description": "One or two version weights totaling 100; explicit complete routing required by this CLI." + } + ], + "body": "functionVersion,revisionId,description,routingConfig", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189", - "officialSlug": "agc-help-test-api-get-detect-task-0000002525033189", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-update-alias", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-get-detect-task", + "href": "/api/v1/functions/endpoints/update-alias", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-get-detect-task --invoke", - "show": "agc testing test-api-get-detect-task --pretty" + "docs": "agc functions update-alias --docs --pretty", + "invoke": "agc functions update-alias --invoke --session-file SESSION.json --body body.json", + "show": "agc functions update-alias --pretty" } }, { - "id": "test-api-get-invite-code", - "familyId": "testing", - "name": "查询测试群组邀请码", - "description": "此接口用于邀请测试查询测试群组邀请码信息。", - "method": "GET", - "path": "/api/app-test/v1/test-group/invitation-code", - "command": "agc testing test-api-get-invite-code", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "create-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-http-trigger --docs --pretty" + }, + "id": "create-http-trigger", + "familyId": "functions", + "name": "create-http-trigger", + "description": "Reviewed native management transport; explicit user session required. funcId is obtained from query-function-version and must include the intended qualifier; create policy separately if required.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/trigger", + "command": "agc functions create-http-trigger", "requiredParams": [ - "appId", - "groupId" + "funcId", + "mode", + "authFlag", + "authAlgor", + "authType", + "enableUrlDecode" ], "parameters": [ { - "name": "appId", - "in": "header", - "required": true, - "description": "Huawei application ID" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "funcId", + "in": "body", + "required": true }, { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "NO_PATH" + ], "type": "string", - "name": "groupId", - "in": "query", - "required": true, - "description": "测试群组 ID" + "name": "mode", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "authFlag", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "HDA-SYSTEM" + ], + "type": "string", + "name": "authAlgor", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client", + "internal-auth" + ], + "type": "string", + "name": "authType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "enableUrlDecode", + "in": "body", + "required": true } ], + "body": "funcId,mode,authFlag,authAlgor,authType,enableUrlDecode", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669", - "officialSlug": "agc-help-test-api-get-invite-code-0000002271160669", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-http-trigger", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-get-invite-code", + "href": "/api/v1/functions/endpoints/create-http-trigger", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-get-invite-code --invoke", - "show": "agc testing test-api-get-invite-code --pretty" + "docs": "agc functions create-http-trigger --docs --pretty", + "invoke": "agc functions create-http-trigger --invoke --session-file SESSION.json --body body.json", + "show": "agc functions create-http-trigger --pretty" } }, { - "id": "test-api-get-test-grouplist", - "familyId": "testing", - "name": "查询测试群组列表", - "description": "此接口用于邀请测试查询已创建的内外部测试群组列表。", - "method": "GET", - "path": "/api/app-test/v1/test-group/list", - "command": "agc testing test-api-get-test-grouplist", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "create-cron-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-cron-trigger --docs --pretty" + }, + "id": "create-cron-trigger", + "familyId": "functions", + "name": "create-cron-trigger", + "description": "Reviewed native management transport; explicit user session required. Default AGCLI create switch is false; an explicit triggerSwitch is required. Current guide says switch cannot be changed later, unlike AGCLI update; cloud support is unverified.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/triggers", + "command": "agc functions create-cron-trigger", "requiredParams": [ - "appId" + "funcId", + "triggerType", + "triggerMode", + "triggerSwitch", + "spec" ], "parameters": [ { - "name": "appId", - "in": "header", - "required": true, - "description": "Huawei application ID" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "funcId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Cron" + ], + "type": "string", + "name": "triggerType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Sync", + "ASync" + ], + "type": "string", + "name": "triggerMode", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "triggerSwitch", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "schedule", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "payload", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "spec", + "in": "body", + "required": true } ], + "body": "funcId,triggerType,triggerMode,triggerSwitch,spec", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717", - "officialSlug": "agc-help-test-api-get-test-grouplist-0000002271000717", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-cron-trigger", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-get-test-grouplist", + "href": "/api/v1/functions/endpoints/create-cron-trigger", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-get-test-grouplist --invoke", - "show": "agc testing test-api-get-test-grouplist --pretty" + "docs": "agc functions create-cron-trigger --docs --pretty", + "invoke": "agc functions create-cron-trigger --invoke --session-file SESSION.json --body body.json", + "show": "agc functions create-cron-trigger --pretty" } }, { - "id": "test-api-modify-test-version", - "familyId": "testing", - "name": "更新测试版本", - "description": "此接口用于更新已创建的测试版本。", - "method": "PUT", - "path": "/api/publish/v2/test/app/version", - "command": "agc testing test-api-modify-test-version", - "body": "json", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "get-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-http-trigger --docs --pretty" + }, + "id": "get-http-trigger", + "familyId": "functions", + "name": "get-http-trigger", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/trigger/{triggerId}", + "command": "agc functions get-http-trigger", + "requiredParams": [ + "triggerId" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "triggerId", + "in": "path", + "required": true + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657", - "officialSlug": "agc-help-test-api-modify-test-version-0000002271160657", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-get-http-trigger", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-modify-test-version", + "href": "/api/v1/functions/endpoints/get-http-trigger", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-modify-test-version --invoke --body body.json", - "show": "agc testing test-api-modify-test-version --pretty" + "docs": "agc functions get-http-trigger --docs --pretty", + "invoke": "agc functions get-http-trigger --invoke --session-file SESSION.json", + "show": "agc functions get-http-trigger --pretty" } }, { - "id": "test-api-post-test-notify", - "familyId": "testing", - "name": "发送邀请测试通知", - "description": "此接口用于给内外部群组的测试用户发送邀请测试的通知。", - "method": "POST", - "path": "/api/publish/v1/test/user/action/notify", - "command": "agc testing test-api-post-test-notify", - "body": "json", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "delete-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions delete-http-trigger --docs --pretty" + }, + "id": "delete-http-trigger", + "familyId": "functions", + "name": "delete-http-trigger", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/api/wisefunction/serverless/v1/trigger/{triggerId}", + "command": "agc functions delete-http-trigger", + "requiredParams": [ + "triggerId" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "triggerId", + "in": "path", + "required": true + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538", - "officialSlug": "agc-help-test-api-post-test-notify-0000002236041538", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-delete-http-trigger", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-post-test-notify", + "href": "/api/v1/functions/endpoints/delete-http-trigger", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-post-test-notify --invoke --body body.json", - "show": "agc testing test-api-post-test-notify --pretty" + "docs": "agc functions delete-http-trigger --docs --pretty", + "invoke": "agc functions delete-http-trigger --invoke --session-file SESSION.json", + "show": "agc functions delete-http-trigger --pretty" } }, { - "id": "test-api-query-feedback", - "familyId": "testing", - "name": "查询测试问题反馈", - "description": "此接口用于查询测试问题反馈列表。", - "method": "POST", - "path": "/api/app-test/v1/mgmt/tester-feedback/action/query", - "command": "agc testing test-api-query-feedback", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717", - "officialSlug": "agc-help-test-api-query-feedback-0000002665117717", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/testing/endpoints", - "method": "GET" + "authentication": "agcli-management-oauth", + "documentation": { + "title": "list-http-triggers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-http-triggers --docs --pretty" + }, + "id": "list-http-triggers", + "familyId": "functions", + "name": "list-http-triggers", + "description": "Reviewed native management transport; explicit user session required. Listing path is also reviewed in boundary/triggerService.js. Endpoint list uses exact funcId, no automatic qualifier discovery.", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/trigger/list/{funcId}", + "command": "agc functions list-http-triggers", + "requiredParams": [ + "funcId" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "funcId", + "in": "path", + "required": true }, - "self": { - "href": "/api/v1/testing/endpoints/test-api-query-feedback", - "method": "GET" + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "pageSize", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "type": "integer", + "name": "pageIndex", + "in": "query", + "required": false } - }, - "affordances": { - "invoke": "agc testing test-api-query-feedback --invoke --body body.json", - "show": "agc testing test-api-query-feedback --pretty" - } - }, - { - "id": "test-api-query-feedback-dimension", - "familyId": "testing", - "name": "查询测试问题反馈维度", - "description": "此接口用于查询测试反馈维度。", - "method": "POST", - "path": "/api/app-test/v1/mgmt/tester-feedback-dimension/action/query", - "command": "agc testing test-api-query-feedback-dimension", - "body": "json", + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572", - "officialSlug": "agc-help-test-api-query-feedback-dimension-0000002634878572", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-http-triggers", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-query-feedback-dimension", + "href": "/api/v1/functions/endpoints/list-http-triggers", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-query-feedback-dimension --invoke --body body.json", - "show": "agc testing test-api-query-feedback-dimension --pretty" + "docs": "agc functions list-http-triggers --docs --pretty", + "invoke": "agc functions list-http-triggers --invoke --session-file SESSION.json", + "show": "agc functions list-http-triggers --pretty" } }, { - "id": "test-api-query-open-test-link", - "familyId": "testing", - "name": "查询公开链接", - "description": "此接口用于查询群组级公开测试链接。", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "get-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-trigger --docs --pretty" + }, + "id": "get-trigger", + "familyId": "functions", + "name": "get-trigger", + "description": "Reviewed native management transport; explicit user session required. ", "method": "GET", - "path": "/api/app-test/v1/test-group/public-link", - "command": "agc testing test-api-query-open-test-link", + "path": "/api/wisefunction/serverless/v1/triggers/{triggerId}", + "command": "agc functions get-trigger", + "requiredParams": [ + "triggerId" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "triggerId", + "in": "path", + "required": true + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775", - "officialSlug": "agc-help-test-api-query-open-test-link-0000002664997775", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-get-trigger", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-query-open-test-link", + "href": "/api/v1/functions/endpoints/get-trigger", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-query-open-test-link --invoke", - "show": "agc testing test-api-query-open-test-link --pretty" + "docs": "agc functions get-trigger --docs --pretty", + "invoke": "agc functions get-trigger --invoke --session-file SESSION.json", + "show": "agc functions get-trigger --pretty" } }, { - "id": "test-api-query-test-user", - "familyId": "testing", - "name": "查询测试群组成员", - "description": "此接口用于查询测试群组成员。", - "method": "GET", - "path": "/api/app-test/v1/test-user", - "command": "agc testing test-api-query-test-user", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "delete-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions delete-trigger --docs --pretty" + }, + "id": "delete-trigger", + "familyId": "functions", + "name": "delete-trigger", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/api/wisefunction/serverless/v1/triggers/{triggerId}", + "command": "agc functions delete-trigger", "requiredParams": [ - "appId", - "groupId" + "triggerId" ], "parameters": [ { - "name": "appId", - "in": "header", - "required": true, - "description": "Huawei application ID" - }, - { - "name": "groupId", - "in": "header", - "required": true, - "description": "Test group ID" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "triggerId", + "in": "path", + "required": true } ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773", - "officialSlug": "agc-help-test-api-query-test-user-0000002664997773", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-delete-trigger", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-query-test-user", + "href": "/api/v1/functions/endpoints/delete-trigger", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-query-test-user --invoke", - "show": "agc testing test-api-query-test-user --pretty" + "docs": "agc functions delete-trigger --docs --pretty", + "invoke": "agc functions delete-trigger --invoke --session-file SESSION.json", + "show": "agc functions delete-trigger --pretty" } }, { - "id": "test-api-release-test-version", - "familyId": "testing", - "name": "更新测试生效版本", - "description": "此接口用于将公开测试版本转为全网版本或者分阶段版本。", - "method": "PUT", - "path": "/api/publish/v2/test/version/release", - "command": "agc testing test-api-release-test-version", - "body": "json", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "list-triggers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-triggers --docs --pretty" + }, + "id": "list-triggers", + "familyId": "functions", + "name": "list-triggers", + "description": "Reviewed native management transport; explicit user session required. Listing path is also reviewed in boundary/triggerService.js. Endpoint list uses exact funcId, no automatic qualifier discovery.", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/triggers/list/{funcId}", + "command": "agc functions list-triggers", + "requiredParams": [ + "funcId" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "funcId", + "in": "path", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "pageSize", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "type": "integer", + "name": "pageIndex", + "in": "query", + "required": false + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713", - "officialSlug": "agc-help-test-api-release-test-version-0000002271000713", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-triggers", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-release-test-version", + "href": "/api/v1/functions/endpoints/list-triggers", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-release-test-version --invoke --body body.json", - "show": "agc testing test-api-release-test-version --pretty" + "docs": "agc functions list-triggers --docs --pretty", + "invoke": "agc functions list-triggers --invoke --session-file SESSION.json", + "show": "agc functions list-triggers --pretty" } }, { - "id": "test-api-stop-invite-code", - "familyId": "testing", - "name": "停止邀请码", - "description": "此接口用于邀请测试停止邀请码。", - "method": "POST", - "path": "/api/app-test/v1/invitation-code/action/stop", - "command": "agc testing test-api-stop-invite-code", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "update-cron-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions update-cron-trigger --docs --pretty" + }, + "id": "update-cron-trigger", + "familyId": "functions", + "name": "update-cron-trigger", + "description": "Reviewed native management transport; explicit user session required. Read get-trigger first; preserve funcId, spec, triggerMode and revisionId.", + "method": "PUT", + "path": "/api/wisefunction/serverless/v1/triggers/{triggerId}", + "command": "agc functions update-cron-trigger", "requiredParams": [ - "appId", - "invitationCodeId" + "triggerId", + "funcId", + "triggerMode", + "triggerSwitch", + "spec", + "revisionId" ], "parameters": [ { - "name": "appId", - "in": "header", - "required": true, - "description": "Huawei application ID" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "triggerId", + "in": "path", + "required": true }, { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", "type": "string", - "name": "invitationCodeId", + "name": "funcId", "in": "body", - "required": true, - "description": "要停止的邀请码 ID" + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Sync", + "ASync" + ], + "type": "string", + "name": "triggerMode", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "triggerSwitch", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "schedule", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "payload", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "spec", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "revisionId", + "in": "body", + "required": true } ], - "body": "invitationCodeId", + "body": "funcId,triggerMode,triggerSwitch,spec,revisionId", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725", - "officialSlug": "agc-help-test-api-stop-invite-code-0000002271000725", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-update-cron-trigger", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-stop-invite-code", + "href": "/api/v1/functions/endpoints/update-cron-trigger", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-stop-invite-code --invoke --body body.json", - "show": "agc testing test-api-stop-invite-code --pretty" + "docs": "agc functions update-cron-trigger --docs --pretty", + "invoke": "agc functions update-cron-trigger --invoke --session-file SESSION.json --body body.json", + "show": "agc functions update-cron-trigger --pretty" } }, { - "id": "test-api-stop-test-version", - "familyId": "testing", - "name": "停止测试版本", - "description": "此接口用于停止测试版本。", - "method": "POST", - "path": "/api/publish/v2/test/version/stop", - "command": "agc testing test-api-stop-test-version", - "body": "json", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "get-function-policy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-function-policy --docs --pretty" + }, + "id": "get-function-policy", + "familyId": "functions", + "name": "get-function-policy", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/policy", + "command": "agc functions get-function-policy", + "requiredParams": [ + "functionName", + "qualifier" + ], + "parameters": [ + { + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "functionName", + "in": "path", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "qualifier", + "in": "query", + "required": true + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542", - "officialSlug": "agc-help-test-api-stop-test-version-0000002236041542", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-get-function-policy", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-stop-test-version", + "href": "/api/v1/functions/endpoints/get-function-policy", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-stop-test-version --invoke --body body.json", - "show": "agc testing test-api-stop-test-version --pretty" + "docs": "agc functions get-function-policy --docs --pretty", + "invoke": "agc functions get-function-policy --invoke --session-file SESSION.json", + "show": "agc functions get-function-policy --pretty" } }, { - "id": "test-api-submit-test-version", - "familyId": "testing", - "name": "提交测试版本", - "description": "此接口用于测试版本提交审核。", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "create-function-policy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-function-policy --docs --pretty" + }, + "id": "create-function-policy", + "familyId": "functions", + "name": "create-function-policy", + "description": "Reviewed native management transport; explicit user session required. Read policy first; no automatic grants or silent retries.", "method": "POST", - "path": "/api/publish/v2/test/app/version/submit", - "command": "agc testing test-api-submit-test-version", - "body": "json", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/policy", + "command": "agc functions create-function-policy", + "requiredParams": [ + "functionName", + "qualifier", + "effect", + "action", + "sourceProvider", + "sourceId" + ], + "parameters": [ + { + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "functionName", + "in": "path", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "qualifier", + "in": "query", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Allow" + ], + "type": "string", + "name": "effect", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "InvokeFunction" + ], + "type": "string", + "name": "action", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "sourceProvider", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "sourceId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "revisionId", + "in": "body", + "required": false + } + ], + "body": "effect,action,sourceProvider,sourceId,revisionId", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334", - "officialSlug": "agc-help-test-api-submit-test-version-0000002236201334", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-function-policy", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-submit-test-version", + "href": "/api/v1/functions/endpoints/create-function-policy", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-submit-test-version --invoke --body body.json", - "show": "agc testing test-api-submit-test-version --pretty" + "docs": "agc functions create-function-policy --docs --pretty", + "invoke": "agc functions create-function-policy --invoke --session-file SESSION.json --body body.json", + "show": "agc functions create-function-policy --pretty" } }, { - "id": "test-api-update-test-version-opentest", - "familyId": "testing", - "name": "更新有效期内的测试版本信息", - "description": "此接口用于更新有效期内测试版本的测试时间和下载安装次数。", - "method": "PUT", - "path": "/api/publish/v2/test/version/open-test", - "command": "agc testing test-api-update-test-version-opentest", - "body": "json", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "list-layers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-layers --docs --pretty" + }, + "id": "list-layers", + "familyId": "functions", + "name": "list-layers", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/layers", + "command": "agc functions list-layers", + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "layerName", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "all", + "self", + "other" + ], + "type": "string", + "name": "ownerFlag", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "compatibleRuntime", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "pageSize", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "type": "integer", + "name": "pageIndex", + "in": "query", + "required": false + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530", - "officialSlug": "agc-help-test-api-update-test-version-opentest-0000002236041530", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-layers", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/testing/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/testing/endpoints/test-api-update-test-version-opentest", + "href": "/api/v1/functions/endpoints/list-layers", "method": "GET" } }, "affordances": { - "invoke": "agc testing test-api-update-test-version-opentest --invoke --body body.json", - "show": "agc testing test-api-update-test-version-opentest --pretty" + "docs": "agc functions list-layers --docs --pretty", + "invoke": "agc functions list-layers --invoke --session-file SESSION.json", + "show": "agc functions list-layers --pretty" } }, { - "id": "activityawardexport", - "familyId": "reports", - "name": "获取给指定用户群发奖的报表", - "description": "获取指定给用户群发奖的报表数据的CSV文件地址。", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "list-layer-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-layer-versions --docs --pretty" + }, + "id": "list-layer-versions", + "familyId": "functions", + "name": "list-layer-versions", + "description": "Reviewed native management transport; explicit user session required. ", "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/activityAwardExport/{appId}", - "command": "agc reports activityawardexport", + "path": "/api/wisefunction/serverless/v1/layers/{layerName}/versions", + "command": "agc functions list-layer-versions", "requiredParams": [ - "appId" + "layerName" ], "parameters": [ { - "name": "appId", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "layerName", "in": "path", - "required": true, - "description": "appId parameter" + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "compatibleRuntime", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "pageSize", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "type": "integer", + "name": "pageIndex", + "in": "query", + "required": false } ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071", - "officialSlug": "agcapi-activityawardexport-0000001158245071", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-layer-versions", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/activityawardexport", + "href": "/api/v1/functions/endpoints/list-layer-versions", "method": "GET" } }, "affordances": { - "invoke": "agc reports activityawardexport --invoke", - "show": "agc reports activityawardexport --pretty" + "docs": "agc functions list-layer-versions --docs --pretty", + "invoke": "agc functions list-layer-versions --invoke --session-file SESSION.json", + "show": "agc functions list-layer-versions --pretty" } }, { - "id": "addadkpexport", - "familyId": "reports", - "name": "获取新增和留存的报表", - "description": "获取新增和留存的报表数据的CSV或者Excel文件地址。", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "get-layer-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-layer-version --docs --pretty" + }, + "id": "get-layer-version", + "familyId": "functions", + "name": "get-layer-version", + "description": "Reviewed native management transport; explicit user session required. ", "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/addAdKpExport/{appId}", - "command": "agc reports addadkpexport", + "path": "/api/wisefunction/serverless/v1/layers/{layerName}/versions/{layerVersion}", + "command": "agc functions get-layer-version", "requiredParams": [ - "appId" + "layerName", + "layerVersion" ], "parameters": [ { - "name": "appId", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "layerName", "in": "path", - "required": true, - "description": "appId parameter" + "required": true + }, + { + "pattern": "^[1-9][0-9]*$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "layerVersion", + "in": "path", + "required": true } ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102", - "officialSlug": "agcapi-addadkpexport-0000001111845102", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-get-layer-version", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/addadkpexport", + "href": "/api/v1/functions/endpoints/get-layer-version", "method": "GET" } }, "affordances": { - "invoke": "agc reports addadkpexport --invoke", - "show": "agc reports addadkpexport --pretty" + "docs": "agc functions get-layer-version --docs --pretty", + "invoke": "agc functions get-layer-version --invoke --session-file SESSION.json", + "show": "agc functions get-layer-version --pretty" } }, { - "id": "appdownloadexport", - "familyId": "reports", - "name": "获取下载安装的报表", - "description": "获取下载安装的报表数据的CSV或者Excel文件地址。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/appDownloadExport/{appId}", - "command": "agc reports appdownloadexport", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "create-layer-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-layer-version --docs --pretty" + }, + "id": "create-layer-version", + "familyId": "functions", + "name": "create-layer-version", + "description": "Reviewed native management transport; explicit user session required. zipFile contains Base64 ZIP bytes; validate compressed/decompressed limits and entry count before authorization. Layer name creates the initial version or appends a version. AGCLI 1.12.0 local ZIP validation caps files below 50MiB; this direct API adapter uses the current browser-reviewed guide limits of 150MiB compressed, 300MiB expanded and 30000 entries. This difference and modern runtime wire values still require cloud verification.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/layers/{layerName}/versions", + "command": "agc functions create-layer-version", "requiredParams": [ - "appId" + "layerName", + "compatibleRuntimes", + "sharedScope", + "zipFile" ], "parameters": [ { - "name": "appId", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "layerName", "in": "path", - "required": true, - "description": "appId parameter" + "required": true }, { - "name": "language", - "in": "query", - "required": false, - "description": "Report language" + "itemsEnum": [ + "nodejs14.x", + "java1.8", + "python3", + "custom-runtime" + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "string", + "type": "array", + "name": "compatibleRuntimes", + "in": "body", + "required": true }, { - "name": "startTime", - "in": "query", - "required": false, - "description": "Start date in YYYYMMDD format" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "sharedScope", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "format": "byte", + "name": "zipFile", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 1024, + "type": "string", + "name": "description", + "in": "body", + "required": false }, { - "name": "endTime", - "in": "query", - "required": false, - "description": "End date in YYYYMMDD format" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "licenseInfo", + "in": "body", + "required": false } ], + "body": "compatibleRuntimes,sharedScope,zipFile,description,licenseInfo", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059", - "officialSlug": "agcapi-appdownloadexport-0000001158365059", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-layer-version", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/functions/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/appdownloadexport", + "href": "/api/v1/functions/endpoints/create-layer-version", "method": "GET" } }, "affordances": { - "invoke": "agc reports appdownloadexport --invoke", - "show": "agc reports appdownloadexport --pretty" + "docs": "agc functions create-layer-version --docs --pretty", + "invoke": "agc functions create-layer-version --invoke --session-file SESSION.json --body body.json", + "show": "agc functions create-layer-version --pretty" } }, { - "id": "appdownloadfailexport", - "familyId": "reports", - "name": "获取安装失败数据的报表", - "description": "获取安装失败数据的报表CSV或EXCEL文件。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/appDownloadFailExport/{appId}", - "command": "agc reports appdownloadfailexport", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "导入用户", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth import-users --docs --pretty" + }, + "id": "import-users", + "familyId": "cloud-auth", + "name": "导入用户", + "description": "此接口用于将准备好的用户信息导入到认证服务的用户数据中。", + "method": "POST", + "path": "/api/auth-service/v1/server/user:import", + "command": "agc cloud-auth import-users", "requiredParams": [ - "appId" + "productId", + "users" ], "parameters": [ { - "name": "appId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 1024, + "type": "string", + "name": "importUid", + "in": "body", + "required": true, + "description": "用户ID,唯一标识。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 1024, + "type": "string", + "name": "displayName", + "in": "body", + "required": false, + "description": "用户昵称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 2048, + "type": "string", + "name": "photoUrl", + "in": "body", + "required": false, + "description": "头像地址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 512, + "type": "string", + "name": "email", + "in": "body", + "required": false, + "description": "用户邮箱地址。 第三方的认证信息providers中的providerId为12的时候不能为空。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "type": "boolean", + "name": "emailVerified", + "in": "body", + "required": false, + "description": "邮箱是否需要验证,值为true或者false。 第三方的认证信息providers中的providerId为12的时候不能为空。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 32, + "type": "string", + "name": "phone", + "in": "body", + "required": false, + "description": "手机号。格式: +国家码-手机号,示例+86-18260096275。 第三方的认证信息providers中的providerId为11的时候不能为空。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 20, + "type": "string", + "name": "createTime", + "in": "body", + "required": true, + "description": "创建时间,距离1970年1月1日毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 20, + "type": "string", + "name": "lastLoginTime", + "in": "body", + "required": false, + "description": "上次登入时间,距离1970年1月1日的毫秒数。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 8192, + "type": "string", + "name": "passwordHash", + "in": "body", + "required": false, + "description": "明文密码经过PBKDF2WithSHA256后的结果,迭代次数10000,盐值对应passwordSalt。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 8192, + "type": "string", + "name": "passwordSalt", + "in": "body", + "required": false, + "description": "密码算法的盐值。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "type": "string", + "name": "provider", + "in": "body", + "required": true, + "description": "认证方式类型: 0:匿名账号 1:华为账号 2: FACEBOOK* 3. TWITTER* 4:微信 5:华为游戏 6:QQ 7:微博 8:GOOGLE* 9: GOOGLE_PLAY_GAME* 10:自建账号 11:手机 12:邮箱 13:苹果账号 18:支付宝账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 1024, + "type": "string", + "name": "providerUid", + "in": "body", + "required": true, + "description": "用户唯一标识,由三方系统分配。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 2048, + "type": "string", + "name": "photoUrl", + "in": "body", + "required": false, + "description": "头像地址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 1024, + "type": "string", + "name": "displayName", + "in": "body", + "required": false, + "description": "用户昵称。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxLength": 1024, + "type": "string", + "name": "openId", + "in": "body", + "required": false, + "description": "发送者唯一标识,例如微信openId。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "maxItems": 32, + "itemsType": "object", + "type": "array", + "name": "providers", + "in": "body", + "required": true, + "description": "第三方的认证信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "itemsType": "object", + "type": "array", + "name": "users", + "in": "body", "required": true, - "description": "appId parameter" + "description": "第三方的认证信息。" } ], + "body": "users", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063", - "officialSlug": "agcapi-appdownloadfailexport-0000001158365063", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892", + "officialSlug": "server-rest-import-0000001136020892", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/appdownloadfailexport", + "href": "/api/v1/cloud-auth/endpoints/import-users", "method": "GET" } }, "affordances": { - "invoke": "agc reports appdownloadfailexport --invoke", - "show": "agc reports appdownloadfailexport --pretty" + "invoke": "agc cloud-auth import-users --invoke --body body.json", + "show": "agc cloud-auth import-users --pretty" } }, { - "id": "couponexport", - "familyId": "reports", - "name": "获取优惠券活动的报表", - "description": "获取优惠券活动的报表CSV或EXCEL文件。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/activityCouponExport/{appId}", - "command": "agc reports couponexport", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "导出用户", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth export-users --docs --pretty" + }, + "id": "export-users", + "familyId": "cloud-auth", + "name": "导出用户", + "description": "此接口用于导出认证服务中的用户信息。", + "method": "POST", + "path": "/api/auth-service/v1/server/user:export", + "command": "agc cloud-auth export-users", "requiredParams": [ - "appId" + "productId" ], "parameters": [ { - "name": "appId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "type": "string", + "name": "productId", + "in": "header", "required": true, - "description": "appId parameter" + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section16294334331", + "name": "block", + "in": "body", + "required": false, + "description": "当前存储块号。不填默认是0。第1次调用时,block设置为0。服务端会返回totalBlock。后面采用循环调用,遍历导出block块里面的用户。 Documented String/example integer conflict; accepted without coercion." } ], + "body": "block", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104", - "officialSlug": "agcapi-couponexport-0000001111845104", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686", + "officialSlug": "server-rest-export-0000001136180686", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/couponexport", + "href": "/api/v1/cloud-auth/endpoints/export-users", "method": "GET" } }, "affordances": { - "invoke": "agc reports couponexport --invoke", - "show": "agc reports couponexport --pretty" + "invoke": "agc cloud-auth export-users --invoke --body body.json", + "show": "agc cloud-auth export-users --pretty" } }, { - "id": "fa-distribute-analysis-export", - "familyId": "reports", - "name": "获取元服务分发分析的报表文件", - "description": "获取元服务分发分析的报表数据的CSV或者Excel文件地址。", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "验证用户凭据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth verify-token --docs --pretty" + }, + "id": "verify-token", + "familyId": "cloud-auth", + "name": "验证用户凭据", + "description": "此接口用于验证已经颁发的用户凭据并且检查用户凭据是否已经撤销。", "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/fa/distributeAnalysisExport/", - "command": "agc reports fa-distribute-analysis-export", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352", - "officialSlug": "agcapi-fa-distribute_analysis_export-0000001690307352", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/reports/endpoints", - "method": "GET" + "path": "/api/oauth2/third/v1/verify-token", + "command": "agc cloud-auth verify-token", + "requiredParams": [ + "accessToken", + "productId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "type": "string", + "name": "accessToken", + "in": "header", + "required": true, + "description": "用户凭据。" }, - "self": { - "href": "/api/v1/reports/endpoints/fa-distribute-analysis-export", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section29031245171214", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" } - }, - "affordances": { - "invoke": "agc reports fa-distribute-analysis-export --invoke", - "show": "agc reports fa-distribute-analysis-export --pretty" - } - }, - { - "id": "fa-user-analysis-export", - "familyId": "reports", - "name": "获取元服务新增留存的报表文件", - "description": "获取元服务新增留存的报表数据的CSV或者Excel文件地址。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/fa/userAnalysisExport/", - "command": "agc reports fa-user-analysis-export", + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949", - "officialSlug": "agcapi-fa-user_analysis_export-0000001738465949", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271", + "officialSlug": "server-rest-verify-0000001182300271", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/fa-user-analysis-export", + "href": "/api/v1/cloud-auth/endpoints/verify-token", "method": "GET" } }, "affordances": { - "invoke": "agc reports fa-user-analysis-export --invoke", - "show": "agc reports fa-user-analysis-export --pretty" + "invoke": "agc cloud-auth verify-token --invoke", + "show": "agc cloud-auth verify-token --pretty" } }, { - "id": "fa-widget-analysis-export", - "familyId": "reports", - "name": "获取元服务卡片分析的报表文件", - "description": "获取元服务卡片分析的报表数据的CSV或者Excel文件地址。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/fa/widgetAnalysisExport/", - "command": "agc reports fa-widget-analysis-export", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "撤销用户凭据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth revoke-token --docs --pretty" + }, + "id": "revoke-token", + "familyId": "cloud-auth", + "name": "撤销用户凭据", + "description": "此接口用于撤销已经颁发的用户访问凭据。", + "method": "POST", + "path": "/api/oauth2/third/v1/revoke-token", + "command": "agc cloud-auth revoke-token", + "requiredParams": [ + "uid", + "productId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "type": "string", + "name": "uid", + "in": "header", + "required": true, + "description": "待撤销凭据的用户。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1696945244814", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + } + ], + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092", - "officialSlug": "agcapi-fa-widget_analysis_export-0000001690467092", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193", + "officialSlug": "server-rest-revoke-0000001182420193", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/fa-widget-analysis-export", + "href": "/api/v1/cloud-auth/endpoints/revoke-token", "method": "GET" } }, "affordances": { - "invoke": "agc reports fa-widget-analysis-export --invoke", - "show": "agc reports fa-widget-analysis-export --pretty" + "invoke": "agc cloud-auth revoke-token --invoke --body body.json", + "show": "agc cloud-auth revoke-token --pretty" } }, { - "id": "gamereservationexport", - "familyId": "reports", - "name": "获取预约的报表", - "description": "获取预约报表数据的CSV或EXCEL文件地址。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/gameReservationExport/{appId}", - "command": "agc reports gamereservationexport", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "body-client-credentials", + "requestContentType": "application/json", + "documentation": { + "title": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth client-token --docs --pretty" + }, + "id": "client-token", + "familyId": "cloud-auth", + "name": "获取Token", + "description": "在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。", + "method": "POST", + "path": "/agc/apigw/oauth2/v1/token", + "command": "agc cloud-auth client-token", "requiredParams": [ - "appId" + "useJwt", + "grant_type", + "client_id", + "client_secret" ], "parameters": [ { - "name": "appId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "useJwt", + "in": "body", + "required": true, + "description": "是否使用自有账号凭据JWT(Json Web Token): 1:使用JWT。 0:不使用,默认为0。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "enum": [ + "client_credentials" + ], + "type": "string", + "name": "grant_type", + "in": "body", + "required": true, + "description": "固定传入“client_credentials”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "type": "string", + "name": "client_id", + "in": "body", + "required": true, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "type": "string", + "name": "client_secret", + "in": "body", "required": true, - "description": "appId parameter" + "description": "客户端密钥,即获取客户端API授权中的“Client Secret”。" } ], + "body": "useJwt,grant_type,client_id,client_secret", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212", - "officialSlug": "agcapi-gamereservationexport-0000001111685212", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "officialSlug": "client-rest-auth-obtaintoken-0000001414202481", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/gamereservationexport", + "href": "/api/v1/cloud-auth/endpoints/client-token", "method": "GET" } }, "affordances": { - "invoke": "agc reports gamereservationexport --invoke", - "show": "agc reports gamereservationexport --pretty" + "invoke": "agc cloud-auth client-token --invoke --body body.json", + "show": "agc cloud-auth client-token --pretty" } }, { - "id": "iapexport", - "familyId": "reports", - "name": "获取应用内付费的报表", - "description": "获取应用内付费的报表的CSV或者EXCEL文件地址。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/IAPExport/{appId}", - "command": "agc reports iapexport", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "验证码申请", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth request-code --docs --pretty" + }, + "rules": [ + { + "id": "account_identity", + "kind": "at_least_one", + "fields": [ + "body.phone", + "body.email" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "message": "Supply a phone or email identity.", + "suggestion": "Provide phone with country code, or email." + } + ], + "id": "request-code", + "familyId": "cloud-auth", + "name": "验证码申请", + "description": "此接口用于用户注册、登录或者重置密码时验证码申请。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/verify-code", + "command": "agc cloud-auth request-code", "requiredParams": [ - "appId", - "currency" + "productId" ], "parameters": [ { - "name": "appId", - "in": "path", - "required": true, - "description": "appId parameter" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section228117246513", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "type": "string", + "name": "phone", + "in": "body", + "required": false, + "description": "手机号。需包含国家码,以“+”开头,国家码和手机号之间以“-”连接,例如中国大陆手机号“+86-150xxxxxxxx”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "type": "string", + "name": "email", + "in": "body", + "required": false, + "description": "电子邮箱。 电子邮箱和手机号码二者必填一个。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "enum": [ + "1001", + "1002" + ], + "type": "integer", + "name": "action", + "in": "body", + "required": false, + "description": "验证码行为,取值如下: 1001:注册登录时申请验证码。 1002:重置密码时申请验证码。" }, { - "name": "currency", - "in": "query", - "required": true, - "description": "Report currency" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "enum": [ + "am_ET", + "ar_EG", + "as_IN", + "az_AZ", + "be_BY", + "bg_BG", + "bn_BD", + "bo_CN", + "bs_BA", + "ca_ES", + "cs_CZ", + "da_DK", + "de_DE", + "el_GR", + "en_GB", + "en_US", + "es_ES", + "es_US", + "et_EE", + "eu_ES", + "fa_IR", + "fi_FI", + "fr_FR", + "gl_ES", + "gu_IN", + "iw_IL", + "hi_IN", + "hr_HR", + "hu_HU", + "in_ID", + "it_IT", + "ja_JP", + "jv_Latn", + "ka_GE", + "kk_KZ", + "km_KH", + "kn_IN", + "ko_KR", + "lo_LA", + "lt_LT", + "lv_LV", + "mai_IN", + "mi_NZ", + "mk_MK", + "ml_IN", + "mn_MN", + "mr_IN", + "ms_MY", + "my_MM", + "ne_NP", + "nl_NL", + "nb_NO", + "or_IN", + "pa_IN", + "pl_PL", + "pt_BR", + "pt_PT", + "ro_RO", + "ru_RU", + "si_LK", + "sk_SK", + "sl_SI", + "sr_latn", + "sv_SE", + "sw_KE", + "ta_IN", + "te_IN", + "th_TH", + "tl_PH", + "tr_TR", + "my_ZG", + "uk_UA", + "ur_PK", + "uz_UZ", + "vi_VN", + "zh_CN", + "zh_HK", + "zh_TW" + ], + "type": "string", + "name": "lang", + "in": "body", + "required": false, + "description": "语言,格式为“zh_CN”。所有支持的语言类型请参考认证服务验证码语言类型。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "minimum": 30, + "maximum": 120, + "type": "integer", + "name": "sendInterval", + "in": "body", + "required": false, + "description": "验证码发送间隔,30s到120s之间。" } ], + "body": "phone,email,action,lang,sendInterval", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061", - "officialSlug": "agcapi-iapexport-0000001158365061", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "officialSlug": "client-rest-auth-verifycode-0000001294228992", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/iapexport", + "href": "/api/v1/cloud-auth/endpoints/request-code", "method": "GET" } }, "affordances": { - "invoke": "agc reports iapexport --invoke", - "show": "agc reports iapexport --pretty" + "invoke": "agc cloud-auth request-code --invoke --body body.json", + "show": "agc cloud-auth request-code --pretty" } }, { - "id": "orderanalysisexport", - "familyId": "reports", - "name": "获取付费下载的报表", - "description": "获取付费下载报表的CSV或者EXCEL文件。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/orderAnalysisExport/{appId}", - "command": "agc reports orderanalysisexport", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "用户注册", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth register --docs --pretty" + }, + "rules": [ + { + "id": "account_identity", + "kind": "at_least_one", + "fields": [ + "body.phone", + "body.email" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "message": "Supply a phone or email identity.", + "suggestion": "Provide phone with country code, or email." + }, + { + "id": "phone_verify_code", + "kind": "required_with", + "field": "body.verifyCode", + "fields": [ + "body.phone" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "message": "Phone registration requires verifyCode.", + "suggestion": "Obtain a test verification code before registering." + } + ], + "id": "register", + "familyId": "cloud-auth", + "name": "用户注册", + "description": "此接口用于用户注册。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-register", + "command": "agc cloud-auth register", "requiredParams": [ - "appId", - "teamId" + "productId" ], "parameters": [ { - "name": "appId", - "in": "path", - "required": true, - "description": "appId parameter" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" }, { - "name": "teamId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910", + "type": "string", + "name": "Authorization", "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section3324145832711", + "type": "string", + "name": "productId", + "in": "query", "required": true, - "description": "Huawei team ID" + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "type": "string", + "name": "phone", + "in": "body", + "required": false, + "description": "手机号,包括国家码,以“+”开头,例如中国大陆的手机号以“+86”开头。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "type": "string", + "name": "email", + "in": "body", + "required": false, + "description": "电子邮箱。 电子邮箱和手机号码二者必填一个。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "type": "string", + "name": "verifyCode", + "in": "body", + "required": false, + "description": "验证码,传入手机号时必填。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "type": "string", + "name": "password", + "in": "body", + "required": false, + "description": "登录密码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "useJwt", + "in": "body", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "type": "string", + "name": "channelId", + "in": "body", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "type": "string", + "name": "aaId", + "in": "body", + "required": false, + "description": "应用实例唯一编号。" } ], + "body": "phone,email,verifyCode,password,useJwt,channelId,aaId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214", - "officialSlug": "agcapi-orderanalysisexport-0000001111685214", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "officialSlug": "client-rest-auth-register-0000001346709109", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/orderanalysisexport", + "href": "/api/v1/cloud-auth/endpoints/register", "method": "GET" } }, "affordances": { - "invoke": "agc reports orderanalysisexport --invoke", - "show": "agc reports orderanalysisexport --pretty" + "invoke": "agc cloud-auth register --invoke --body body.json", + "show": "agc cloud-auth register --pretty" } }, { - "id": "orderdetailexport", - "familyId": "reports", - "name": "获取付费下载明细的报表", - "description": "获取付费下载明细的报表CSV文件。", - "method": "GET", - "path": "/api/report/distribution-operation-quality/v1/orderDetailExport/{appId}", - "command": "agc reports orderdetailexport", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "用户密码登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth sign-in-password --docs --pretty" + }, + "id": "sign-in-password", + "familyId": "cloud-auth", + "name": "用户密码登录", + "description": "此接口用于用户使用密码登录。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signin", + "command": "agc cloud-auth sign-in-password", "requiredParams": [ - "appId" + "productId", + "provider", + "token" ], "parameters": [ { - "name": "appId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section8252421578", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", + "in": "body", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "type": "string", + "name": "token", + "in": "body", "required": true, - "description": "appId parameter" + "description": "手机号码或者邮箱账号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "type": "string", + "name": "extraData", + "in": "body", + "required": false, + "description": "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "autoCreateUser", + "in": "body", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "useJwt", + "in": "body", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "type": "string", + "name": "channelId", + "in": "body", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "type": "string", + "name": "aaId", + "in": "body", + "required": false, + "description": "应用实例唯一编号。" } ], + "body": "provider,token,extraData,autoCreateUser,useJwt,channelId,aaId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073", - "officialSlug": "agcapi-orderdetailexport-0000001158245073", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348", + "officialSlug": "client-rest-auth-signin-0000001294069348", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/reports/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/reports/endpoints/orderdetailexport", + "href": "/api/v1/cloud-auth/endpoints/sign-in-password", "method": "GET" } }, "affordances": { - "invoke": "agc reports orderdetailexport --invoke", - "show": "agc reports orderdetailexport --pretty" + "invoke": "agc cloud-auth sign-in-password --invoke --body body.json", + "show": "agc cloud-auth sign-in-password --pretty" } }, { - "id": "addappfingerprint", - "familyId": "projects", - "name": "添加证书指纹", - "description": "此接口用于设置应用的证书指纹信息。", - "method": "PUT", - "path": "/api/cds/app-distirbution/v1/all/app-extra-info/{appId}", - "command": "agc projects addappfingerprint", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "用户验证码登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth sign-in-code --docs --pretty" + }, + "id": "sign-in-code", + "familyId": "cloud-auth", + "name": "用户验证码登录", + "description": "此接口用于用户使用验证码登录。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signin", + "command": "agc cloud-auth sign-in-code", "requiredParams": [ - "appId" + "productId", + "provider", + "token" ], "parameters": [ { - "name": "appId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section11159123655916", + "type": "string", + "name": "productId", + "in": "query", "required": true, - "description": "appId parameter" - } - ], - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218", - "officialSlug": "agcapi-addappfingerprint-0000001111685218", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/projects/endpoints", - "method": "GET" + "description": "项目ID,查询方法可参见查询项目ID。" }, - "self": { - "href": "/api/v1/projects/endpoints/addappfingerprint", - "method": "GET" - } - }, - "affordances": { - "invoke": "agc projects addappfingerprint --invoke --body body.json", - "show": "agc projects addappfingerprint --pretty" - } - }, - { - "id": "appbriefinfo", - "familyId": "projects", - "name": "获取应用简略信息", - "description": "批量查询应用简略信息。", - "method": "GET", - "path": "/api/cds/app-distirbution/v1/all/app-brief-info/list", - "command": "agc projects appbriefinfo", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", - "officialSlug": "agcapi-appbriefinfo-0000001111845106", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/projects/endpoints", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", + "in": "body", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" }, - "self": { - "href": "/api/v1/projects/endpoints/appbriefinfo", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "type": "string", + "name": "token", + "in": "body", + "required": true, + "description": "手机号码或者邮箱账号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "type": "string", + "name": "extraData", + "in": "body", + "required": false, + "description": "扩展字段,此处用于验证码登录时填写验证码,填写样例如 {\\\"verifyCode\\\":\\\"123456\\\"}。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "autoCreateUser", + "in": "body", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "useJwt", + "in": "body", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "type": "string", + "name": "channelId", + "in": "body", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "type": "string", + "name": "aaId", + "in": "body", + "required": false, + "description": "应用实例唯一编号。" } - }, - "affordances": { - "invoke": "agc projects appbriefinfo --invoke", - "show": "agc projects appbriefinfo --pretty" - } - }, - { - "id": "getconfigfile", - "familyId": "projects", - "name": "获取配置文件", - "description": "获取应用的配置文件。", - "method": "GET", - "path": "/api/cpms/project-management-service/v1/config-file", - "command": "agc projects getconfigfile", + ], + "body": "provider,token,extraData,autoCreateUser,useJwt,channelId,aaId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065", - "officialSlug": "agcapi-getconfigfile-0000001158365065", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685", + "officialSlug": "client-rest-auth-usersigini-0000001346828685", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/projects/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/projects/endpoints/getconfigfile", + "href": "/api/v1/cloud-auth/endpoints/sign-in-code", "method": "GET" } }, "affordances": { - "invoke": "agc projects getconfigfile --invoke", - "show": "agc projects getconfigfile --pretty" + "invoke": "agc cloud-auth sign-in-code --invoke --body body.json", + "show": "agc cloud-auth sign-in-code --pretty" } }, { - "id": "getteamlist", - "familyId": "projects", - "name": "获取团队列表", - "description": "获取开发者的团队账号列表信息。", - "method": "GET", - "path": "/api/ups/user-permission-service/v1/user-team-list", - "command": "agc projects getteamlist", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "修改手机号或邮箱地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth update-account --docs --pretty" + }, + "rules": [ + { + "id": "new_identity", + "kind": "at_least_one", + "fields": [ + "body.newPhone", + "body.newEmail" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "message": "Supply a new phone or email.", + "suggestion": "Specify newPhone or newEmail and its verification code." + } + ], + "id": "update-account", + "familyId": "cloud-auth", + "name": "修改手机号或邮箱地址", + "description": "此接口用于用户修改手机号码或者邮箱地址。", + "method": "PUT", + "path": "/agc/apigw/oauth2/third/v1/user-phone-email", + "command": "agc cloud-auth update-account", + "requiredParams": [ + "access_token", + "productId", + "newVerifyCode" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "type": "string", + "name": "access_token", + "in": "header", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1454420327110", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "type": "string", + "name": "lang", + "in": "body", + "required": false, + "description": "语言,格式为“zh_CN”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "type": "string", + "name": "newPhone", + "in": "body", + "required": false, + "description": "新手机号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "type": "string", + "name": "newEmail", + "in": "body", + "required": false, + "description": "新邮箱地址。 新邮箱地址和新手机号必填一个且只能填一个,即一次只修改手机号或者只修改邮箱地址。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "type": "string", + "name": "newVerifyCode", + "in": "body", + "required": true, + "description": "新验证码。" + } + ], + "body": "lang,newPhone,newEmail,newVerifyCode", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", - "officialSlug": "agcapi-getteamlist-0000001158245075", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "officialSlug": "client-rest-auth-modify-phone-email-0000001347069197", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/projects/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/projects/endpoints/getteamlist", + "href": "/api/v1/cloud-auth/endpoints/update-account", "method": "GET" } }, "affordances": { - "invoke": "agc projects getteamlist --invoke", - "show": "agc projects getteamlist --pretty" + "invoke": "agc cloud-auth update-account --invoke --body body.json", + "show": "agc cloud-auth update-account --pretty" } }, { - "id": "queryappfingerprint", - "familyId": "projects", - "name": "查询证书指纹和AppSecret", - "description": "此接口用于根据应用ID查询App Secret、证书指纹信息。", - "method": "GET", - "path": "/api/cds/app-distirbution/v1/all/app-extra-info/{appId}", - "command": "agc projects queryappfingerprint", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "重置密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth reset-password --docs --pretty" + }, + "id": "reset-password", + "familyId": "cloud-auth", + "name": "重置密码", + "description": "此接口用于用户进行密码重置。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/reset-password", + "command": "agc cloud-auth reset-password", "requiredParams": [ - "appId" + "productId" ], "parameters": [ { - "name": "appId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1226971914320", + "type": "string", + "name": "productId", + "in": "query", "required": true, - "description": "appId parameter" + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", + "in": "body", + "required": false, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "type": "string", + "name": "account", + "in": "body", + "required": false, + "description": "用户手机账号或者邮箱账号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "type": "string", + "name": "verifyCode", + "in": "body", + "required": false, + "description": "验证码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "type": "string", + "name": "password", + "in": "body", + "required": false, + "description": "新密码。" } ], + "body": "provider,account,verifyCode,password", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077", - "officialSlug": "agcapi-queryappfingerprint-0000001158245077", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500", + "officialSlug": "client-rest-auth-resetpwd-0000001293909500", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/projects/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/projects/endpoints/queryappfingerprint", + "href": "/api/v1/cloud-auth/endpoints/reset-password", "method": "GET" } }, "affordances": { - "invoke": "agc projects queryappfingerprint --invoke", - "show": "agc projects queryappfingerprint --pretty" + "invoke": "agc cloud-auth reset-password --invoke --body body.json", + "show": "agc cloud-auth reset-password --pretty" } }, { - "id": "queryprojectdetail", - "familyId": "projects", - "name": "查询项目详情及项目下的应用", - "description": "此接口用于查询指定项目的详细项目信息和项目下的应用列表信息。", - "method": "GET", - "path": "/api/project-service/v1/projects/{projectId}", - "command": "agc projects queryprojectdetail", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "修改密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth update-password --docs --pretty" + }, + "id": "update-password", + "familyId": "cloud-auth", + "name": "修改密码", + "description": "此接口用于用户进行密码修改。", + "method": "PUT", + "path": "/agc/apigw/oauth2/third/v1/user-password", + "command": "agc cloud-auth update-password", "requiredParams": [ - "projectId" + "access_token", + "productId", + "newPassword" ], "parameters": [ { - "name": "projectId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "type": "string", + "name": "access_token", + "in": "header", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section790812451959", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", + "in": "body", + "required": false, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "type": "string", + "name": "verifyCode", + "in": "body", + "required": false, + "description": "验证码。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "type": "string", + "name": "newPassword", + "in": "body", "required": true, - "description": "projectId parameter" + "description": "新密码。" } ], + "body": "provider,verifyCode,newPassword", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067", - "officialSlug": "agcapi-queryprojectdetail-0000001158365067", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536", + "officialSlug": "client-rest-auth-modifypwd-0000001293749536", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/projects/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/projects/endpoints/queryprojectdetail", + "href": "/api/v1/cloud-auth/endpoints/update-password", "method": "GET" } }, "affordances": { - "invoke": "agc projects queryprojectdetail --invoke", - "show": "agc projects queryprojectdetail --pretty" + "invoke": "agc cloud-auth update-password --invoke --body body.json", + "show": "agc cloud-auth update-password --pretty" } }, { - "id": "queryprojectlist", - "familyId": "projects", - "name": "查询项目列表", - "description": "此接口用于查询指定团队账号下的项目列表信息。", - "method": "GET", - "path": "/api/project-service/v1/projects", - "command": "agc projects queryprojectlist", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "用户关联", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth link-user --docs --pretty" + }, + "id": "link-user", + "familyId": "cloud-auth", + "name": "用户关联", + "description": "此接口用于用户进行账号关联操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-link", + "command": "agc cloud-auth link-user", + "requiredParams": [ + "access_token", + "productId", + "provider", + "token" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "type": "string", + "name": "access_token", + "in": "header", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section448216421586", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", + "in": "body", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "type": "string", + "name": "token", + "in": "body", + "required": true, + "description": "手机号码或者邮箱账号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "type": "string", + "name": "extraData", + "in": "body", + "required": false, + "description": "扩展字段,此处用于账号关联时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "autoCreateUser", + "in": "body", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "useJwt", + "in": "body", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "type": "string", + "name": "channelId", + "in": "body", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "type": "string", + "name": "aaId", + "in": "body", + "required": false, + "description": "应用实例唯一编号。" + } + ], + "body": "provider,token,extraData,autoCreateUser,useJwt,channelId,aaId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220", - "officialSlug": "agcapi-queryprojectlist-0000001111685220", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381", + "officialSlug": "client-rest-auth-userlink-0000001346909381", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/projects/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/projects/endpoints/queryprojectlist", + "href": "/api/v1/cloud-auth/endpoints/link-user", "method": "GET" } }, "affordances": { - "invoke": "agc projects queryprojectlist --invoke", - "show": "agc projects queryprojectlist --pretty" + "invoke": "agc cloud-auth link-user --invoke --body body.json", + "show": "agc cloud-auth link-user --pretty" } }, { - "id": "queryservice", - "familyId": "projects", - "name": "查询服务开通状态", - "description": "此接口用于查询项目、应用开通的服务信息列表以及API的状态。", - "method": "GET", - "path": "/api/cpms/project-service/v1/services/order-api", - "command": "agc projects queryservice", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "取消关联", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth unlink-user --docs --pretty" + }, + "id": "unlink-user", + "familyId": "cloud-auth", + "name": "取消关联", + "description": "此接口用于用户取消账号关联。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-unlink", + "command": "agc cloud-auth unlink-user", "requiredParams": [ - "projectId", - "appID" + "access_token", + "productId", + "provider" ], "parameters": [ { - "name": "projectId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "type": "string", + "name": "access_token", + "in": "header", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015", + "type": "string", + "name": "productId", "in": "query", "required": true, - "description": "Huawei project ID" + "description": "项目ID,查询方法可参见查询项目ID。" }, { - "name": "appID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", "in": "query", "required": true, - "description": "Huawei application ID; parameter name is case sensitive" + "description": "需要取消关联的provider认证方式。" } ], + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108", - "officialSlug": "agcapi-queryservice-0000001111845108", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000", + "officialSlug": "client-rest-auth-unlink-0000001294229000", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/projects/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/projects/endpoints/queryservice", + "href": "/api/v1/cloud-auth/endpoints/unlink-user", "method": "GET" } }, "affordances": { - "invoke": "agc projects queryservice --invoke", - "show": "agc projects queryservice --pretty" + "invoke": "agc cloud-auth unlink-user --invoke --body body.json", + "show": "agc cloud-auth unlink-user --pretty" } }, { - "id": "com-getreviewinfo", - "familyId": "comments", - "name": "查询单个评论详情", - "description": "获取单个评论详情。", - "method": "GET", - "path": "/api/reviews/v1/manage/dev/reviews/{reviewId}", - "command": "agc comments com-getreviewinfo", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "登出", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth sign-out --docs --pretty" + }, + "id": "sign-out", + "familyId": "cloud-auth", + "name": "登出", + "description": "此接口用于用户进行登出操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signout", + "command": "agc cloud-auth sign-out", "requiredParams": [ - "reviewId" + "productId", + "refreshToken", + "accessToken" ], "parameters": [ { - "name": "reviewId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section664965521111", + "type": "string", + "name": "productId", + "in": "query", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217", + "type": "string", + "name": "refreshToken", + "in": "body", + "required": true, + "description": "用于刷新accessToken。当accessToken过期后,需要使用refreshToken去获取新的accessToken。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217", + "type": "string", + "name": "accessToken", + "in": "body", "required": true, - "description": "reviewId parameter" + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" } ], + "body": "refreshToken,accessToken", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248", - "officialSlug": "agcapi-com-getreviewinfo-0000001116028248", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113", + "officialSlug": "client-rest-auth-signout-0000001346709113", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/comments/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/comments/endpoints/com-getreviewinfo", + "href": "/api/v1/cloud-auth/endpoints/sign-out", "method": "GET" } }, "affordances": { - "invoke": "agc comments com-getreviewinfo --invoke", - "show": "agc comments com-getreviewinfo --pretty" + "invoke": "agc cloud-auth sign-out --invoke --body body.json", + "show": "agc cloud-auth sign-out --pretty" } }, { - "id": "com-getreviewinfo-harmonyos", - "familyId": "comments", - "name": "查询单个评论详情", - "description": "开发者查询对应鸿蒙应用下的单个评论详情及评论下的回复列表。", - "method": "GET", - "path": "/api/marketing-api/v2/reviews/manage/dev/reviews/{reviewId}", - "command": "agc comments com-getreviewinfo-harmonyos", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "注销", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth delete-user --docs --pretty" + }, + "id": "delete-user", + "familyId": "cloud-auth", + "name": "注销", + "description": "此接口用于用户进行账号注销操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-delete", + "command": "agc cloud-auth delete-user", "requiredParams": [ - "reviewId" + "access_token", + "productId" ], "parameters": [ { - "name": "reviewId", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "type": "string", + "name": "access_token", + "in": "header", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section1636433517133", + "type": "string", + "name": "productId", + "in": "query", "required": true, - "description": "reviewId parameter" + "description": "项目ID,查询方法可参见查询项目ID。" } ], + "body": "json", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839", - "officialSlug": "agcapi-com-getreviewinfo-harmonyos-0000002504053839", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360", + "officialSlug": "client-rest-auth-userdelete-0000001294069360", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/comments/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/comments/endpoints/com-getreviewinfo-harmonyos", + "href": "/api/v1/cloud-auth/endpoints/delete-user", "method": "GET" } }, "affordances": { - "invoke": "agc comments com-getreviewinfo-harmonyos --invoke", - "show": "agc comments com-getreviewinfo-harmonyos --pretty" + "invoke": "agc cloud-auth delete-user --invoke --body body.json", + "show": "agc cloud-auth delete-user --pretty" } }, { - "id": "com-rating", - "familyId": "comments", - "name": "查询应用评分", - "description": "开发者查询对应应用下的评分列表及综合评分。", - "method": "GET", - "path": "/api/reviews/v1/manage/dev/ratings", - "command": "agc comments com-rating", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426", - "officialSlug": "agcapi-com-rating-0000001133889426", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/comments/endpoints", - "method": "GET" - }, - "self": { - "href": "/api/v1/comments/endpoints/com-rating", - "method": "GET" - } + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "账号重认证", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693", + "updatedAt": "2026-10-22 11:25", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc cloud-auth reauthenticate --docs --pretty" }, - "affordances": { - "invoke": "agc comments com-rating --invoke", - "show": "agc comments com-rating --pretty" - } - }, - { - "id": "com-rating-harmonyos", - "familyId": "comments", - "name": "查询应用评分列表", - "description": "开发者查询对应鸿蒙应用下的评分列表。", - "method": "GET", - "path": "/api/marketing-api/v2/reviews/manage/dev/ratings", - "command": "agc comments com-rating-harmonyos", + "id": "reauthenticate", + "familyId": "cloud-auth", + "name": "账号重认证", + "description": "此接口用于用户进行账号重认证操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-reauthenticate", + "command": "agc cloud-auth reauthenticate", "requiredParams": [ - "appId", - "beginTime", - "endTime", - "countries" + "access_token", + "productId", + "provider", + "token" ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", "type": "string", - "name": "appId", - "in": "query", - "required": true, - "description": "Huawei application ID" + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" }, { - "type": "integer", - "format": "int64", - "name": "beginTime", - "in": "query", - "required": true, - "description": "Start timestamp in milliseconds since Unix epoch; query interval must not exceed six months" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" }, { - "type": "integer", - "format": "int64", - "name": "endTime", - "in": "query", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "type": "string", + "name": "access_token", + "in": "header", "required": true, - "description": "End timestamp in milliseconds since Unix epoch; query interval must not exceed six months" + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section13279111311156", "type": "string", - "name": "countries", + "name": "productId", "in": "query", "required": true, - "description": "Comma-separated country codes, such as CN; all countries must belong to the same regional site" + "description": "项目ID,查询方法可参见查询项目ID。" }, { - "type": "string", - "name": "ratings", - "in": "query", - "required": false, - "description": "Comma-separated ratings from 1 to 5" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", + "in": "body", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", "type": "string", - "name": "appVersions", - "in": "query", - "required": false, - "description": "Comma-separated application versions" + "name": "token", + "in": "body", + "required": true, + "description": "手机号码或者邮箱账号。" }, { - "type": "integer", - "format": "int32", - "name": "sort", - "in": "query", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "type": "string", + "name": "extraData", + "in": "body", "required": false, - "description": "0: descending time (default); 1: descending score; 2: ascending score" + "description": "扩展字段,此处用于账号重认证时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "enum": [ + "0", + "1" + ], "type": "integer", - "format": "int32", - "name": "page", - "in": "query", + "name": "autoCreateUser", + "in": "body", "required": false, - "description": "Page number; defaults to 1" + "description": "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "enum": [ + "0", + "1" + ], "type": "integer", - "format": "int32", - "name": "limit", - "in": "query", + "name": "useJwt", + "in": "body", "required": false, - "description": "Page size; defaults to 50, maximum 100" - } - ], - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921", - "officialSlug": "agcapi-com-rating-harmonyos-0000002503933921", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/comments/endpoints", - "method": "GET" - }, - "self": { - "href": "/api/v1/comments/endpoints/com-rating-harmonyos", - "method": "GET" - } - }, - "affordances": { - "invoke": "agc comments com-rating-harmonyos --invoke", - "show": "agc comments com-rating-harmonyos --pretty" - } - }, - { - "id": "com-reviewreply", - "familyId": "comments", - "name": "回复评论和回复", - "description": "开发者在自己的应用下回复用户的评论,并继续回复用户的回复。", - "method": "POST", - "path": "/api/reviews/v1/manage/dev/reviews", - "command": "agc comments com-reviewreply", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117", - "officialSlug": "agcapi-com-reviewreply-0000001162548117", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/comments/endpoints", - "method": "GET" + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" }, - "self": { - "href": "/api/v1/comments/endpoints/com-reviewreply", - "method": "GET" - } - }, - "affordances": { - "invoke": "agc comments com-reviewreply --invoke --body body.json", - "show": "agc comments com-reviewreply --pretty" - } - }, - { - "id": "com-reviewreply-harmonyos", - "familyId": "comments", - "name": "回复评论和回复", - "description": "开发者在自己的鸿蒙应用下回复用户的评论,并支持继续回复用户的回复。", - "method": "POST", - "path": "/api/marketing-api/v2/", - "command": "agc comments com-reviewreply-harmonyos", - "body": "json", + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "type": "string", + "name": "channelId", + "in": "body", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "type": "string", + "name": "aaId", + "in": "body", + "required": false, + "description": "应用实例唯一编号。" + } + ], + "body": "provider,token,extraData,autoCreateUser,useJwt,channelId,aaId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974", - "officialSlug": "agcapi-com-reviewreply-harmonyos-0000002471053974", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693", + "officialSlug": "client-rest-auth-reauthenticate-0000001346828693", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/comments/endpoints", + "href": "/api/v1/cloud-auth/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/comments/endpoints/com-reviewreply-harmonyos", + "href": "/api/v1/cloud-auth/endpoints/reauthenticate", "method": "GET" } }, "affordances": { - "invoke": "agc comments com-reviewreply-harmonyos --invoke --body body.json", - "show": "agc comments com-reviewreply-harmonyos --pretty" + "invoke": "agc cloud-auth reauthenticate --invoke --body body.json", + "show": "agc cloud-auth reauthenticate --pretty" } }, { - "id": "comapi-getreviews", - "familyId": "comments", - "name": "查询评论列表", - "description": "开发者查询对应应用下的评论列表。", - "method": "GET", - "path": "/api/reviews/v1/manage/dev/reviews", - "command": "agc comments comapi-getreviews", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "body-client-credentials", + "requestContentType": "application/json", + "documentation": { + "title": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "updatedAt": "2026-10-22 11:41", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc clouddb client-token --docs --pretty" + }, + "id": "client-token", + "familyId": "clouddb", + "name": "获取Token", + "description": "在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。", + "method": "POST", + "path": "/agc/apigw/oauth2/v1/token", + "command": "agc clouddb client-token", + "requiredParams": [ + "useJwt", + "grant_type", + "client_id", + "client_secret" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "useJwt", + "in": "body", + "required": true, + "description": "使用账号凭据JWT(Json Web Token),固定传入“1”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "enum": [ + "client_credentials" + ], + "type": "string", + "name": "grant_type", + "in": "body", + "required": true, + "description": "固定传入“client_credentials”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "type": "string", + "name": "client_id", + "in": "body", + "required": true, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "type": "string", + "name": "client_secret", + "in": "body", + "required": true, + "description": "客户端密钥,即获取客户端API授权中的“Client Secret”。" + } + ], + "body": "useJwt,grant_type,client_id,client_secret", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139", - "officialSlug": "agcapi-comapi-getreviews-0000001162468139", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "officialSlug": "clouddb-obtaintoken-rest-0000001446607602", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/comments/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/comments/endpoints/comapi-getreviews", + "href": "/api/v1/clouddb/endpoints/client-token", "method": "GET" } }, "affordances": { - "invoke": "agc comments comapi-getreviews --invoke", - "show": "agc comments comapi-getreviews --pretty" + "invoke": "agc clouddb client-token --invoke --body body.json", + "show": "agc clouddb client-token --pretty" } }, { - "id": "comapi-getreviews-harmonyos", - "familyId": "comments", - "name": "查询应用评论列表", - "description": "开发者查询对应鸿蒙应用下的评论列表。", - "method": "GET", - "path": "/api/marketing-api/v2/reviews/manage/dev/reviews", - "command": "agc comments comapi-getreviews-harmonyos", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "updatedAt": "2026-10-22 11:41", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc clouddb sign-in --docs --pretty" + }, + "id": "sign-in", + "familyId": "clouddb", + "name": "用户登录", + "description": "该接口用于用户使用账号密码登录。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signin", + "command": "agc clouddb sign-in", "requiredParams": [ - "appId", - "beginTime", - "endTime", - "countries" + "productId", + "provider", + "token", + "useJwt" ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577", "type": "string", - "name": "appId", - "in": "query", - "required": true, - "description": "Huawei application ID" + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" }, { - "type": "integer", - "format": "int64", - "name": "beginTime", - "in": "query", - "required": true, - "description": "Start timestamp in milliseconds since Unix epoch; query interval must not exceed six months" + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息。格式为“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" }, { - "type": "integer", - "format": "int64", - "name": "endTime", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section8252421578", + "type": "string", + "name": "productId", "in": "query", "required": true, - "description": "End timestamp in milliseconds since Unix epoch; query interval must not exceed six months" + "description": "项目ID,查询方法可参见查询项目ID。" }, { - "type": "string", - "name": "countries", - "in": "query", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ], + "type": "integer", + "name": "provider", + "in": "body", "required": true, - "description": "Comma-separated country codes, such as CN; all countries must belong to the same regional site" + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", "type": "string", - "name": "ratings", - "in": "query", - "required": false, - "description": "Comma-separated ratings from 1 to 5" + "name": "token", + "in": "body", + "required": true, + "description": "手机号码或者邮箱账号。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", "type": "string", - "name": "appVersions", - "in": "query", - "required": false, - "description": "Comma-separated application versions" - }, - { - "type": "integer", - "format": "int32", - "name": "sort", - "in": "query", + "name": "extraData", + "in": "body", "required": false, - "description": "0: descending time (default); 1: descending score; 2: ascending score" + "description": "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "enum": [ + "0", + "1" + ], "type": "integer", - "format": "int32", - "name": "page", - "in": "query", + "name": "autoCreateUser", + "in": "body", "required": false, - "description": "Page number; defaults to 1" + "description": "是否自动创建用户,仅用于非托管账号。 0:不自动创建用户。 1:默认值,自动创建用户。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "enum": [ + "0", + "1" + ], "type": "integer", - "format": "int32", - "name": "limit", - "in": "query", - "required": false, - "description": "Page size; defaults to 20, maximum 100" - }, - { - "type": "string", - "name": "content", - "in": "query", - "required": false, - "description": "Comment content keyword" + "name": "useJwt", + "in": "body", + "required": true, + "description": "使用账号凭据JWT(Json Web Token),固定传入“1”。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", "type": "string", - "name": "devReplyStates", - "in": "query", + "name": "channelId", + "in": "body", "required": false, - "description": "Comma-separated developer reply states: 0, 1, 6, 3" + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" }, { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", "type": "string", - "name": "langs", - "in": "query", + "name": "aaId", + "in": "body", "required": false, - "description": "Comma-separated ISO 639-1 language codes" + "description": "应用实例唯一编号。" } ], + "body": "provider,token,extraData,autoCreateUser,useJwt,channelId,aaId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976", - "officialSlug": "agcapi-comapi-getreviews-harmonyos-0000002470893976", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "officialSlug": "clouddb-signin-rest-0000001496447669", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/comments/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/comments/endpoints/comapi-getreviews-harmonyos", + "href": "/api/v1/clouddb/endpoints/sign-in", "method": "GET" } }, "affordances": { - "invoke": "agc comments comapi-getreviews-harmonyos --invoke", - "show": "agc comments comapi-getreviews-harmonyos --pretty" + "invoke": "agc clouddb sign-in --invoke --body body.json", + "show": "agc clouddb sign-in --pretty" } }, { - "id": "addproduct-android", - "familyId": "pms", - "name": "创建商品", - "description": "此接口用于创建商品定义信息,包含商品价格,展示语言等。", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "updatedAt": "2026-10-22 11:41", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc clouddb query-data --docs --pretty" + }, + "id": "query-data", + "familyId": "clouddb", + "name": "查询数据", + "description": "该接口用于用户查询数据,云数据库提供了丰富的谓词查询,比如equalTo、notEqualTo、in等,通过单个或者多个链式过滤条件,您可以从云侧数据库查询到满足特定条件的对象,也可以通过限定查询返回数量谓词限定查询结果返回的数量,还可以支持聚合查询,例如查询平均值、最大值、最小值等。", "method": "POST", - "path": "/api/pms/product-price-service/v1/manage/product", - "command": "agc pms addproduct-android", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001", - "officialSlug": "agcapi-addproduct-android-0000002171407001", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/pms/endpoints", - "method": "GET" + "path": "/agc/apigw/clouddb/clouddbservice/sync/query", + "command": "agc clouddb query-data", + "requiredParams": [ + "productId", + "_v", + "msgInfo", + "clientInfo", + "queryReqMsg" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。" }, - "self": { - "href": "/api/v1/pms/endpoints/addproduct-android", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息。格式为“Authorization: Bearer ${client_token}”。 client_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "type": "string", + "name": "access_token", + "in": "header", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section88414213129", + "enum": [ + "4" + ], + "type": "integer", + "name": "_v", + "in": "query", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "enum": [ + "5" + ], + "type": "integer", + "name": "type", + "in": "body", + "required": true, + "description": "查询请求。入参需为“5”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。" + }, + { + "properties": [ + { + "type": "string", + "name": "storeName", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "type": "object", + "name": "opStore", + "in": "body", + "required": true, + "description": "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "type": "object", + "name": "msgInfo", + "in": "body", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section448214662111", + "type": "integer", + "name": "appVer", + "in": "body", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "type": "object", + "name": "clientInfo", + "in": "body", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5" + ], + "type": "integer", + "name": "queryType", + "in": "body", + "required": true, + "description": "查询类型。涉及到的查询值类型如下: 0:默认值,普通查询。 1:AVG、Average,平均值查询。 2:SUM,总和查询。 3:MAX,最大值查询。 4:MIN,最小值查询。 5:COUNT,计数查询。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "type": "string", + "name": "queryTable", + "in": "body", + "required": true, + "description": "查询的对象类型名称。" + }, + { + "encodedJson": { + "properties": [ + { + "itemsProperties": [ + { + "type": "string", + "name": "conditionType", + "in": "body", + "required": true + }, + { + "type": "string", + "name": "fieldName", + "in": "body", + "required": false + }, + { + "name": "value", + "in": "body", + "required": false + } + ], + "itemsType": "object", + "type": "array", + "name": "queryConditions", + "in": "body", + "required": true + } + ], + "type": "object", + "name": "", + "in": "", + "required": false + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "type": "string", + "name": "queryCond", + "in": "body", + "required": true, + "description": "查询条件。Json格式的字符串,例如:\"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"3\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\" 说明 当queryType不为0时,queryCond的conditionType参数必须设置为与queryType取值一致的查询条件,否则会导致接口返回错误。 例如:queryType取值为2时,conditionType必须设置为SUM。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "type": "object", + "name": "queryReqMsg", + "in": "body", + "required": true, + "description": "查询请求的基本信息,具体请参见QueryRequestMessage。" } - }, - "affordances": { - "invoke": "agc pms addproduct-android --invoke --body body.json", - "show": "agc pms addproduct-android --pretty" - } - }, - { - "id": "addproduct-harmonyosnext", - "familyId": "pms", - "name": "创建商品", - "description": "此接口用于创建商品定义信息,包含商品价格,展示语言等。", - "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product", - "command": "agc pms addproduct-harmonyosnext", - "body": "json", + ], + "body": "msgInfo,clientInfo,queryReqMsg", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844", - "officialSlug": "agcapi-addproduct-harmonyosnext-0000002131508844", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "officialSlug": "clouddb-query-data-rest-0000001496647573", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/addproduct-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/query-data", "method": "GET" } }, "affordances": { - "invoke": "agc pms addproduct-harmonyosnext --invoke --body body.json", - "show": "agc pms addproduct-harmonyosnext --pretty" + "invoke": "agc clouddb query-data --invoke --body body.json", + "show": "agc clouddb query-data --pretty" } }, { - "id": "addproductgroup-android", - "familyId": "pms", - "name": "创建商品订阅分组信息", - "description": "此接口用于创建商品订阅分组信息。", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "updatedAt": "2026-10-22 11:41", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc clouddb update-data --docs --pretty" + }, + "id": "update-data", + "familyId": "clouddb", + "name": "更新数据", + "description": "该接口用于用户更新数据,支持数据的新增和更新。更新数据时,如果在CloudDBZone已经存在主键值相同的对象,则更新已有的对象;如果不存在,则写入一个新的对象。更新操作需要设置naturalbase_deleted字段为false,具体请参见SchemaField字段设置。", "method": "POST", - "path": "/api/pms/product-price-service/v1/manage/product/group", - "command": "agc pms addproductgroup-android", - "body": "json", + "path": "/agc/apigw/clouddb/clouddbservice/sync/upsert", + "command": "agc clouddb update-data", + "requiredParams": [ + "productId", + "_v", + "msgInfo", + "clientInfo", + "schemas", + "opData" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "type": "string", + "name": "access_token", + "in": "header", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1475695062212", + "enum": [ + "4" + ], + "type": "integer", + "name": "_v", + "in": "query", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "enum": [ + "3" + ], + "type": "integer", + "name": "type", + "in": "body", + "required": true, + "description": "更新请求,入参需为“3”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。" + }, + { + "properties": [ + { + "type": "string", + "name": "storeName", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "type": "object", + "name": "opStore", + "in": "body", + "required": true, + "description": "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "type": "object", + "name": "msgInfo", + "in": "body", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section10559951122313", + "type": "integer", + "name": "appVer", + "in": "body", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "type": "object", + "name": "clientInfo", + "in": "body", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "type": "string", + "name": "n", + "in": "body", + "required": true, + "description": "对象类型名称。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "type": "string", + "name": "n", + "in": "body", + "required": true, + "description": "字段名。更新操作时必须有如下两个字段,并遵循如下约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 布尔类型的naturalbase_deleted字段:需设置为固定值“false”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "type": "string", + "name": "t", + "in": "body", + "required": true, + "description": "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "itemsType": "object", + "type": "array", + "name": "fs", + "in": "body", + "required": true, + "description": "字段名称。更新字段时,该字段必须属于同一个对象类型,否则会导致更新失败。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "itemsType": "object", + "type": "array", + "name": "schemas", + "in": "body", + "required": true, + "description": "表对象信息,具体请参见Schema。" + }, + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "boolean", + "name": "n", + "in": "body", + "required": false, + "description": "是否设置为null" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "boolean", + "name": "bl", + "in": "body", + "required": false, + "description": "boolean类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "integer", + "name": "b", + "in": "body", + "required": false, + "description": "byte类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "integer", + "name": "st", + "in": "body", + "required": false, + "description": "short类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "integer", + "name": "i", + "in": "body", + "required": false, + "description": "int类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "integer", + "name": "l", + "in": "body", + "required": false, + "description": "long类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "number", + "name": "f", + "in": "body", + "required": false, + "description": "float类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "number", + "name": "d", + "in": "body", + "required": false, + "description": "double类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "name": "ba", + "in": "body", + "required": false, + "description": "byteArray类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "type": "string", + "name": "s", + "in": "body", + "required": false, + "description": "String类型值" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section101441056257", + "itemsType": "object", + "type": "array", + "name": "fs", + "in": "body", + "required": true, + "description": "单条对象信息。 说明 更新操作包含naturalbase_deleted的字段固定设置值为false。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "maxItems": 1, + "itemsType": "object", + "type": "array", + "name": "os", + "in": "body", + "required": true, + "description": "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "enum": [ + "1" + ], + "type": "integer", + "name": "t", + "in": "body", + "required": true, + "description": "更新操作类型,入参为“1”。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "itemsType": "object", + "type": "array", + "name": "opData", + "in": "body", + "required": true, + "description": "更新数据对象信息,具体请参见OperatorData。" + } + ], + "body": "msgInfo,clientInfo,schemas,opData", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308", - "officialSlug": "agcapi-addproductgroup-android-0000002135929308", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "officialSlug": "clouddb-update-data-rest-0000001446287706", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/addproductgroup-android", + "href": "/api/v1/clouddb/endpoints/update-data", "method": "GET" } }, "affordances": { - "invoke": "agc pms addproductgroup-android --invoke --body body.json", - "show": "agc pms addproductgroup-android --pretty" + "invoke": "agc clouddb update-data --invoke --body body.json", + "show": "agc clouddb update-data --pretty" } }, { - "id": "addproductgroup-harmonyosnext", - "familyId": "pms", - "name": "创建商品订阅分组信息", - "description": "此接口用于创建商品订阅分组信息。", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "documentation": { + "title": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "updatedAt": "2026-10-22 11:41", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc clouddb delete-data --docs --pretty" + }, + "id": "delete-data", + "familyId": "clouddb", + "name": "删除数据", + "description": "该接口用于用户删除数据,根据您传入对象主键删除相应的数据,不会比对该对象其他属性与存储的数据是否一致,删除操作需要设置naturalbase_deleted字段为true,具体请参见SchemaField字段设置。", "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product/group", - "command": "agc pms addproductgroup-harmonyosnext", - "body": "json", + "path": "/agc/apigw/clouddb/clouddbservice/sync/upsert", + "command": "agc clouddb delete-data", + "requiredParams": [ + "productId", + "_v", + "msgInfo", + "clientInfo", + "schemas", + "opData" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "type": "string", + "name": "access_token", + "in": "header", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1664165216352", + "enum": [ + "4" + ], + "type": "integer", + "name": "_v", + "in": "query", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "enum": [ + "3" + ], + "type": "integer", + "name": "type", + "in": "body", + "required": true + }, + { + "properties": [ + { + "type": "string", + "name": "storeName", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "type": "object", + "name": "opStore", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "type": "object", + "name": "msgInfo", + "in": "body", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section177593293713", + "type": "integer", + "name": "appVer", + "in": "body", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "type": "object", + "name": "clientInfo", + "in": "body", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "type": "string", + "name": "n", + "in": "body", + "required": true, + "description": "对象类型名称。" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "type": "string", + "name": "n", + "in": "body", + "required": true, + "description": "字段名。删除操作时必须有如下两个字段,并遵循相关约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 boolean类型的naturalbase_deleted字段:需设置为固定值“true”。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "type": "string", + "name": "t", + "in": "body", + "required": true, + "description": "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "itemsType": "object", + "type": "array", + "name": "fs", + "in": "body", + "required": true, + "description": "字段名称。删除字段时,该对象必须属于同一个对象类型,且只能传入一个SchemaField。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "itemsType": "object", + "type": "array", + "name": "schemas", + "in": "body", + "required": true, + "description": "对象类型信息。" + }, + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "boolean", + "name": "n", + "in": "body", + "required": false, + "description": "是否设置为null" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "boolean", + "name": "bl", + "in": "body", + "required": false, + "description": "boolean类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "integer", + "name": "b", + "in": "body", + "required": false, + "description": "byte类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "integer", + "name": "st", + "in": "body", + "required": false, + "description": "short类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "integer", + "name": "i", + "in": "body", + "required": false, + "description": "int类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "integer", + "name": "l", + "in": "body", + "required": false, + "description": "long类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "number", + "name": "f", + "in": "body", + "required": false, + "description": "float类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "number", + "name": "d", + "in": "body", + "required": false, + "description": "double类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "name": "ba", + "in": "body", + "required": false, + "description": "byteArray类型值" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "type": "string", + "name": "s", + "in": "body", + "required": false, + "description": "String类型值" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section156861057163820", + "itemsType": "object", + "type": "array", + "name": "fs", + "in": "body", + "required": true, + "description": "单条对象信息。 说明 删除操作中包含主键、naturalbase_deleted的字段固定设置值为true。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "maxItems": 1, + "itemsType": "object", + "type": "array", + "name": "os", + "in": "body", + "required": true, + "description": "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "enum": [ + "1" + ], + "type": "integer", + "name": "t", + "in": "body", + "required": true, + "description": "删除操作类型,入参为“1”。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "itemsType": "object", + "type": "array", + "name": "opData", + "in": "body", + "required": true, + "description": "更新数据的对象信息。" + } + ], + "body": "msgInfo,clientInfo,schemas,opData", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", - "officialSlug": "agcapi-addproductgroup-harmonyosnext-0000002166748605", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "officialSlug": "clouddb-delete-data-rest-0000001449956714", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/addproductgroup-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/delete-data", "method": "GET" } }, "affordances": { - "invoke": "agc pms addproductgroup-harmonyosnext --invoke --body body.json", - "show": "agc pms addproductgroup-harmonyosnext --pretty" + "invoke": "agc clouddb delete-data --invoke --body body.json", + "show": "agc clouddb delete-data --pretty" } }, { - "id": "addpromotion-android", - "familyId": "pms", - "name": "创建商品促销信息", - "description": "此接口用于创建商品促销信息。", - "method": "POST", - "path": "/api/pms/product-price-service/v1/manage/product/promotion", - "command": "agc pms addpromotion-android", - "body": "json", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "schema-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb schema-versions --docs --pretty" + }, + "id": "schema-versions", + "familyId": "clouddb", + "name": "schema-versions", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/agc/edge/clouddb/clouddbservice/v1/schemaVersion", + "command": "agc clouddb schema-versions", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021", - "officialSlug": "agcapi-addpromotion-android-0000002171407021", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-schema-versions", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/addpromotion-android", + "href": "/api/v1/clouddb/endpoints/schema-versions", "method": "GET" } }, "affordances": { - "invoke": "agc pms addpromotion-android --invoke --body body.json", - "show": "agc pms addpromotion-android --pretty" + "docs": "agc clouddb schema-versions --docs --pretty", + "invoke": "agc clouddb schema-versions --invoke --session-file SESSION.json", + "show": "agc clouddb schema-versions --pretty" } }, { - "id": "addpromotion-harmonyosnext", - "familyId": "pms", - "name": "创建商品促销信息", - "description": "此接口用于创建商品促销信息。", - "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product/promotion", - "command": "agc pms addpromotion-harmonyosnext", - "body": "json", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "get-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb get-object-type --docs --pretty" + }, + "id": "get-object-type", + "familyId": "clouddb", + "name": "get-object-type", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb get-object-type", + "requiredParams": [ + "schemaVersion", + "objectTypeName" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "integer", + "name": "schemaVersion", + "in": "query", + "required": true + }, + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "objectTypeName", + "in": "query", + "required": true + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856", - "officialSlug": "agcapi-addpromotion-harmonyosnext-0000002131508856", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-get-object-type", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/addpromotion-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/get-object-type", "method": "GET" } }, "affordances": { - "invoke": "agc pms addpromotion-harmonyosnext --invoke --body body.json", - "show": "agc pms addpromotion-harmonyosnext --pretty" + "docs": "agc clouddb get-object-type --docs --pretty", + "invoke": "agc clouddb get-object-type --invoke --session-file SESSION.json", + "show": "agc clouddb get-object-type --pretty" } }, { - "id": "basicapplication-harmonyosnext", - "familyId": "pms", - "name": "查询关联APP已有商品类型", - "description": "此接口用于查询关联APP已有商品类型。", - "method": "GET", - "path": "/api/pms/product-price-service/v2/manage/application/basic", - "command": "agc pms basicapplication-harmonyosnext", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "create-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb create-object-type --docs --pretty" + }, + "id": "create-object-type", + "familyId": "clouddb", + "name": "create-object-type", + "description": "Reviewed native management transport; explicit user session required. Creation is asynchronous; query process-status and independently read back schema before reporting completion.", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb create-object-type", + "requiredParams": [ + "objectType" + ], + "parameters": [ + { + "properties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "objectTypeName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ], + "type": "string", + "name": "fieldType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "belongPrimaryKey", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "notNull", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isNeedEncrypt", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isSensitive", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "defaultValue", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "fields", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "indexName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ], + "type": "string", + "name": "sortType", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "maxItems": 5, + "itemsType": "object", + "type": "array", + "name": "indexList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxItems": 16, + "itemsType": "object", + "type": "array", + "name": "indexes", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ], + "type": "string", + "name": "role", + "in": "body", + "required": true + }, + { + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "type": "array", + "name": "rights", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "permissions", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "objectType", + "in": "body", + "required": true + } + ], + "body": "objectType", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928", - "officialSlug": "agcapi-basicapplication-harmonyosnext-0000002131519928", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-object-type", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/basicapplication-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/create-object-type", "method": "GET" } }, "affordances": { - "invoke": "agc pms basicapplication-harmonyosnext --invoke", - "show": "agc pms basicapplication-harmonyosnext --pretty" + "docs": "agc clouddb create-object-type --docs --pretty", + "invoke": "agc clouddb create-object-type --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb create-object-type --pretty" } }, { - "id": "batchactproduct-android", - "familyId": "pms", - "name": "批量激活商品", - "description": "此接口用于批量激活商品。", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "update-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb update-object-type --docs --pretty" + }, + "id": "update-object-type", + "familyId": "clouddb", + "name": "update-object-type", + "description": "Reviewed native management transport; explicit user session required. originObjectType must be the exact prior definition; this is not a patch or a migration of existing data.", "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product/batchActive", - "command": "agc pms batchactproduct-android", - "body": "json", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb update-object-type", + "requiredParams": [ + "objectType", + "originObjectType" + ], + "parameters": [ + { + "properties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "objectTypeName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ], + "type": "string", + "name": "fieldType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "belongPrimaryKey", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "notNull", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isNeedEncrypt", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isSensitive", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "defaultValue", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "fields", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "indexName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ], + "type": "string", + "name": "sortType", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "maxItems": 5, + "itemsType": "object", + "type": "array", + "name": "indexList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxItems": 16, + "itemsType": "object", + "type": "array", + "name": "indexes", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ], + "type": "string", + "name": "role", + "in": "body", + "required": true + }, + { + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "type": "array", + "name": "rights", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "permissions", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "objectType", + "in": "body", + "required": true + }, + { + "properties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "objectTypeName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ], + "type": "string", + "name": "fieldType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "belongPrimaryKey", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "notNull", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isNeedEncrypt", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isSensitive", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "defaultValue", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "fields", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "indexName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ], + "type": "string", + "name": "sortType", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "maxItems": 5, + "itemsType": "object", + "type": "array", + "name": "indexList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxItems": 16, + "itemsType": "object", + "type": "array", + "name": "indexes", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ], + "type": "string", + "name": "role", + "in": "body", + "required": true + }, + { + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "type": "array", + "name": "rights", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "permissions", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "originObjectType", + "in": "body", + "required": true + } + ], + "body": "objectType,originObjectType", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617", - "officialSlug": "agcapi-batchactproduct-android-0000002171288617", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-update-object-type", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchactproduct-android", + "href": "/api/v1/clouddb/endpoints/update-object-type", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchactproduct-android --invoke --body body.json", - "show": "agc pms batchactproduct-android --pretty" + "docs": "agc clouddb update-object-type --docs --pretty", + "invoke": "agc clouddb update-object-type --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb update-object-type --pretty" } }, { - "id": "batchactproduct-harmonyosnext", - "familyId": "pms", - "name": "批量激活商品", - "description": "此接口用于批量激活商品 , 生效已下线商品,已结束的促销不会重新生效 。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/batchActive", - "command": "agc pms batchactproduct-harmonyosnext", - "body": "json", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "delete-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb delete-object-type --docs --pretty" + }, + "id": "delete-object-type", + "familyId": "clouddb", + "name": "delete-object-type", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb delete-object-type", + "requiredParams": [ + "objectTypeName" + ], + "parameters": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "objectTypeName", + "in": "body", + "required": true + } + ], + "body": "objectTypeName", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712", - "officialSlug": "agcapi-batchactproduct-harmonyosnext-0000002131350712", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-delete-object-type", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchactproduct-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/delete-object-type", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchactproduct-harmonyosnext --invoke --body body.json", - "show": "agc pms batchactproduct-harmonyosnext --pretty" + "docs": "agc clouddb delete-object-type --docs --pretty", + "invoke": "agc clouddb delete-object-type --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb delete-object-type --pretty" } }, { - "id": "batchactpromotion-android", - "familyId": "pms", - "name": "批量上线商品促销活动", - "description": "此接口用于批量上线商品促销活动。", - "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product/promotion/batchActive", - "command": "agc pms batchactpromotion-android", - "body": "json", + "authentication": "agcli-management-cookie", + "requestContentType": "application/x-www-form-urlencoded", + "documentation": { + "title": "import-object-types", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb import-object-types --docs --pretty" + }, + "id": "import-object-types", + "familyId": "clouddb", + "name": "import-object-types", + "description": "Reviewed native management transport; explicit user session required. Raw JSON document, not a JSON string wrapper; only new object types may be imported; local size limit 20MB.", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/importObjectType", + "command": "agc clouddb import-object-types", + "requiredParams": [ + "schemaVersion", + "objectTypes" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "integer", + "name": "schemaVersion", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "objectTypeName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 30, + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ], + "type": "string", + "name": "fieldType", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "belongPrimaryKey", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "notNull", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isNeedEncrypt", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "isSensitive", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "defaultValue", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "fields", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "indexName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "fieldName", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ], + "type": "string", + "name": "sortType", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "maxItems": 5, + "itemsType": "object", + "type": "array", + "name": "indexList", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxItems": 16, + "itemsType": "object", + "type": "array", + "name": "indexes", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "objectTypes", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "objectTypeName", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ], + "type": "string", + "name": "role", + "in": "body", + "required": true + }, + { + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "type": "array", + "name": "rights", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "permissions", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "permissions", + "in": "body", + "required": false + } + ], + "body": "schemaVersion,objectTypes,permissions", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025", - "officialSlug": "agcapi-batchactpromotion-android-0000002171407025", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-import-object-types", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchactpromotion-android", + "href": "/api/v1/clouddb/endpoints/import-object-types", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchactpromotion-android --invoke --body body.json", - "show": "agc pms batchactpromotion-android --pretty" + "docs": "agc clouddb import-object-types --docs --pretty", + "formInput": "Supply raw schema JSON with --body. The reviewed vendor uses raw JSON bytes with a form Content-Type; no form encoding is performed.", + "invoke": "agc clouddb import-object-types --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb import-object-types --pretty" } }, { - "id": "batchactpromotion-harmonyosnext", - "familyId": "pms", - "name": "批量上线商品促销活动", - "description": "此接口用于批量上线商品促销活动。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/promotion/batchActive", - "command": "agc pms batchactpromotion-harmonyosnext", - "body": "json", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "export-object-types", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb export-object-types --docs --pretty" + }, + "id": "export-object-types", + "familyId": "clouddb", + "name": "export-object-types", + "description": "Reviewed native management transport; explicit user session required. Non-JSON formats return source-encoded Base64; no local extraction or execution.", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/exportObjectType", + "command": "agc clouddb export-object-types", + "requiredParams": [ + "schemaVersion", + "type" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "integer", + "name": "schemaVersion", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "json", + "js", + "java", + "objective-c" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "jsFileType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "javaFileType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 1024, + "type": "string", + "name": "packageName", + "in": "body", + "required": false + } + ], + "body": "schemaVersion,type,jsFileType,javaFileType,packageName", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860", - "officialSlug": "agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-export-object-types", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchactpromotion-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/export-object-types", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchactpromotion-harmonyosnext --invoke --body body.json", - "show": "agc pms batchactpromotion-harmonyosnext --pretty" + "docs": "agc clouddb export-object-types --docs --pretty", + "invoke": "agc clouddb export-object-types --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb export-object-types --pretty" } }, { - "id": "batchaddproduct-android", - "familyId": "pms", - "name": "批量创建商品", - "description": "此接口用于批量创建商品定义信息,展示语言,商品价格,促销活动信息。", - "method": "POST", - "path": "/api/pms/product-price-service/v1/manage/product/batchImportProducts", - "command": "agc pms batchaddproduct-android", - "body": "json", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "list-zones", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb list-zones --docs --pretty" + }, + "id": "list-zones", + "familyId": "clouddb", + "name": "list-zones", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/agc/edge/clouddb/clouddbservice/v1/naturalStore", + "command": "agc clouddb list-zones", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605", - "officialSlug": "agcapi-batchaddproduct-android-0000002171288605", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-list-zones", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchaddproduct-android", + "href": "/api/v1/clouddb/endpoints/list-zones", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchaddproduct-android --invoke --body body.json", - "show": "agc pms batchaddproduct-android --pretty" + "docs": "agc clouddb list-zones --docs --pretty", + "invoke": "agc clouddb list-zones --invoke --session-file SESSION.json", + "show": "agc clouddb list-zones --pretty" } }, { - "id": "batchaddproduct-harmonyosnext", - "familyId": "pms", - "name": "批量创建商品", - "description": "此接口用于批量创建商品定义信息,展示语言,商品价格,促销活动信息。", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "create-zone", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb create-zone --docs --pretty" + }, + "id": "create-zone", + "familyId": "clouddb", + "name": "create-zone", + "description": "Reviewed native management transport; explicit user session required. ", "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product/batchImportProducts", - "command": "agc pms batchaddproduct-harmonyosnext", - "body": "json", + "path": "/agc/edge/clouddb/clouddbservice/v1/naturalStore", + "command": "agc clouddb create-zone", + "requiredParams": [ + "cloudDBZoneName" + ], + "parameters": [ + { + "pattern": "^[A-Za-z][A-Za-z0-9]{0,19}$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 20, + "type": "string", + "name": "cloudDBZoneName", + "in": "body", + "required": true + } + ], + "body": "cloudDBZoneName", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704", - "officialSlug": "agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-zone", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchaddproduct-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/create-zone", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchaddproduct-harmonyosnext --invoke --body body.json", - "show": "agc pms batchaddproduct-harmonyosnext --pretty" + "docs": "agc clouddb create-zone --docs --pretty", + "invoke": "agc clouddb create-zone --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb create-zone --pretty" } }, { - "id": "batchdeactproduct-android", - "familyId": "pms", - "name": "批量去激活商品", - "description": "此接口用于批量去激活商品。", - "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product/batchDeactive", - "command": "agc pms batchdeactproduct-android", - "body": "json", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "delete-zone", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb delete-zone --docs --pretty" + }, + "id": "delete-zone", + "familyId": "clouddb", + "name": "delete-zone", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/agc/edge/clouddb/clouddbservice/v1/naturalStore", + "command": "agc clouddb delete-zone", + "requiredParams": [ + "cloudDBZoneName" + ], + "parameters": [ + { + "pattern": "^[A-Za-z][A-Za-z0-9]{0,19}$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 20, + "type": "string", + "name": "cloudDBZoneName", + "in": "body", + "required": true + } + ], + "body": "cloudDBZoneName", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320", - "officialSlug": "agcapi-batchdeactproduct-android-0000002135929320", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-delete-zone", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchdeactproduct-android", + "href": "/api/v1/clouddb/endpoints/delete-zone", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchdeactproduct-android --invoke --body body.json", - "show": "agc pms batchdeactproduct-android --pretty" + "docs": "agc clouddb delete-zone --docs --pretty", + "invoke": "agc clouddb delete-zone --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb delete-zone --pretty" } }, { - "id": "batchdeactproduct-harmonyosnext", - "familyId": "pms", - "name": "批量去激活商品", - "description": "此接口用于批量去激活商品 ,下线已生效商品,结束促销活动 。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/batchDeactive", - "command": "agc pms batchdeactproduct-harmonyosnext", - "body": "json", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "process-status", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb process-status --docs --pretty" + }, + "id": "process-status", + "familyId": "clouddb", + "name": "process-status", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/processPercentage", + "command": "agc clouddb process-status", + "requiredParams": [ + "processId" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "processId", + "in": "body", + "required": true + } + ], + "body": "processId", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613", - "officialSlug": "agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-process-status", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/clouddb/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchdeactproduct-harmonyosnext", + "href": "/api/v1/clouddb/endpoints/process-status", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchdeactproduct-harmonyosnext --invoke --body body.json", - "show": "agc pms batchdeactproduct-harmonyosnext --pretty" + "docs": "agc clouddb process-status --docs --pretty", + "invoke": "agc clouddb process-status --invoke --session-file SESSION.json --body body.json", + "show": "agc clouddb process-status --pretty" } }, { - "id": "batchdeactpromotion-android", - "familyId": "pms", - "name": "批量下线商品促销活动", - "description": "此接口用于批量下线商品促销活动。", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "documentation": { + "title": "上传文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "updatedAt": "2026-10-22 14:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc storage upload-file --docs --pretty" + }, + "id": "upload-file", + "familyId": "storage", + "name": "上传文件", + "description": "此接口用于上传文件。", "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product/promotion/batchDeactive", - "command": "agc pms batchdeactpromotion-android", - "body": "json", + "path": "/{bucket_name}/{object_name}", + "command": "agc storage upload-file", + "requiredParams": [ + "object_name", + "bucket_name", + "productId", + "file" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "type": "string", + "name": "object_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "type": "string", + "name": "bucket_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-File-Size", + "in": "header", + "required": false, + "description": "文件大小,断点续传时为必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-File-Offset", + "in": "header", + "required": false, + "description": "文件偏移量,断点续传的起始位置非零时为必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-Sha256", + "in": "header", + "required": false, + "description": "文件的SHA256值,断点续传时为必选。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Type", + "in": "header", + "required": false, + "description": "文件类型。 默认值:application/octet-stream" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Disposition", + "in": "header", + "required": false, + "description": "文件打开方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Encoding", + "in": "header", + "required": false, + "description": "HTTP标准头部Content-Encoding。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-Cache-Control", + "in": "header", + "required": false, + "description": "HTTP标准头部Cache-Control。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Language", + "in": "header", + "required": false, + "description": "HTTP标准头部Content-Language。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-meta-*", + "in": "header", + "required": false, + "description": "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头部出现。 X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。例如,您传入的是“X-Agc-meta-test: test metadata”,保存的数据实例为“test: test metadata”。 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "type": "string", + "name": "X-Agc-Trace-Id", + "in": "header", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "type": "string", + "name": "file", + "in": "file", + "required": true + } + ], + "body": "file", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629", - "officialSlug": "agcapi-batchdeactpromotion-android-0000002171288629", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "officialSlug": "storage-restapi-uploadfile-0000001549318457", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/storage/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchdeactpromotion-android", + "href": "/api/v1/storage/endpoints/upload-file", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchdeactpromotion-android --invoke --body body.json", - "show": "agc pms batchdeactpromotion-android --pretty" + "invoke": "agc storage upload-file --invoke --body body.json", + "show": "agc storage upload-file --pretty" } }, { - "id": "batchdeactpromotion-harmonyosnext", - "familyId": "pms", - "name": "批量下线商品促销活动", - "description": "此接口用于批量下线商品促销活动。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/promotion/batchDeactive", - "command": "agc pms batchdeactpromotion-harmonyosnext", - "body": "json", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "documentation": { + "title": "下载文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "updatedAt": "2026-10-22 14:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc storage download-file --docs --pretty" + }, + "id": "download-file", + "familyId": "storage", + "name": "下载文件", + "description": "此接口用于使用用户身份认证方式下载文件。", + "method": "GET", + "path": "/{bucket_name}/{object_name}", + "command": "agc storage download-file", + "requiredParams": [ + "object_name", + "bucket_name", + "productId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "type": "string", + "name": "object_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "type": "string", + "name": "bucket_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "type": "string", + "name": "Range", + "in": "header", + "required": false, + "description": "HTTP标准协议头,用于指定第一个字节和最后一个字节的位置,告诉服务器想获取的文件范围。如未指定,则获取整个文件。 例如一个文件有900个字节,其范围为0-899,则: Range: bytes=500- 表示读取该文件的500-899字节。 Range: bytes=500-699 表示读取该文件的500-699字节。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "type": "string", + "name": "If-Modified-Since", + "in": "header", + "required": false, + "description": "一个条件式请求首部。 服务器只在所请求的资源在给定的时间之后对内容进行过修改的情况下才会将资源返回,状态码为200 。如果请求的资源在给定的时间之后未经修改,则返回一个不带消息主体的304响应。 格式:, :: GMT 举例:Mon, 10 Apr 2023 07:28:00 GMT 说明 If-Modified-Since只可以用在GET或HEAD请求中。当与If-None-Match 一同出现时,If-Modified-Since会被忽略,除非服务器不支持If-None-Match。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "type": "string", + "name": "If-None-Match", + "in": "header", + "required": false, + "description": "一个条件式请求首部。 对于GET和HEAD方法,当且仅当服务器上没有任何资源的ETag属性值与这个首部中列出的相匹配时,服务器端会才返回所请求的资源,响应码为200 ,否则返回304。其他方法暂不实现。 格式:If-None-Match: \"\" 不支持通配符*,不支持弱比较算法。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "type": "string", + "name": "X-Agc-Trace-Id", + "in": "header", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", - "officialSlug": "agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "officialSlug": "storage-restapi-getfile-0000001498998530", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/storage/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchdeactpromotion-harmonyosnext", + "href": "/api/v1/storage/endpoints/download-file", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchdeactpromotion-harmonyosnext --invoke --body body.json", - "show": "agc pms batchdeactpromotion-harmonyosnext --pretty" + "invoke": "agc storage download-file --invoke", + "show": "agc storage download-file --pretty" } }, { - "id": "batchupdateproduct-android", - "familyId": "pms", - "name": "批量更新商品", - "description": "此接口用于批量更新商品定义信息,展示语言,商品价格,促销活动信息。", - "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product/batchImportProducts", - "command": "agc pms batchupdateproduct-android", - "body": "json", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "documentation": { + "title": "删除文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "updatedAt": "2026-10-22 14:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc storage delete-file --docs --pretty" + }, + "id": "delete-file", + "familyId": "storage", + "name": "删除文件", + "description": "此接口用于删除文件。", + "method": "DELETE", + "path": "/{bucket_name}/{object_name}", + "command": "agc storage delete-file", + "requiredParams": [ + "object_name", + "bucket_name", + "productId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "type": "string", + "name": "object_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "type": "string", + "name": "bucket_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "type": "string", + "name": "X-Agc-Trace-Id", + "in": "header", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013", - "officialSlug": "agcapi-batchupdateproduct-android-0000002171407013", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "officialSlug": "storage-restapi-deletefile-0000001549478405", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/storage/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchupdateproduct-android", + "href": "/api/v1/storage/endpoints/delete-file", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchupdateproduct-android --invoke --body body.json", - "show": "agc pms batchupdateproduct-android --pretty" + "invoke": "agc storage delete-file --invoke", + "show": "agc storage delete-file --pretty" } }, { - "id": "batchupdateproduct-harmonyosnext", - "familyId": "pms", - "name": "批量更新商品", - "description": "此接口用于批量更新商品定义信息,展示语言,商品价格,促销活动信息。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/batchImportProducts", - "command": "agc pms batchupdateproduct-harmonyosnext", - "body": "json", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "documentation": { + "title": "获取文件元数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "updatedAt": "2026-10-22 14:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc storage get-metadata --docs --pretty" + }, + "id": "get-metadata", + "familyId": "storage", + "name": "获取文件元数据", + "description": "此接口用于获取文件元数据。", + "method": "GET", + "path": "/{bucket_name}/{object_name}?metadata=query", + "command": "agc storage get-metadata", + "requiredParams": [ + "object_name", + "bucket_name", + "productId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "type": "string", + "name": "object_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "type": "string", + "name": "bucket_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "type": "string", + "name": "X-Agc-Trace-Id", + "in": "header", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852", - "officialSlug": "agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "officialSlug": "storage-restapi-getmetadata-0000001549518573", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/storage/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/batchupdateproduct-harmonyosnext", + "href": "/api/v1/storage/endpoints/get-metadata", "method": "GET" } }, "affordances": { - "invoke": "agc pms batchupdateproduct-harmonyosnext --invoke --body body.json", - "show": "agc pms batchupdateproduct-harmonyosnext --pretty" + "invoke": "agc storage get-metadata --invoke", + "show": "agc storage get-metadata --pretty" } }, { - "id": "bygetproductinfo-android", - "familyId": "pms", - "name": "按条件查询商品信息", - "description": "此接口用于商品查询,支持多条件过滤,根据productNo和AppId唯一查询一个商品信息。", - "method": "POST", - "path": "/api/pms/product-price-service/v1/manage/product/list", - "command": "agc pms bygetproductinfo-android", - "body": "json", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "documentation": { + "title": "修改文件元数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "updatedAt": "2026-10-22 14:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc storage update-metadata --docs --pretty" + }, + "id": "update-metadata", + "familyId": "storage", + "name": "修改文件元数据", + "description": "此接口用于修改文件元数据。", + "method": "GET", + "path": "/{bucket_name}/{object_name}?metadata=update", + "command": "agc storage update-metadata", + "requiredParams": [ + "object_name", + "bucket_name", + "productId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "type": "string", + "name": "object_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "type": "string", + "name": "bucket_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "X-Agc-Trace-Id", + "in": "header", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Type", + "in": "header", + "required": false, + "description": "文件类型。 默认值:application/octet-stream" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Disposition", + "in": "header", + "required": false, + "description": "文件打开方式。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Encoding", + "in": "header", + "required": false, + "description": "HTTP标准头部Content-Encoding。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "X-Agc-Cache-Control", + "in": "header", + "required": false, + "description": "HTTP标准头部Cache-Control。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "X-Agc-Content-Language", + "in": "header", + "required": false, + "description": "HTTP标准头部Content-Language。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "type": "string", + "name": "X-Agc-meta-*", + "in": "header", + "required": false, + "description": "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头中出现。 示例:X-Agc-meta-test: test metadata 保存实例为:test: test metadata 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。 目录对象不支持自定义元数据,所以此接口不支持目录对象。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316", - "officialSlug": "agcapi-bygetproductinfo-android-0000002135929316", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "officialSlug": "storage-restapi-changemetadata-0000001549198553", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/storage/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/bygetproductinfo-android", + "href": "/api/v1/storage/endpoints/update-metadata", "method": "GET" } }, "affordances": { - "invoke": "agc pms bygetproductinfo-android --invoke --body body.json", - "show": "agc pms bygetproductinfo-android --pretty" + "invoke": "agc storage update-metadata --invoke", + "show": "agc storage update-metadata --pretty" } }, { - "id": "bygetproductinfo-harmonyosnext", - "familyId": "pms", - "name": "按条件查询商品信息", - "description": "此接口用于商品查询,支持多条件过滤,根据productNo和AppId唯一查询一个商品信息。", - "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product/list", - "command": "agc pms bygetproductinfo-harmonyosnext", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609", - "officialSlug": "agcapi-bygetproductinfo-harmonyosnext-0000002166748609", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/pms/endpoints", - "method": "GET" + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "documentation": { + "title": "列举文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "updatedAt": "2026-10-22 14:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc storage list-files --docs --pretty" + }, + "id": "list-files", + "familyId": "storage", + "name": "列举文件", + "description": "此接口用于列举文件。", + "method": "GET", + "path": "/{bucket_name}", + "command": "agc storage list-files", + "requiredParams": [ + "bucket_name", + "productId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "type": "string", + "name": "bucket_name", + "in": "path", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once." }, - "self": { - "href": "/api/v1/pms/endpoints/bygetproductinfo-harmonyosnext", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "type": "string", + "name": "X-Agc-Trace-Id", + "in": "header", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "type": "string", + "name": "max-keys", + "in": "query", + "required": false, + "description": "指定返回文件个数的最大值,默认值为50,取值范围为[1,1000]。 超出范围时,按照默认值进行处理。 如果因为max-keys的设置无法一次完成列举,返回结果会附加NextMarker元素作为下一次列举的marker。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "type": "string", + "name": "marker", + "in": "query", + "required": false, + "description": "指定返回哪个标识符之后的文件,按照文件Key的UTF-8字典顺序排序。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "type": "string", + "name": "prefix", + "in": "query", + "required": false, + "description": "列举以指定的字符串prefix开头的文件。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "type": "string", + "name": "delimiter", + "in": "query", + "required": false, + "description": "将文件名按照特定字符分割的分割符。 注意 当前仅支持传空值或正斜杠(/),正斜杠(/)编码后为%2F。 如果指定了prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从prefix到第一个delimiter之间相同的部分会形成一条CommonPrefixes。 如果未携带prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从文件名开始到第一个delimiter之间相同的部分形成一条CommonPrefixes。" } - }, - "affordances": { - "invoke": "agc pms bygetproductinfo-harmonyosnext --invoke --body body.json", - "show": "agc pms bygetproductinfo-harmonyosnext --pretty" - } - }, - { - "id": "bygetpromotioninfo-android", - "familyId": "pms", - "name": "按条件查询商品促销信息", - "description": "此接口用于商品促销查询,支持多条件过滤。", - "method": "POST", - "path": "/api/pms/product-price-service/v1/manage/product/promotion/list", - "command": "agc pms bygetpromotioninfo-android", - "body": "json", + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416", - "officialSlug": "agcapi-bygetpromotioninfo-android-0000002136087416", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "officialSlug": "storage-restapi-listfile-0000001498518878", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/storage/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/bygetpromotioninfo-android", + "href": "/api/v1/storage/endpoints/list-files", "method": "GET" } }, "affordances": { - "invoke": "agc pms bygetpromotioninfo-android --invoke --body body.json", - "show": "agc pms bygetpromotioninfo-android --pretty" + "invoke": "agc storage list-files --invoke", + "show": "agc storage list-files --pretty" } }, { - "id": "bygetpromotioninfo-harmonyosnext", - "familyId": "pms", - "name": "按条件查询商品促销信息", - "description": "此接口用于商品促销查询,支持多条件过滤。", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "创建版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting create-version --docs --pretty" + }, + "id": "create-version", + "familyId": "hosting", + "name": "创建版本", + "description": "此接口用于创建云托管站点版本,已归档版本可作为新版本的基线版本。", "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product/promotion/list", - "command": "agc pms bygetpromotioninfo-harmonyosnext", - "body": "json", + "path": "/api/cloudhosting/web/v1/version/create", + "command": "agc hosting create-version", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "baseVersion", + "in": "body", + "required": false, + "description": "基线版本号,基于该版本创建新的版本。 仅支持版本状态为“FINALIZED”的版本作为基线版本。" + } + ], + "body": "siteId,baseVersion", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", - "officialSlug": "agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196", + "officialSlug": "agcapi-cloudhost-newapp-0000001111685196", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/bygetpromotioninfo-harmonyosnext", + "href": "/api/v1/hosting/endpoints/create-version", "method": "GET" } }, "affordances": { - "invoke": "agc pms bygetpromotioninfo-harmonyosnext --invoke --body body.json", - "show": "agc pms bygetpromotioninfo-harmonyosnext --pretty" + "invoke": "agc hosting create-version --invoke --body body.json", + "show": "agc hosting create-version --pretty" } }, { - "id": "getproductgroup-android", - "familyId": "pms", - "name": "查询商品订阅分组信息", - "description": "此接口用于查询商品订阅分组信息。", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "修改版本文件列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting modify-files --docs --pretty" + }, + "id": "modify-files", + "familyId": "hosting", + "name": "修改版本文件列表", + "description": "此接口用于对基线版本需要删除的文件做版本修改,标记需要删除文件的绝对路径,在归档版本时处理文件。", "method": "POST", - "path": "/api/pms/product-price-service/v1/manage/product/group/list", - "command": "agc pms getproductgroup-android", - "body": "json", + "path": "/api/cloudhosting/web/v1/version/modifyFilelist", + "command": "agc hosting modify-files", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId", + "version", + "deleteFiles" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "云托管站点版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "version", + "in": "body", + "required": true, + "description": "当前版本的版本号(仅支持版本状态为“CREATED”的版本)。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "maxItems": 1000, + "itemsType": "string", + "type": "array", + "name": "deleteFiles", + "in": "body", + "required": true, + "description": "需要删除的文件列表(文件的绝对路径),一次最多删除1000个。" + } + ], + "body": "siteId,version,deleteFiles", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009", - "officialSlug": "agcapi-getproductgroup-android-0000002171407009", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867", + "officialSlug": "agcapi-cloudhost-modifyversion-0000001211627867", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/getproductgroup-android", + "href": "/api/v1/hosting/endpoints/modify-files", "method": "GET" } }, "affordances": { - "invoke": "agc pms getproductgroup-android --invoke --body body.json", - "show": "agc pms getproductgroup-android --pretty" + "invoke": "agc hosting modify-files --invoke --body body.json", + "show": "agc hosting modify-files --pretty" } }, { - "id": "getproductgroup-harmonyosnext", - "familyId": "pms", - "name": "查询商品订阅分组信息", - "description": "此接口用于查询商品订阅分组信息。", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "获取版本压缩包上传地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting upload-url --docs --pretty" + }, + "id": "upload-url", + "familyId": "hosting", + "name": "获取版本压缩包上传地址", + "description": "此接口用于获取增量版本文件压缩包或全量版本文件压缩包的上传地址等信息,并完成增量版本包上传。您可以多次获取上传地址,以最后一次获取为最终增量版本。", "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product/group/list", - "command": "agc pms getproductgroup-harmonyosnext", - "body": "json", + "path": "/api/cloudhosting/web/v1/version/populateFiles", + "command": "agc hosting upload-url", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId", + "version", + "materialInfos" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "version", + "in": "body", + "required": true, + "description": "当前版本的版本号(只支持“CREATED”状态版本)" + }, + { + "itemsProperties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "maxLength": 128, + "type": "string", + "name": "sceneId", + "in": "body", + "required": true, + "description": "场景ID,与项目ID一致。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "maxLength": 256, + "type": "string", + "name": "fileName", + "in": "body", + "required": true, + "description": "文件名称。" + }, + { + "pattern": "^[a-fA-F0-9]{64}$", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "fileSha256", + "in": "body", + "required": true, + "description": "zip增量的Hash值。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "minimum": 0, + "maximum": 10737418240, + "type": "integer", + "name": "fileSize", + "in": "body", + "required": true, + "description": "文件大小,参数最大限制10G。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "enum": [ + "902" + ], + "type": "integer", + "name": "contentType", + "in": "body", + "required": true, + "description": "上传资源类型。固定值为:902。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "itemsType": "object", + "type": "array", + "name": "materialInfos", + "in": "body", + "required": true, + "description": "zip增量包参数信息。" + } + ], + "body": "siteId,version,materialInfos", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848", - "officialSlug": "agcapi-getproductgroup-harmonyosnext-0000002131508848", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "officialSlug": "agcapi-cloudhost-uploadurl-0000001166347942", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/getproductgroup-harmonyosnext", + "href": "/api/v1/hosting/endpoints/upload-url", "method": "GET" } }, "affordances": { - "invoke": "agc pms getproductgroup-harmonyosnext --invoke --body body.json", - "show": "agc pms getproductgroup-harmonyosnext --pretty" + "invoke": "agc hosting upload-url --invoke --body body.json", + "show": "agc hosting upload-url --pretty" } }, { - "id": "getproductinfo-android", - "familyId": "pms", - "name": "查询商品详情", - "description": "此接口用于商品详情查询,根据productNo和appId唯一查询一个商品信息。", - "method": "GET", - "path": "/api/pms/product-price-service/v1/manage/product", - "command": "agc pms getproductinfo-android", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609", - "officialSlug": "agcapi-getproductinfo-android-0000002171288609", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/pms/endpoints", - "method": "GET" + "authentication": "signed-upload", + "documentation": { + "title": "上传版本压缩包", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting upload-version --docs --pretty" + }, + "id": "upload-version", + "familyId": "hosting", + "name": "上传版本压缩包", + "description": "通过获取上传地址的响应请求地址、请求方法、请求头信息,上传版本压缩包至云托管。", + "method": "PUT", + "path": "{uploadUrl}", + "command": "agc hosting upload-version", + "requiredParams": [ + "Authorization", + "x-amz-content-sha256", + "x-amz-client-request-id", + "x-amz-date", + "Host", + "Content-Type", + "uploadUrl", + "file" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "type": "string", + "name": "Authorization", + "in": "header", + "required": true, + "description": "校验信息,对应获取版本压缩包上传地址接口返回的headers参数中的Authorization。" }, - "self": { - "href": "/api/v1/pms/endpoints/getproductinfo-android", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "type": "string", + "name": "x-amz-content-sha256", + "in": "header", + "required": true, + "description": "文件对象内容的SHA256哈希值,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-content-sha256。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "type": "string", + "name": "x-amz-client-request-id", + "in": "header", + "required": true, + "description": "文件上传的唯一标识,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-client-request-id。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "type": "string", + "name": "x-amz-date", + "in": "header", + "required": true, + "description": "文件上传地址生成的时间,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-date。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "type": "string", + "name": "Host", + "in": "header", + "required": true, + "description": "上传服务器地址,对应获取版本压缩包上传地址接口返回的headers参数中的Host。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "type": "string", + "name": "Content-Type", + "in": "header", + "required": true, + "description": "对象内容的类型,对应获取版本压缩包上传地址接口返回的headers参数中的Content-Type。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "type": "string", + "name": "uploadUrl", + "in": "path", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "type": "string", + "name": "file", + "in": "file", + "required": true } - }, - "affordances": { - "invoke": "agc pms getproductinfo-android --invoke", - "show": "agc pms getproductinfo-android --pretty" - } - }, - { - "id": "getproductinfo-harmonyosnext", - "familyId": "pms", - "name": "查询商品详情", - "description": "此接口用于商品详情查询,根据productNo和appId唯一查询一个商品信息。", - "method": "GET", - "path": "/api/pms/product-price-service/v2/manage/product", - "command": "agc pms getproductinfo-harmonyosnext", + ], + "body": "file", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", - "officialSlug": "agcapi-getproductinfo-harmonyosnext-0000002131350708", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "officialSlug": "agcapi-cloudhost-uploadversion-0000001211707813", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/getproductinfo-harmonyosnext", + "href": "/api/v1/hosting/endpoints/upload-version", "method": "GET" } }, "affordances": { - "invoke": "agc pms getproductinfo-harmonyosnext --invoke", - "show": "agc pms getproductinfo-harmonyosnext --pretty" + "invoke": "agc hosting upload-version --invoke --body body.json", + "show": "agc hosting upload-version --pretty" } }, { - "id": "getpromotioninfo-android", - "familyId": "pms", - "name": "查询商品促销详情", - "description": "此接口用于查询商品促销信息。", - "method": "GET", - "path": "/api/pms/product-price-service/v1/manage/product/promotion", - "command": "agc pms getpromotioninfo-android", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "归档版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting archive-version --docs --pretty" + }, + "id": "archive-version", + "familyId": "hosting", + "name": "归档版本", + "description": "版本包上传完成后,此接口用于对新版本进行归档。如果上传的是增量版本包,云托管对基线版本和增量版本包进行合并,归档为完整的新版本文件包。归档版本是异步操作,从开始到完成,版本的状态从“MERGING”变为“FINALIZED”。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/merge", + "command": "agc hosting archive-version", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId", + "version" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "version", + "in": "body", + "required": true, + "description": "当前版本的版本号(只支持“CREATED”状态)。" + } + ], + "body": "siteId,version", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328", - "officialSlug": "agcapi-getpromotioninfo-android-0000002135929328", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385", + "officialSlug": "agcapi-cloudhost-archivedversion-0000001211826385", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/getpromotioninfo-android", + "href": "/api/v1/hosting/endpoints/archive-version", "method": "GET" } }, "affordances": { - "invoke": "agc pms getpromotioninfo-android --invoke", - "show": "agc pms getpromotioninfo-android --pretty" + "invoke": "agc hosting archive-version --invoke --body body.json", + "show": "agc hosting archive-version --pretty" } }, { - "id": "getpromotioninfo-harmonyosnext", - "familyId": "pms", - "name": "查询商品促销详情", - "description": "此接口用于查询商品促销信息。", - "method": "GET", - "path": "/api/pms/product-price-service/v2/manage/product/promotion", - "command": "agc pms getpromotioninfo-harmonyosnext", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "发布版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting release-version --docs --pretty" + }, + "id": "release-version", + "familyId": "hosting", + "name": "发布版本", + "description": "此接口用于发布新版本。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/release", + "command": "agc hosting release-version", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId", + "version", + "environment" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "version", + "in": "body", + "required": true, + "description": "当前版本的版本号。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "environment", + "in": "body", + "required": true, + "description": "发布环境类型。 0:生产 1:沙箱" + } + ], + "body": "siteId,version,environment", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617", - "officialSlug": "agcapi-getpromotioninfo-harmonyosnext-0000002166748617", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484", + "officialSlug": "agcapi-cloudhost-releaseversion-0000001166666484", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/getpromotioninfo-harmonyosnext", + "href": "/api/v1/hosting/endpoints/release-version", "method": "GET" } }, "affordances": { - "invoke": "agc pms getpromotioninfo-harmonyosnext --invoke", - "show": "agc pms getpromotioninfo-harmonyosnext --pretty" + "invoke": "agc hosting release-version --invoke --body body.json", + "show": "agc hosting release-version --pretty" } }, { - "id": "isproductactive-android", - "familyId": "pms", - "name": "查询是否有在线商品", - "description": "此接口用于根据AppId查询是否有激活的商品。", - "method": "GET", - "path": "/api/pms/product-price-service/v1/manage/product/check", - "command": "agc pms isproductactive-android", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "查询版本列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting list-versions --docs --pretty" + }, + "id": "list-versions", + "familyId": "hosting", + "name": "查询版本列表", + "description": "此接口用于查询云托管站点下的版本列表。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/query", + "command": "agc hosting list-versions", + "requiredParams": [ + "productId", + "requestid", + "service" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": false, + "description": "云托管版本所在站点ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "tenantId", + "in": "body", + "required": false, + "description": "租户ID,与项目ID一致。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "version", + "in": "body", + "required": false, + "description": "版本ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "versionStatus", + "in": "body", + "required": false, + "description": "版本状态,参考版本状态码。" + } + ], + "body": "siteId,tenantId,version,versionStatus", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412", - "officialSlug": "agcapi-isproductactive-android-0000002136087412", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920", + "officialSlug": "agcapi-cloudhost-queryversion-0000001166507920", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/isproductactive-android", + "href": "/api/v1/hosting/endpoints/list-versions", "method": "GET" } }, "affordances": { - "invoke": "agc pms isproductactive-android --invoke", - "show": "agc pms isproductactive-android --pretty" + "invoke": "agc hosting list-versions --invoke --body body.json", + "show": "agc hosting list-versions --pretty" } }, { - "id": "isproductactive-harmonyosnext", - "familyId": "pms", - "name": "查询是否有在线商品", - "description": "此接口用于根据AppId查询是否有激活的商品。", - "method": "GET", - "path": "/api/pms/product-price-service/v2/manage/product/check", - "command": "agc pms isproductactive-harmonyosnext", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145", - "officialSlug": "agcapi-isproductactive-harmonyosnext-0000002166670145", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/pms/endpoints", - "method": "GET" + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "查询归档版本文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting list-version-files --docs --pretty" + }, + "id": "list-version-files", + "familyId": "hosting", + "name": "查询归档版本文件", + "description": "此接口用于查询已归档版本的归档文件信息,为创建和修改版本提供基线版本内容的查询。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/queryFiles", + "command": "agc hosting list-version-files", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId", + "version", + "pageInfo" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" }, - "self": { - "href": "/api/v1/pms/endpoints/isproductactive-harmonyosnext", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "云托管版本所在站点ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "version", + "in": "body", + "required": true, + "description": "站点版本ID。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "type": "integer", + "name": "queryIndex", + "in": "body", + "required": false, + "description": "索引查询,默认值为0。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "maximum": 1000, + "type": "integer", + "name": "querySize", + "in": "body", + "required": false, + "description": "每页查询数量,默认值为1000,最大值为1000。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "type": "object", + "name": "pageInfo", + "in": "body", + "required": true, + "description": "分页模型。" } - }, - "affordances": { - "invoke": "agc pms isproductactive-harmonyosnext --invoke", - "show": "agc pms isproductactive-harmonyosnext --pretty" - } - }, - { - "id": "levelgroup-harmonyosnext", - "familyId": "pms", - "name": "更新商品订阅分组等级信息", - "description": "此接口用于更新商品订阅分组等级信息。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/group/level", - "command": "agc pms levelgroup-harmonyosnext", - "body": "json", + ], + "body": "siteId,version,pageInfo", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485", - "officialSlug": "agcapi-levelgroup-harmonyosnext-0000002175107485", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869", + "officialSlug": "agcapi-cloudhost-queryfile-0000001211627869", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/levelgroup-harmonyosnext", + "href": "/api/v1/hosting/endpoints/list-version-files", "method": "GET" } }, "affordances": { - "invoke": "agc pms levelgroup-harmonyosnext --invoke --body body.json", - "show": "agc pms levelgroup-harmonyosnext --pretty" + "invoke": "agc hosting list-version-files --invoke --body body.json", + "show": "agc hosting list-version-files --pretty" } }, { - "id": "resourcemanage-harmonyosnext", - "familyId": "pms", - "name": "上传资源", - "description": "此接口用于提交上传资源。", - "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/resource", - "command": "agc pms resourcemanage-harmonyosnext", - "body": "json", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "删除版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting delete-version --docs --pretty" + }, + "id": "delete-version", + "familyId": "hosting", + "name": "删除版本", + "description": "此接口用于删除站点下非“上线”状态的版本。", + "method": "DELETE", + "path": "/api/cloudhosting/web/v1/version/{versionId}", + "command": "agc hosting delete-version", + "requiredParams": [ + "productId", + "requestid", + "service", + "versionId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section17512144171520", + "maxLength": 64, + "type": "string", + "name": "versionId", + "in": "path", + "required": true, + "description": "站点版本ID。" + } + ], "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792", - "officialSlug": "agcapi-resourcemanage-harmonyosnext-0000002131361792", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944", + "officialSlug": "agcapi-cloudhost-deleteversion-0000001166347944", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/resourcemanage-harmonyosnext", + "href": "/api/v1/hosting/endpoints/delete-version", "method": "GET" } }, "affordances": { - "invoke": "agc pms resourcemanage-harmonyosnext --invoke --body body.json", - "show": "agc pms resourcemanage-harmonyosnext --pretty" + "invoke": "agc hosting delete-version --invoke", + "show": "agc hosting delete-version --pretty" } }, { - "id": "reviewproduct-harmonyosnext", - "familyId": "pms", - "name": "提交商品审核", - "description": "此接口用于提交商品审核。", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "创建站点环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting create-environment --docs --pretty" + }, + "id": "create-environment", + "familyId": "hosting", + "name": "创建站点环境", + "description": "此接口用于创建站点环境。", "method": "POST", - "path": "/api/pms/product-price-service/v2/manage/product/review", - "command": "agc pms reviewproduct-harmonyosnext", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241", - "officialSlug": "agcapi-reviewproduct-harmonyosnext-0000002166681241", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/pms/endpoints", - "method": "GET" + "path": "/api/cloudhosting/web/v1/site/environment/create", + "command": "agc hosting create-environment", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId", + "environmentId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" }, - "self": { - "href": "/api/v1/pms/endpoints/reviewproduct-harmonyosnext", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "站点ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "environmentId", + "in": "body", + "required": true, + "description": "环境ID。" } - }, - "affordances": { - "invoke": "agc pms reviewproduct-harmonyosnext --invoke --body body.json", - "show": "agc pms reviewproduct-harmonyosnext --pretty" - } - }, - { - "id": "updateproduct-android", - "familyId": "pms", - "name": "更新商品信息", - "description": "此接口用于更新商品定义信息,包含商品价格,展示语言和商品状态。", - "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product", - "command": "agc pms updateproduct-android", - "body": "json", + ], + "body": "siteId,environmentId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404", - "officialSlug": "agcapi-updateproduct-android-0000002136087404", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720", + "officialSlug": "agcapi-cloudhost-createnvir-0000001216965720", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/updateproduct-android", + "href": "/api/v1/hosting/endpoints/create-environment", "method": "GET" } }, "affordances": { - "invoke": "agc pms updateproduct-android --invoke --body body.json", - "show": "agc pms updateproduct-android --pretty" + "invoke": "agc hosting create-environment --invoke --body body.json", + "show": "agc hosting create-environment --pretty" } }, { - "id": "updateproduct-harmonyosnext", - "familyId": "pms", - "name": "更新商品信息", - "description": "此接口用于更新商品定义信息,包含商品价格,展示语言和商品状态。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product", - "command": "agc pms updateproduct-harmonyosnext", - "body": "json", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "查询站点环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting list-environments --docs --pretty" + }, + "id": "list-environments", + "familyId": "hosting", + "name": "查询站点环境", + "description": "此接口用于查询站点环境。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/environment/query", + "command": "agc hosting list-environments", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "站点ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "environmentId", + "in": "body", + "required": false, + "description": "环境ID。" + } + ], + "body": "siteId,environmentId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141", - "officialSlug": "agcapi-updateproduct-harmonyosnext-0000002166670141", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680", + "officialSlug": "agcapi-cloudhost-queryenvir-0000001217285680", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/updateproduct-harmonyosnext", + "href": "/api/v1/hosting/endpoints/list-environments", "method": "GET" } }, "affordances": { - "invoke": "agc pms updateproduct-harmonyosnext --invoke --body body.json", - "show": "agc pms updateproduct-harmonyosnext --pretty" + "invoke": "agc hosting list-environments --invoke --body body.json", + "show": "agc hosting list-environments --pretty" } }, { - "id": "updateproductgroup-android", - "familyId": "pms", - "name": "更新商品订阅分组信息", - "description": "此接口用于更新商品订阅分组信息。", - "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product/group", - "command": "agc pms updateproductgroup-android", - "body": "json", - "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400", - "officialSlug": "agcapi-updateproductgroup-android-0000002136087400", - "direction": "developer-to-huawei", - "_links": { - "family": { - "href": "/api/v1/pms/endpoints", - "method": "GET" + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "删除站点环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting delete-environment --docs --pretty" + }, + "id": "delete-environment", + "familyId": "hosting", + "name": "删除站点环境", + "description": "此接口用于删除站点环境。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/environment/delete", + "command": "agc hosting delete-environment", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteId", + "environmentId" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" }, - "self": { - "href": "/api/v1/pms/endpoints/updateproductgroup-android", - "method": "GET" + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "站点ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "environmentId", + "in": "body", + "required": true, + "description": "环境ID。" } - }, - "affordances": { - "invoke": "agc pms updateproductgroup-android --invoke --body body.json", - "show": "agc pms updateproductgroup-android --pretty" - } - }, - { - "id": "updateproductgroup-harmonyosnext", - "familyId": "pms", - "name": "更新商品订阅分组信息", - "description": "此接口用于更新商品订阅分组信息。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/group", - "command": "agc pms updateproductgroup-harmonyosnext", - "body": "json", + ], + "body": "siteId,environmentId", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137", - "officialSlug": "agcapi-updateproductgroup-harmonyosnext-0000002166670137", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648", + "officialSlug": "agcapi-cloudhost-deletenvir-0000001217445648", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/updateproductgroup-harmonyosnext", + "href": "/api/v1/hosting/endpoints/delete-environment", "method": "GET" } }, "affordances": { - "invoke": "agc pms updateproductgroup-harmonyosnext --invoke --body body.json", - "show": "agc pms updateproductgroup-harmonyosnext --pretty" + "invoke": "agc hosting delete-environment --invoke --body body.json", + "show": "agc hosting delete-environment --pretty" } }, { - "id": "updatepromotion-android", - "familyId": "pms", - "name": "更新商品促销信息", - "description": "此接口用于更新商品促销信息。", - "method": "PUT", - "path": "/api/pms/product-price-service/v1/manage/product/promotion", - "command": "agc pms updatepromotion-android", - "body": "json", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "创建站点", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting create-site --docs --pretty" + }, + "id": "create-site", + "familyId": "hosting", + "name": "创建站点", + "description": "此接口用于创建泛域名站点。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/create", + "command": "agc hosting create-site", + "requiredParams": [ + "productId", + "requestid", + "service", + "siteName" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131", + "maxLength": 30, + "type": "string", + "name": "siteName", + "in": "body", + "required": true, + "description": "站点名。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131", + "maxLength": 1000, + "type": "string", + "name": "description", + "in": "body", + "required": false, + "description": "站点描述信息。" + } + ], + "body": "siteName,description", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621", - "officialSlug": "agcapi-updatepromotion-android-0000002171288621", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466", + "officialSlug": "agcapi-cloudhost-createsite-0000001216061466", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/updatepromotion-android", + "href": "/api/v1/hosting/endpoints/create-site", "method": "GET" } }, "affordances": { - "invoke": "agc pms updatepromotion-android --invoke --body body.json", - "show": "agc pms updatepromotion-android --pretty" + "invoke": "agc hosting create-site --invoke --body body.json", + "show": "agc hosting create-site --pretty" } }, { - "id": "updatepromotion-harmonyosnext", - "familyId": "pms", - "name": "更新商品促销信息", - "description": "此接口用于更新商品促销信息。", - "method": "PUT", - "path": "/api/pms/product-price-service/v2/manage/product/promotion", - "command": "agc pms updatepromotion-harmonyosnext", - "body": "json", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "查询站点", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting list-sites --docs --pretty" + }, + "id": "list-sites", + "familyId": "hosting", + "name": "查询站点", + "description": "此接口用于通过站点部分信息查询站点其他信息,例如通过站点名称查询站点ID。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/query", + "command": "agc hosting list-sites", + "requiredParams": [ + "productId", + "requestid", + "service", + "site" + ], + "parameters": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "type": "string", + "name": "productId", + "in": "header", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "maxLength": 63, + "type": "string", + "name": "siteName", + "in": "body", + "required": false, + "description": "站点名称。 可通过云托管站点名称查询站点完整信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": false, + "description": "站点ID。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "tenantId", + "in": "body", + "required": false, + "description": "租户ID,与项目ID一致。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "type": "object", + "name": "site", + "in": "body", + "required": true, + "description": "站点信息。" + }, + { + "properties": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "type": "integer", + "name": "queryIndex", + "in": "body", + "required": false, + "description": "索引查询,默认值为0。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "maximum": 1000, + "type": "integer", + "name": "querySize", + "in": "body", + "required": false, + "description": "每页查询数量。默认值为1000,最大值为1000" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "type": "object", + "name": "pageInfo", + "in": "body", + "required": false, + "description": "分页模型。" + } + ], + "body": "site,pageInfo", "status": "registered", "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716", - "officialSlug": "agcapi-updatepromotion-harmonyosnext-0000002131350716", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "officialSlug": "agcapi-cloudhost-querysite-0000001166826430", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/pms/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/pms/endpoints/updatepromotion-harmonyosnext", + "href": "/api/v1/hosting/endpoints/list-sites", "method": "GET" } }, "affordances": { - "invoke": "agc pms updatepromotion-harmonyosnext --invoke --body body.json", - "show": "agc pms updatepromotion-harmonyosnext --pretty" + "invoke": "agc hosting list-sites --invoke --body body.json", + "show": "agc hosting list-sites --pretty" } }, { - "id": "asset-details", - "familyId": "gameplay", - "name": "查询资产明细", - "description": "华为游戏服务器调用此接口查询玩家在玩游戏的资产明细数据,并将信息展示在游戏中心的“在玩”页面上。", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "更新站点", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting update-site --docs --pretty" + }, + "id": "update-site", + "familyId": "hosting", + "name": "更新站点", + "description": "此接口用于更新站点描述信息及控制是否开启简洁链接。", "method": "POST", - "path": "{callbackUrl}", - "command": "agc gameplay asset-details", + "path": "/api/cloudhosting/web/v1/site/modify", + "command": "agc hosting update-site", "requiredParams": [ - "callbackUrl", - "callbackUrl" + "productId", + "requestid", + "service", + "siteId" ], "parameters": [ { - "name": "callbackUrl", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "type": "string", + "name": "productId", + "in": "header", "required": true, - "description": "callbackUrl parameter" + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" }, { - "name": "callbackUrl", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "type": "string", + "name": "requestid", + "in": "header", "required": true, - "description": "callbackUrl parameter" + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "siteId", + "in": "body", + "required": true, + "description": "站点信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "maxLength": 1000, + "type": "string", + "name": "description", + "in": "body", + "required": false, + "description": "描述信息内容,匹配中文、空格、下划线、中划线、点、英文字母及数字。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "enum": [ + "0", + "1" + ], + "type": "integer", + "name": "cleanSuffix", + "in": "body", + "required": false, + "description": "简洁链接: 0-关闭。 1-开启。" } ], - "body": "json", + "body": "siteId,description,cleanSuffix", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253", - "officialSlug": "agcapi-asset-details-0000002022225253", - "direction": "inbound-callback", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359", + "officialSlug": "agcapi-cloudhost-refreshsite-0000001260949359", + "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/asset-details", + "href": "/api/v1/hosting/endpoints/update-site", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay asset-details --invoke --body body.json", - "show": "agc gameplay asset-details --pretty" + "invoke": "agc hosting update-site --invoke --body body.json", + "show": "agc hosting update-site --pretty" } }, { - "id": "asset-summary", - "familyId": "gameplay", - "name": "查询资产概要", - "description": "华为游戏服务器调用此接口查询玩家在玩游戏的资产概要数据,并将信息展示在游戏中心的“在玩”页面上。", - "method": "POST", - "path": "{callbackUrl}", - "command": "agc gameplay asset-summary", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "documentation": { + "title": "删除站点", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361", + "updatedAt": "2026-10-23 16:56", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc hosting delete-site --docs --pretty" + }, + "id": "delete-site", + "familyId": "hosting", + "name": "删除站点", + "description": "此接口用于删除站点。", + "method": "DELETE", + "path": "/api/cloudhosting/web/v1/site/{siteId}", + "command": "agc hosting delete-site", "requiredParams": [ - "callbackUrl", - "callbackUrl" + "productId", + "requestid", + "service", + "siteId" ], "parameters": [ { - "name": "callbackUrl", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "type": "string", + "name": "Authorization", + "in": "header", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "type": "string", + "name": "productId", + "in": "header", "required": true, - "description": "callbackUrl parameter" + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。" }, { - "name": "callbackUrl", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "type": "string", + "name": "requestid", + "in": "header", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "type": "string", + "name": "client_id", + "in": "header", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "enum": [ + "hosting" + ], + "type": "string", + "name": "service", + "in": "header", + "required": true, + "description": "API业务标识。固定值:hosting。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section2809102219131", + "maxLength": 64, + "type": "string", + "name": "siteId", "in": "path", "required": true, - "description": "callbackUrl parameter" + "description": "站点信息。" } ], - "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", - "officialSlug": "agcapi-asset-summary-0000002022105729", - "direction": "inbound-callback", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361", + "officialSlug": "agcapi-cloudhost-deletesite-0000001260869361", + "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/hosting/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/asset-summary", + "href": "/api/v1/hosting/endpoints/delete-site", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay asset-summary --invoke --body body.json", - "show": "agc gameplay asset-summary --pretty" + "invoke": "agc hosting delete-site --invoke", + "show": "agc hosting delete-site --pretty" } - }, - { - "id": "basic-info", - "familyId": "gameplay", - "name": "批量查询玩家基本信息", - "description": "华为游戏服务器调用此接口批量查询玩家基本信息,并将信息展示在游戏中心的“在玩”页面上。", + }, + { + "authentication": "callback-body", + "requestContentType": "application/json", + "documentation": { + "title": "获取用户ID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838", + "updatedAt": "2022-07-11 10:50", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc templates user-id --docs --pretty" + }, + "id": "user-id", + "familyId": "templates", + "name": "获取用户ID", + "description": "通过accessToken获取抽奖用户ID,即userId。", "method": "POST", "path": "{callbackUrl}", - "command": "agc gameplay basic-info", + "command": "agc templates user-id", "requiredParams": [ "callbackUrl", - "callbackUrl" + "accessToken" ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838", + "type": "string", "name": "callbackUrl", "in": "path", "required": true, - "description": "callbackUrl parameter" + "description": "Developer HTTPS authentication callback URL" }, { - "name": "callbackUrl", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section128mcpsimp", + "maxLength": 256, + "type": "string", + "name": "accessToken", + "in": "body", "required": true, - "description": "callbackUrl parameter" + "description": "认证凭据。" } ], - "body": "json", + "body": "accessToken", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322", - "officialSlug": "agcapi-basic-info-0000002038975322", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838", + "officialSlug": "agc-serverless-comm-api-obtainuserid-0000001260291838", "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/basic-info", + "href": "/api/v1/templates/endpoints/user-id", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay basic-info --invoke --body body.json", - "show": "agc gameplay basic-info --pretty" + "invoke": "agc templates user-id --invoke --body body.json", + "show": "agc templates user-id --pretty" } }, { - "id": "label", - "familyId": "gameplay", - "name": "查询战绩筛选标签", - "description": "华为游戏服务器调用此接口查询玩家在玩游戏战绩的筛选标签,并将信息展示在游戏中心的“在玩”页面上。", + "authentication": "callback-body", + "requestContentType": "application/json", + "documentation": { + "title": "获取玩家ID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276", + "updatedAt": "2024-06-18 18:08", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc templates player-id --docs --pretty" + }, + "id": "player-id", + "familyId": "templates", + "name": "获取玩家ID", + "description": "通过accessToken获取游戏排行榜的用户ID。", "method": "POST", "path": "{callbackUrl}", - "command": "agc gameplay label", + "command": "agc templates player-id", "requiredParams": [ "callbackUrl", - "callbackUrl" + "appId", + "accessToken" ], "parameters": [ { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276", + "type": "string", "name": "callbackUrl", "in": "path", "required": true, - "description": "callbackUrl parameter" + "description": "Developer HTTPS authentication callback URL" }, { - "name": "callbackUrl", - "in": "path", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "maxLength": 64, + "type": "string", + "name": "appId", + "in": "body", "required": true, - "description": "callbackUrl parameter" + "description": "应用ID,获取方法参考查看应用基本信息。" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "maxLength": 2048, + "type": "string", + "name": "accessToken", + "in": "body", + "required": true, + "description": "玩家ID的认证凭据,来自于您调用函数接口时带的参数值。" } ], - "body": "json", + "body": "appId,accessToken", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", - "officialSlug": "agcapi-label-0000001985625670", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276", + "officialSlug": "agc-serverless-get-id-0000001296645276", "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/label", + "href": "/api/v1/templates/endpoints/player-id", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay label --invoke --body body.json", - "show": "agc gameplay label --pretty" + "invoke": "agc templates player-id --invoke --body body.json", + "show": "agc templates player-id --pretty" } }, { - "id": "resources", - "familyId": "gameplay", - "name": "上传/下架游戏资源", - "description": "开发者服务器调用此接口同步华为服务器的游戏资源,用于上传或下架“在玩”页面上的图片或视频。", - "method": "POST", - "path": "/gameservice/api/gbClientApi", - "command": "agc gameplay resources", - "body": "json", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "search-applications", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates search-applications --docs --pretty" + }, + "id": "search-applications", + "familyId": "templates", + "name": "search-applications", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "GET", + "path": "/api/adm/v1/applications/search", + "command": "agc templates search-applications", + "requiredParams": [ + "appName" + ], + "parameters": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "appName", + "in": "query", + "required": true + } + ], "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725", - "officialSlug": "agcapi-resources-0000002022105725", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-search-applications", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/resources", + "href": "/api/v1/templates/endpoints/search-applications", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay resources --invoke --body body.json", - "show": "agc gameplay resources --pretty" + "docs": "agc templates search-applications --docs --pretty", + "invoke": "agc templates search-applications --invoke --session-file SESSION.json", + "show": "agc templates search-applications --pretty" } }, { - "id": "role-info", - "familyId": "gameplay", - "name": "批量查询玩家角色信息", - "description": "华为游戏服务器调用此接口批量查询玩家角色信息。", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "create-application", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates create-application --docs --pretty" + }, + "id": "create-application", + "familyId": "templates", + "name": "create-application", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", "method": "POST", - "path": "{callbackUrl}", - "command": "agc gameplay role-info", + "path": "/api/adm/v1/applications", + "command": "agc templates create-application", "requiredParams": [ - "callbackUrl", - "callbackUrl" + "name", + "components" ], "parameters": [ { - "name": "callbackUrl", - "in": "path", - "required": true, - "description": "callbackUrl parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true }, { - "name": "callbackUrl", - "in": "path", - "required": true, - "description": "callbackUrl parameter" + "itemsProperties": [ + { + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Huawei::AGC::CloudFunctions" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "codeUri", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "runtime", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "500", + "1000", + "2000", + "4000" + ], + "type": "integer", + "name": "memorySize", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1800, + "type": "integer", + "name": "timeout", + "in": "body", + "required": true + }, + { + "pattern": "^[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "handler", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "instanceConcurrency", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "description", + "in": "body", + "required": false, + "description": "Vendor display width <=64; non-ASCII UTF-16 units count twice." + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxItems": 5, + "itemsType": "string", + "type": "array", + "name": "layers", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "pattern": "^[-._a-zA-Z][-._a-zA-Z0-9]*$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 2048, + "type": "string", + "name": "value", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "env", + "in": "body", + "required": false + }, + { + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "alias", + "in": "body", + "required": false + }, + { + "itemsRules": [ + { + "id": "sam-http-authType", + "kind": "required_if", + "field": "body.properties.authType", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.authType", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-http-enableUrlDecode", + "kind": "required_if", + "field": "body.properties.enableUrlDecode", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.enableUrlDecode", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-schedule", + "kind": "required_if", + "field": "body.properties.schedule", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.schedule", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-input", + "kind": "required_if", + "field": "body.properties.input", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.input", + "suggestion": "Supply the conditional event property using the source-defined type." + } + ], + "itemsProperties": [ + { + "pattern": "^[a-z][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "http", + "cron" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client" + ], + "type": "string", + "name": "authType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "enableUrlDecode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "schedule", + "in": "body", + "required": false + }, + { + "encodedJson": { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "value", + "in": "body", + "required": false + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "input", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "properties", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "events", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "properties", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "components", + "in": "body", + "required": true } ], - "body": "json", + "body": "name,components", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", - "officialSlug": "agcapi-role-info-0000002075016173", - "direction": "inbound-callback", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-application", + "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/role-info", + "href": "/api/v1/templates/endpoints/create-application", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay role-info --invoke --body body.json", - "show": "agc gameplay role-info --pretty" + "docs": "agc templates create-application --docs --pretty", + "invoke": "agc templates create-application --invoke --session-file SESSION.json --body body.json", + "show": "agc templates create-application --pretty" } }, { - "id": "scores", - "familyId": "gameplay", - "name": "分页查询玩家战绩", - "description": "华为游戏服务器调用此接口分页查询玩家在玩游戏的战绩数据,并将信息展示在游戏中心的“在玩”页面上。", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "create-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates create-plan --docs --pretty" + }, + "id": "create-plan", + "familyId": "templates", + "name": "create-plan", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", "method": "POST", - "path": "{callbackUrl}", - "command": "agc gameplay scores", + "path": "/api/adm/v1/applications/{applicationId}/plans", + "command": "agc templates create-plan", "requiredParams": [ - "callbackUrl", - "callbackUrl" + "applicationId", + "name", + "components" ], "parameters": [ { - "name": "callbackUrl", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "applicationId", "in": "path", - "required": true, - "description": "callbackUrl parameter" + "required": true }, { - "name": "callbackUrl", - "in": "path", - "required": true, - "description": "callbackUrl parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "itemsProperties": [ + { + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Huawei::AGC::CloudFunctions" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "codeUri", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "runtime", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "500", + "1000", + "2000", + "4000" + ], + "type": "integer", + "name": "memorySize", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1800, + "type": "integer", + "name": "timeout", + "in": "body", + "required": true + }, + { + "pattern": "^[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "handler", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "instanceConcurrency", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "description", + "in": "body", + "required": false, + "description": "Vendor display width <=64; non-ASCII UTF-16 units count twice." + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxItems": 5, + "itemsType": "string", + "type": "array", + "name": "layers", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "pattern": "^[-._a-zA-Z][-._a-zA-Z0-9]*$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 2048, + "type": "string", + "name": "value", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "env", + "in": "body", + "required": false + }, + { + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "alias", + "in": "body", + "required": false + }, + { + "itemsRules": [ + { + "id": "sam-http-authType", + "kind": "required_if", + "field": "body.properties.authType", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.authType", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-http-enableUrlDecode", + "kind": "required_if", + "field": "body.properties.enableUrlDecode", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.enableUrlDecode", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-schedule", + "kind": "required_if", + "field": "body.properties.schedule", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.schedule", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-input", + "kind": "required_if", + "field": "body.properties.input", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.input", + "suggestion": "Supply the conditional event property using the source-defined type." + } + ], + "itemsProperties": [ + { + "pattern": "^[a-z][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "http", + "cron" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client" + ], + "type": "string", + "name": "authType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "enableUrlDecode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "schedule", + "in": "body", + "required": false + }, + { + "encodedJson": { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "value", + "in": "body", + "required": false + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "input", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "properties", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "events", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "properties", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "components", + "in": "body", + "required": true } ], - "body": "json", + "body": "name,components", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", - "officialSlug": "agcapi-scores-0000001985465938", - "direction": "inbound-callback", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-create-plan", + "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/scores", + "href": "/api/v1/templates/endpoints/create-plan", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay scores --invoke --body body.json", - "show": "agc gameplay scores --pretty" + "docs": "agc templates create-plan --docs --pretty", + "invoke": "agc templates create-plan --invoke --session-file SESSION.json --body body.json", + "show": "agc templates create-plan --pretty" } }, { - "id": "summary", - "familyId": "gameplay", - "name": "查询游戏概要信息", - "description": "华为游戏服务器调用此接口查询玩家在玩游戏的概要数据,并将信息展示在游戏中心的“在玩”页面上。", - "method": "POST", - "path": "{callbackUrl}", - "command": "agc gameplay summary", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "get-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates get-plan --docs --pretty" + }, + "id": "get-plan", + "familyId": "templates", + "name": "get-plan", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "GET", + "path": "/api/adm/v1/applications/plans/{planId}", + "command": "agc templates get-plan", "requiredParams": [ - "callbackUrl", - "callbackUrl" + "planId" ], "parameters": [ { - "name": "callbackUrl", - "in": "path", - "required": true, - "description": "callbackUrl parameter" - }, - { - "name": "callbackUrl", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "planId", "in": "path", - "required": true, - "description": "callbackUrl parameter" + "required": true } ], - "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", - "officialSlug": "agcapi-summary-0000002022225249", - "direction": "inbound-callback", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-get-plan", + "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/gameplay/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/gameplay/endpoints/summary", + "href": "/api/v1/templates/endpoints/get-plan", "method": "GET" } }, "affordances": { - "invoke": "agc gameplay summary --invoke --body body.json", - "show": "agc gameplay summary --pretty" + "docs": "agc templates get-plan --docs --pretty", + "invoke": "agc templates get-plan --invoke --session-file SESSION.json", + "show": "agc templates get-plan --pretty" } }, { - "id": "propapi-getroleinfo", - "familyId": "game-items", - "name": "查询玩家区服角色", - "description": "此接口用于查询玩家区服角色信息。", - "method": "POST", - "path": "{callbackUrl}", - "command": "agc game-items propapi-getroleinfo", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "apply-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates apply-plan --docs --pretty" + }, + "id": "apply-plan", + "familyId": "templates", + "name": "apply-plan", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "PUT", + "path": "/api/adm/v1/applications/{applicationId}/plans/{planId}", + "command": "agc templates apply-plan", "requiredParams": [ - "callbackUrl", - "callbackUrl" + "applicationId", + "planId" ], "parameters": [ { - "name": "callbackUrl", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "applicationId", "in": "path", - "required": true, - "description": "callbackUrl parameter" + "required": true }, { - "name": "callbackUrl", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "planId", "in": "path", - "required": true, - "description": "callbackUrl parameter" + "required": true } ], "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377", - "officialSlug": "agcapi-propapi-getroleinfo-0000002355255377", - "direction": "inbound-callback", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-apply-plan", + "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/game-items/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/game-items/endpoints/propapi-getroleinfo", + "href": "/api/v1/templates/endpoints/apply-plan", "method": "GET" } }, "affordances": { - "invoke": "agc game-items propapi-getroleinfo --invoke --body body.json", - "show": "agc game-items propapi-getroleinfo --pretty" + "docs": "agc templates apply-plan --docs --pretty", + "invoke": "agc templates apply-plan --invoke --session-file SESSION.json --body body.json", + "show": "agc templates apply-plan --pretty" } }, { - "id": "propapi-order", - "familyId": "game-items", - "name": "下单", - "description": "下单", + "authentication": "agcli-management-oauth", + "documentation": { + "title": "deploy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates deploy --docs --pretty" + }, + "id": "deploy", + "familyId": "templates", + "name": "deploy", + "description": "Reviewed native management transport; explicit user session required. Create-only SAM deployment: validate every local codeUri ZIP, search exact application name, upload code, create application, then independently query readiness. Existing applications are refused; use explicit create-plan/get-plan/apply-plan for updates. Local-only storageInstance and waitForReady are not sent to ADM. Uploaded artifacts may be retained after failure. Not a console gallery deployment.", "method": "POST", - "path": "{callbackUrl}", - "command": "agc game-items propapi-order", + "path": "native:templates/deploy", + "command": "agc templates deploy", "requiredParams": [ - "callbackUrl", - "callbackUrl" + "name", + "components", + "storageInstance" ], "parameters": [ { - "name": "callbackUrl", - "in": "path", - "required": true, - "description": "callbackUrl parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true }, { - "name": "callbackUrl", - "in": "path", - "required": true, - "description": "callbackUrl parameter" + "itemsProperties": [ + { + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Huawei::AGC::CloudFunctions" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "codeUri", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "runtime", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "500", + "1000", + "2000", + "4000" + ], + "type": "integer", + "name": "memorySize", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1800, + "type": "integer", + "name": "timeout", + "in": "body", + "required": true + }, + { + "pattern": "^[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "handler", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000, + "type": "integer", + "name": "instanceConcurrency", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "description", + "in": "body", + "required": false, + "description": "Vendor display width <=64; non-ASCII UTF-16 units count twice." + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxItems": 5, + "itemsType": "string", + "type": "array", + "name": "layers", + "in": "body", + "required": false + }, + { + "itemsProperties": [ + { + "pattern": "^[-._a-zA-Z][-._a-zA-Z0-9]*$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 2048, + "type": "string", + "name": "value", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "env", + "in": "body", + "required": false + }, + { + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "alias", + "in": "body", + "required": false + }, + { + "itemsRules": [ + { + "id": "sam-http-authType", + "kind": "required_if", + "field": "body.properties.authType", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.authType", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-http-enableUrlDecode", + "kind": "required_if", + "field": "body.properties.enableUrlDecode", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.enableUrlDecode", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-schedule", + "kind": "required_if", + "field": "body.properties.schedule", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.schedule", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-input", + "kind": "required_if", + "field": "body.properties.input", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.input", + "suggestion": "Supply the conditional event property using the source-defined type." + } + ], + "itemsProperties": [ + { + "pattern": "^[a-z][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "name", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "http", + "cron" + ], + "type": "string", + "name": "type", + "in": "body", + "required": true + }, + { + "properties": [ + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client" + ], + "type": "string", + "name": "authType", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "enableUrlDecode", + "in": "body", + "required": false + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "schedule", + "in": "body", + "required": false + }, + { + "encodedJson": { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "name": "value", + "in": "body", + "required": false + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "input", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "properties", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "type": "array", + "name": "events", + "in": "body", + "required": false + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "object", + "name": "properties", + "in": "body", + "required": true + } + ], + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minItems": 1, + "itemsType": "object", + "type": "array", + "name": "components", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "storageInstance", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "boolean", + "name": "waitForReady", + "in": "body", + "required": false } ], - "body": "json", + "body": "name,components,storageInstance,waitForReady", "status": "registered", - "source": "Huawei AppGallery Connect inbound callback reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666", - "officialSlug": "agcapi-propapi-order-0000002321296666", - "direction": "inbound-callback", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-deploy", + "direction": "native-workflow", "_links": { "family": { - "href": "/api/v1/game-items/endpoints", + "href": "/api/v1/templates/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/game-items/endpoints/propapi-order", + "href": "/api/v1/templates/endpoints/deploy", "method": "GET" } }, "affordances": { - "invoke": "agc game-items propapi-order --invoke --body body.json", - "show": "agc game-items propapi-order --pretty" + "docs": "agc templates deploy --docs --pretty", + "invoke": "agc templates deploy --invoke --session-file SESSION.json --body body.json", + "show": "agc templates deploy --pretty" } }, { - "id": "respackapi-addversion", - "familyId": "resources", - "name": "新增资源包版本", - "description": "创建“使用华为CDN”方式的资源包预下载任务。", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "execute-command", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache execute-command --docs --pretty" + }, + "id": "execute-command", + "familyId": "cache", + "name": "execute-command", + "description": "Reviewed native management transport; explicit user session required. ", "method": "POST", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions", - "command": "agc resources respackapi-addversion", + "path": "/agc/edge/scs/scs-service/v1/eval", + "command": "agc cache execute-command", "requiredParams": [ - "devId" + "command" ], "parameters": [ { - "name": "devId", - "in": "path", - "required": true, - "description": "devId parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 4096, + "type": "string", + "name": "command", + "in": "body", + "required": true + } + ], + "body": "command", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-execute-command", + "direction": "developer-to-huawei", + "_links": { + "family": { + "href": "/api/v1/cache/endpoints", + "method": "GET" + }, + "self": { + "href": "/api/v1/cache/endpoints/execute-command", + "method": "GET" } - ], - "body": "json", + }, + "affordances": { + "docs": "agc cache execute-command --docs --pretty", + "invoke": "agc cache execute-command --invoke --session-file SESSION.json --body body.json", + "show": "agc cache execute-command --pretty" + } + }, + { + "authentication": "agcli-management-cookie", + "documentation": { + "title": "connection-info", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache connection-info --docs --pretty" + }, + "id": "connection-info", + "familyId": "cache", + "name": "connection-info", + "description": "Reviewed native management transport; explicit user session required. projectId header comes from session.", + "method": "GET", + "path": "/agc/edge/scs/scs-service/v1/cache-invoke-address", + "command": "agc cache connection-info", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224", - "officialSlug": "agcapi-respackapi-addversion-0000002328396224", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-connection-info", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/cache/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-addversion", + "href": "/api/v1/cache/endpoints/connection-info", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-addversion --invoke --body body.json", - "show": "agc resources respackapi-addversion --pretty" + "docs": "agc cache connection-info --docs --pretty", + "invoke": "agc cache connection-info --invoke --session-file SESSION.json", + "show": "agc cache connection-info --pretty" } }, { - "id": "respackapi-deletefile", - "familyId": "resources", - "name": "删除资源包文件", - "description": "删除资源包任务文件,要求该资源包任务为下线状态。", - "method": "DELETE", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-files", - "command": "agc resources respackapi-deletefile", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "usage", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache usage --docs --pretty" + }, + "id": "usage", + "familyId": "cache", + "name": "usage", + "description": "Reviewed native management transport; explicit user session required. Epoch timestamps are milliseconds; interval at most three days, per source cmd/infoUsageStatistics.js.", + "method": "POST", + "path": "/agc/edge/spms/v1/query/metric/scs-metric", + "command": "agc cache usage", "requiredParams": [ - "devId" + "views", + "startTime", + "endTime" ], "parameters": [ { - "name": "devId", - "in": "path", - "required": true, - "description": "devId parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "query_cache_metric_trend" + ], + "type": "string", + "name": "views", + "in": "query", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 12960000, + "maximum": 2158876800000, + "type": "integer", + "name": "startTime", + "in": "query", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 12960000, + "maximum": 2158876800000, + "type": "integer", + "name": "endTime", + "in": "query", + "required": true } ], + "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228", - "officialSlug": "agcapi-respackapi-deletefile-0000002328396228", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-usage", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/cache/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-deletefile", + "href": "/api/v1/cache/endpoints/usage", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-deletefile --invoke", - "show": "agc resources respackapi-deletefile --pretty" + "docs": "agc cache usage --docs --pretty", + "invoke": "agc cache usage --invoke --session-file SESSION.json --body body.json", + "show": "agc cache usage --pretty" } }, { - "id": "respackapi-getversion", - "familyId": "resources", - "name": "查询资源包版本", - "description": "查询指定游戏下所有资源包版本的详细信息。", - "method": "GET", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions", - "command": "agc resources respackapi-getversion", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "enable-service", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache enable-service --docs --pretty" + }, + "id": "enable-service", + "familyId": "cache", + "name": "enable-service", + "description": "Reviewed native management transport; explicit user session required. Does not configure a password or prove the service is ready.", + "method": "POST", + "path": "/agc/edge/cpms/project-service/v1/services/order", + "command": "agc cache enable-service", "requiredParams": [ - "devId" + "projectId", + "serviceName" ], "parameters": [ { - "name": "devId", - "in": "path", - "required": true, - "description": "devId parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "type": "string", + "name": "projectId", + "in": "query", + "required": true + }, + { + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "cloudCache" + ], + "type": "string", + "name": "serviceName", + "in": "body", + "required": true } ], + "body": "serviceName", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745", - "officialSlug": "agcapi-respackapi-getversion-0000002362274745", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-enable-service", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/cache/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-getversion", + "href": "/api/v1/cache/endpoints/enable-service", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-getversion --invoke", - "show": "agc resources respackapi-getversion --pretty" + "docs": "agc cache enable-service --docs --pretty", + "invoke": "agc cache enable-service --invoke --session-file SESSION.json --body body.json", + "show": "agc cache enable-service --pretty" } }, { - "id": "respackapi-modifyversion", - "familyId": "resources", - "name": "修改资源包版本", - "description": "若isDraft传参为0,提交资源包预下载任务。", - "method": "PUT", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions", - "command": "agc resources respackapi-modifyversion", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "set-password", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache set-password --docs --pretty" + }, + "id": "set-password", + "familyId": "cache", + "name": "set-password", + "description": "Reviewed native management transport; explicit user session required. Password is write-only; resetting a used cache password can disrupt applications.", + "method": "POST", + "path": "/agc/edge/scs/scs-service/v1/cache-password", + "command": "agc cache set-password", "requiredParams": [ - "devId" + "password" ], "parameters": [ { - "name": "devId", - "in": "path", - "required": true, - "description": "devId parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 32, + "minLength": 8, + "type": "string", + "name": "password", + "in": "body", + "required": true } ], - "body": "json", + "body": "password", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372", - "officialSlug": "agcapi-respackapi-modifyversion-0000002328236372", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-set-password", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/cache/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-modifyversion", + "href": "/api/v1/cache/endpoints/set-password", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-modifyversion --invoke --body body.json", - "show": "agc resources respackapi-modifyversion --pretty" + "docs": "agc cache set-password --docs --pretty", + "invoke": "agc cache set-password --invoke --session-file SESSION.json --body body.json", + "show": "agc cache set-password --pretty" } }, { - "id": "respackapi-queryfile", - "familyId": "resources", - "name": "查询资源包文件", - "description": "查询资源包文件。", - "method": "GET", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-files", - "command": "agc resources respackapi-queryfile", + "authentication": "agcli-management-cookie", + "documentation": { + "title": "reset-password", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache reset-password --docs --pretty" + }, + "id": "reset-password", + "familyId": "cache", + "name": "reset-password", + "description": "Reviewed native management transport; explicit user session required. Password is write-only; resetting a used cache password can disrupt applications.", + "method": "PUT", + "path": "/agc/edge/scs/scs-service/v1/cache-password", + "command": "agc cache reset-password", "requiredParams": [ - "devId" + "password" ], "parameters": [ { - "name": "devId", - "in": "path", - "required": true, - "description": "devId parameter" + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 32, + "minLength": 8, + "type": "string", + "name": "password", + "in": "body", + "required": true } ], + "body": "password", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749", - "officialSlug": "agcapi-respackapi-queryfile-0000002362274749", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "officialSlug": "agcli-1.12.0-reset-password", "direction": "developer-to-huawei", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/cache/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-queryfile", + "href": "/api/v1/cache/endpoints/reset-password", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-queryfile --invoke", - "show": "agc resources respackapi-queryfile --pretty" + "docs": "agc cache reset-password --docs --pretty", + "invoke": "agc cache reset-password --invoke --session-file SESSION.json --body body.json", + "show": "agc cache reset-password --pretty" } }, { - "id": "respackapi-releaseversion", - "familyId": "resources", - "name": "发布资源包版本", - "description": "发布资源包下载任务。", - "method": "POST", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-version/publish", - "command": "agc resources respackapi-releaseversion", + "authentication": "callback-none", + "documentation": { + "title": "开发预加载资源接口", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch fetch-install --docs --pretty" + }, + "id": "fetch-install", + "familyId": "prefetch", + "name": "fetch-install", + "description": "", + "method": "GET", + "path": "{callbackUrl}", + "command": "agc prefetch fetch-install", "requiredParams": [ - "devId" + "callbackUrl", + "appId" ], "parameters": [ { - "name": "devId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "type": "string", + "name": "callbackUrl", "in": "path", - "required": true, - "description": "devId parameter" + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "type": "string", + "name": "appId", + "in": "query", + "required": true } ], - "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637", - "officialSlug": "agcapi-respackapi-releaseversion-0000002362394637", - "direction": "developer-to-huawei", + "source": "Huawei browser-reviewed developer server protocol", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "officialSlug": "cloudfoundation-prefetch-cloud-interdev", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/prefetch/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-releaseversion", + "href": "/api/v1/prefetch/endpoints/fetch-install", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-releaseversion --invoke --body body.json", - "show": "agc resources respackapi-releaseversion --pretty" + "invoke": "agc prefetch fetch-install --invoke", + "show": "agc prefetch fetch-install --pretty" } }, { - "id": "respackapi-uploadapplyfor", - "familyId": "resources", - "name": "资源包文件上传申请", - "description": "获取上传地址和必要参数,根据申请返回的信息完成文件上传。", - "method": "POST", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-file/apply", - "command": "agc resources respackapi-uploadapplyfor", + "authentication": "callback-none", + "documentation": { + "title": "开发预加载资源接口", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch fetch-periodic --docs --pretty" + }, + "id": "fetch-periodic", + "familyId": "prefetch", + "name": "fetch-periodic", + "description": "", + "method": "GET", + "path": "{callbackUrl}", + "command": "agc prefetch fetch-periodic", "requiredParams": [ - "devId" + "callbackUrl", + "appId" ], "parameters": [ { - "name": "devId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "type": "string", + "name": "callbackUrl", "in": "path", - "required": true, - "description": "devId parameter" + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "type": "string", + "name": "appId", + "in": "query", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "maxLength": 2048, + "type": "string", + "name": "token", + "in": "query", + "required": false + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "maxLength": 1024, + "type": "string", + "name": "params", + "in": "query", + "required": false } ], - "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376", - "officialSlug": "agcapi-respackapi-uploadapplyfor-0000002328236376", - "direction": "developer-to-huawei", + "source": "Huawei browser-reviewed developer server protocol", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "officialSlug": "cloudfoundation-prefetch-cloud-interdev", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/prefetch/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-uploadapplyfor", + "href": "/api/v1/prefetch/endpoints/fetch-periodic", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-uploadapplyfor --invoke --body body.json", - "show": "agc resources respackapi-uploadapplyfor --pretty" + "invoke": "agc prefetch fetch-periodic --invoke", + "show": "agc prefetch fetch-periodic --pretty" } }, { - "id": "respackapi-uploadconfirm", - "familyId": "resources", - "name": "资源包文件上传确认", - "description": "确认资源包文件已上传。", - "method": "POST", - "path": "/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-file/confirm", - "command": "agc resources respackapi-uploadconfirm", + "authentication": "callback-none", + "documentation": { + "title": "开发预加载资源接口", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch fetch-deferred --docs --pretty" + }, + "id": "fetch-deferred", + "familyId": "prefetch", + "name": "fetch-deferred", + "description": "", + "method": "GET", + "path": "{callbackUrl}", + "command": "agc prefetch fetch-deferred", "requiredParams": [ - "devId" + "callbackUrl", + "appId" ], "parameters": [ { - "name": "devId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "type": "string", + "name": "callbackUrl", "in": "path", - "required": true, - "description": "devId parameter" + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "type": "string", + "name": "appId", + "in": "query", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "type": "string", + "name": "link", + "in": "query", + "required": false } ], - "body": "json", "status": "registered", - "source": "Huawei AppGallery Connect API reference", - "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641", - "officialSlug": "agcapi-respackapi-uploadconfirm-0000002362394641", - "direction": "developer-to-huawei", + "source": "Huawei browser-reviewed developer server protocol", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "officialSlug": "cloudfoundation-prefetch-cloud-interdev", + "direction": "inbound-callback", "_links": { "family": { - "href": "/api/v1/resources/endpoints", + "href": "/api/v1/prefetch/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/resources/endpoints/respackapi-uploadconfirm", + "href": "/api/v1/prefetch/endpoints/fetch-deferred", "method": "GET" } }, "affordances": { - "invoke": "agc resources respackapi-uploadconfirm --invoke --body body.json", - "show": "agc resources respackapi-uploadconfirm --pretty" + "invoke": "agc prefetch fetch-deferred --invoke", + "show": "agc prefetch fetch-deferred --pretty" } }, { - "id": "build-hvigor", - "familyId": "cicd", - "name": "本地 Hvigor 构建", - "description": "Run local HarmonyOS Hvigor build and return artifact metadata.", + "authentication": "local-device", + "documentation": { + "title": "调试周期性预加载", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch device-getcache --docs --pretty" + }, + "id": "device-getcache", + "familyId": "prefetch", + "name": "Debug periodic prefetch on an explicit device", + "description": "", "method": "POST", - "path": "/local/hvigor/build", - "command": "agc cicd build-hvigor", + "path": "local:prefetch/device-getcache", + "command": "agc prefetch device-getcache", "requiredParams": [ - "project" + "bundleName", + "deviceId" ], "parameters": [ { - "name": "project", + "pattern": "^[A-Za-z][A-Za-z0-9_]*(?:\\.[A-Za-z][A-Za-z0-9_]*)+$", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "type": "string", + "name": "bundleName", "in": "body", - "required": true, - "description": "project parameter" + "required": true + }, + { + "pattern": "^[A-Za-z0-9._:-]+$", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "type": "string", + "name": "deviceId", + "in": "body", + "required": true + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "type": "string", + "name": "hdcPath", + "in": "body", + "required": false } ], - "body": "project", + "body": "bundleName,deviceId,hdcPath", "status": "registered", - "source": "agc-cli local integration", - "sourceUrl": "docs/AGC_CLI_FULL_PLAN.md", - "officialSlug": "local-hvigor-build", + "source": "Huawei browser-reviewed hdc command", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "officialSlug": "cloudfoundation-commandtool-debug", "direction": "local", "_links": { "family": { - "href": "/api/v1/cicd/endpoints", + "href": "/api/v1/prefetch/endpoints", "method": "GET" }, "self": { - "href": "/api/v1/cicd/endpoints/build-hvigor", + "href": "/api/v1/prefetch/endpoints/device-getcache", "method": "GET" } }, "affordances": { - "invoke": "agc cicd build-hvigor --invoke --body body.json", - "show": "agc cicd build-hvigor --pretty" + "invoke": "agc prefetch device-getcache --invoke --body body.json", + "show": "agc prefetch device-getcache --pretty" } } ] diff --git a/cmd/agc/command/agent_feedback_test.go b/cmd/agc/command/agent_feedback_test.go new file mode 100644 index 0000000..b742bde --- /dev/null +++ b/cmd/agc/command/agent_feedback_test.go @@ -0,0 +1,140 @@ +package command + +import ( + "encoding/json" + "strings" + "testing" +) + +// The missing test-version ID must fail before authentication/network access +// and give the Agent a documented, machine-readable correction. +func TestAgentReceivesConditionalParameterFeedback(t *testing.T) { + out, err := execute("--project", t.TempDir(), "publishing", "app-info-query-v3", "--invoke", "--query", "appId=fixture", "--query", "releaseType=6") + if err == nil { + t.Fatal("test-version request without versionId was accepted") + } + var result map[string]any + if json.Unmarshal([]byte(out), &result) != nil { + t.Fatalf("missing structured feedback: %q, %v", out, err) + } + raw, _ := json.Marshal(result) + for _, want := range []string{"versionId", "sourceUrl", "suggestion", "invalid_request"} { + if !strings.Contains(string(raw), want) { + t.Errorf("feedback missing %s: %s", want, raw) + } + } +} + +func TestVersionListAcceptsPackageNameWithoutApplicationHeader(t *testing.T) { + _, err := execute("--project", t.TempDir(), "publishing", "app-version-list", "--invoke", "--field", "packageName=app.example.fixture") + if err != nil { + t.Fatalf("official appId-or-packageName branch rejected: %v", err) + } +} + +func TestSourceDocumentArrayLimitIsEnforced(t *testing.T) { + _, err := execute("--project", t.TempDir(), "publishing", "qualification-review-create", "--invoke", "--header", "appId=fixture", "--field", `tagQualInfos=[{},{},{},{},{},{}]`) + if err == nil { + t.Fatal("six qualification groups accepted; official maximum is five") + } +} + +func TestBatchProductFieldsKeepDocumentedArrayShape(t *testing.T) { + out, err := execute("--project", t.TempDir(), "pms", "batchactproduct-harmonyosnext", "--pretty") + if err != nil { + t.Fatal(err) + } + var data struct { + Data struct { + Parameters []struct{ Name, In, Type string } + } + } + if json.Unmarshal([]byte(out), &data) != nil { + t.Fatal("invalid discovery output") + } + found := false + for _, p := range data.Data.Parameters { + if p.Name == "products" && p.In == "body" && p.Type == "array" { + found = true + } + } + if !found { + t.Fatal("official products array is missing from PMS contract") + } +} + +func TestUploadURLRequiresActualFileNameAndApplication(t *testing.T) { + _, err := execute("--project", t.TempDir(), "upload", "upload-url-new", "--invoke", "--query", "contentLength=1") + if err == nil { + t.Fatal("upload URL accepted without required appId and fileName") + } +} + +func TestFileGroupRejectsUndocumentedDeviceAndMissingObjects(t *testing.T) { + out, err := execute("--project", t.TempDir(), "publishing", "app-file-info-v3", "--invoke", "--query", "appId=fixture", "--field", `screenShotList=[{"lang":"zh_CN","fileInfoList":[{"deviceType":999}]}]`) + if err == nil { + t.Fatal("invalid nested FileInfo accepted") + } + for _, want := range []string{"deviceType", "objectIdList", "sourceUrl"} { + if !strings.Contains(out, want) { + t.Errorf("feedback missing %s: %s", want, out) + } + } +} + +func TestBatchSubscriptionRequiresDocumentedSubscriptionFields(t *testing.T) { + out, err := execute("--project", t.TempDir(), "pms", "batchaddproduct-harmonyosnext", "--invoke", "--header", "appId=fixture", "--field", "requestId=fixture", "--field", `products=[{"productNo":"fixture","productName":"fixture","productDesc":"fixture","purchaseType":"auto_subscription","defaultLocale":"zh_CN"}]`) + if err == nil { + t.Fatal("subscription without subscription group and period accepted") + } + for _, want := range []string{"products[0].subGroupId", "products[0].subPeriod", "sourceUrl"} { + if !strings.Contains(out, want) { + t.Errorf("feedback missing %s: %s", want, out) + } + } +} + +func TestBatchProductRejectsMalformedLanguageAndPriceModels(t *testing.T) { + base := `{"productNo":"fixture","productName":"fixture","productDesc":"fixture","purchaseType":"consumable","defaultLocale":"zh_CN",` + for _, tc := range []struct{ name, extra, field string }{ + {"long-language-name", `"languages":[{"locale":"en_US","productName":"` + strings.Repeat("a", 56) + `","productDesc":"fixture"}]}`, "products[0].languages[0].productName"}, + {"missing-price-currency", `"defaultPriceInfo":{"country":"CN"}}`, "products[0].defaultPriceInfo.currency"}, + {"wrong-language-type", `"languages":"invalid"}`, "products[0].languages"}, + } { + t.Run(tc.name, func(t *testing.T) { + out, err := execute("--project", t.TempDir(), "pms", "batchaddproduct-harmonyosnext", "--invoke", "--header", "appId=fixture", "--field", "requestId=fixture", "--field", "products=["+base+tc.extra+"]") + if err == nil { + t.Fatal("malformed nested model accepted") + } + if !strings.Contains(out, tc.field) { + t.Fatalf("missing nested field feedback: %s", out) + } + }) + } +} + +func TestReportDateWindowAndFilterPairsGiveCorrectiveFeedback(t *testing.T) { + for _, tc := range []struct { + name string + query []string + field string + }{ + {"invalid-date", []string{"startTime=20260230", "endTime=20261001"}, "startTime"}, + {"too-long", []string{"startTime=20260101", "endTime=20261001"}, "endTime"}, + {"mismatched-filter", []string{"startTime=20260901", "endTime=20261001", "filterCondition=countryId", "filterCondition=businessType", "filterConditionValue=CN"}, "filterConditionValue"}, + } { + t.Run(tc.name, func(t *testing.T) { + args := []string{"--project", t.TempDir(), "reports", "appdownloadexport", "--invoke", "--param", "appId=fixture", "--query", "language=en-US"} + for _, q := range tc.query { + args = append(args, "--query", q) + } + out, err := execute(args...) + if err == nil { + t.Fatal("invalid report request accepted") + } + if !strings.Contains(out, tc.field) || !strings.Contains(out, "sourceUrl") { + t.Fatalf("unhelpful feedback: %s", out) + } + }) + } +} diff --git a/cmd/agc/command/endpoint_transport_test.go b/cmd/agc/command/endpoint_transport_test.go index 83eab26..2ec7ee5 100644 --- a/cmd/agc/command/endpoint_transport_test.go +++ b/cmd/agc/command/endpoint_transport_test.go @@ -5,6 +5,8 @@ import ( "io" "net/http" "net/http/httptest" + "os" + "path/filepath" "strings" "testing" @@ -17,6 +19,13 @@ import ( // 所有请求都发送到本地测试服务器;通过不代表华为真实业务验收通过。 func TestEveryEndpointHTTPTransport(t *testing.T) { for _, endpoint := range domain.AllEndpoints() { + if domain.IsServerlessFamily(endpoint.FamilyID) { + testServerlessOperationHTTP(t, endpoint) + continue + } + if endpoint.Direction == "local" { + continue + } // 本地构建由独立执行器测试,不应发送 HTTP。 endpoint := endpoint t.Run(endpoint.FamilyID+"/"+endpoint.ID, func(t *testing.T) { t.Parallel() @@ -31,6 +40,7 @@ func TestEveryEndpointHTTPTransport(t *testing.T) { {"rate-limit", 429, `{"code":429,"message":"rate limited"}`, true}, } { t.Run(scenario.name, func(t *testing.T) { + resourceUpload := endpoint.FamilyID == "pms" && endpoint.ID == "resourcemanage-harmonyosnext" signed := endpoint.Path == "{uploadUrl}" seen := make(chan struct{}, 1) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -44,17 +54,30 @@ func TestEveryEndpointHTTPTransport(t *testing.T) { if r.Header.Get("X-Test-Fixture") != "fixture" { t.Error("explicit header missing") } - if signed && r.Header.Get("Authorization") != "" { + if (signed || endpoint.Direction == "inbound-callback" || endpoint.Authentication == "body-signature") && r.Header.Get("Authorization") != "" { t.Error("AGC bearer leaked into signed upload") } - if !signed && r.Header.Get("Authorization") != "Bearer offline-token" { + if !signed && endpoint.Direction != "inbound-callback" && endpoint.Authentication != "body-signature" && r.Header.Get("Authorization") != "Bearer offline-token" { t.Error("authorization missing") } if endpoint.Method == "POST" || endpoint.Method == "PUT" || endpoint.Method == "DELETE" { - body, err := io.ReadAll(r.Body) - var fields map[string]any - if err != nil || json.Unmarshal(body, &fields) != nil || fields["probeField"] != "payload" { - t.Error("JSON body field was lost") + if strings.HasPrefix(endpoint.RequestContentType, "application/x-www-form-urlencoded") { + if err := r.ParseForm(); err != nil || r.PostForm.Get("probeField") != "payload" { + t.Error("form body field was lost") + } + } else if resourceUpload { + if err := r.ParseMultipartForm(1024); err != nil || r.FormValue("probeField") != "payload" { + t.Error("multipart field was lost") + } + if r.MultipartForm != nil { + defer r.MultipartForm.RemoveAll() + } + } else { + body, err := io.ReadAll(r.Body) + var fields map[string]any + if err != nil || json.Unmarshal(body, &fields) != nil || (endpoint.DynamicBody == nil && fields["probeField"] != "payload") { + t.Error("JSON body field was lost") + } } } w.Header().Set("Content-Type", "application/json") @@ -64,27 +87,48 @@ func TestEveryEndpointHTTPTransport(t *testing.T) { defer server.Close() args := []string{endpoint.FamilyID, endpoint.ID, "--invoke", "--dry-run=false", "--base-url", server.URL, "--token", "offline-token", "--query", "probe=a b&c", "--header", "X-Test-Fixture=fixture"} for _, p := range endpoint.Parameters { - if !p.Required { + if resourceUpload && p.In == "file" { continue } - value := "fixture" - if p.In == "body" && (p.Type == "integer" || p.Type == "number") { - value = "1" - } - if p.In == "body" && p.Type == "array" { - value = `["fixture"]` - } - if p.In == "body" && p.Type == "object" { - value = `{"key":"fixture"}` + if !p.Required { + continue } + value := parameterFixture(p) if p.Name == "callbackUrl" || p.Name == "uploadUrl" { value = server.URL + "/target" } option := map[string]string{"path": "--param", "query": "--query", "header": "--header", "body": "--field", "file": "--field"}[p.In] args = append(args, option, p.Name+"="+value) } + if resourceUpload { + file := filepath.Join(t.TempDir(), "fixture.png") + if err := os.WriteFile(file, []byte("offline-image"), 0600); err != nil { + t.Fatal(err) + } + args = append(args, "--file", file) + } if endpoint.Method == "POST" || endpoint.Method == "PUT" || endpoint.Method == "DELETE" { - args = append(args, "--field", "probeField=payload") + if endpoint.DynamicBody == nil { + args = append(args, "--field", "probeField=payload") + } + } + if endpoint.DynamicBody != nil { + args = append(args, "--field", "additionalProp1="+parameterFixture(*endpoint.DynamicBody)) + } + if endpoint.FamilyID == "resources" && endpoint.ID == "respackapi-queryfile" { + args = append(args, "--query", "versionId=1") + } + if endpoint.FamilyID == "projects" && endpoint.ID == "appbriefinfo" { + args = append(args, "--query", "packageNames=app.example.fixture") + } + if endpoint.FamilyID == "publishing" && endpoint.ID == "app-version-list" { + args = append(args, "--header", "appId=fixture") + } + if endpoint.FamilyID == "upload" && endpoint.ID == "obbfile-init" { + args = append(args, "--query", "fileType=1") + } + if endpoint.FamilyID == "publishing" && endpoint.ID == "app-create" { + args = append(args, "--field", "packageName=app.example.fixture") } out, err := execute(args...) select { @@ -106,3 +150,50 @@ func TestEveryEndpointHTTPTransport(t *testing.T) { }) } } + +func TestReportFilterQueryPreservesEveryValueAndItsOrder(t *testing.T) { + called := false + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + for key, want := range map[string][]string{"filterCondition": {"countryId", "businessType"}, "filterConditionValue": {"CN", "AppGallery"}} { + got := r.URL.Query()[key] + if strings.Join(got, "|") != strings.Join(want, "|") { + t.Errorf("%s lost ordered query values: %v", key, got) + } + } + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{"code":0}`)) + })) + defer server.Close() + _, err := execute("--project", t.TempDir(), "reports", "appdownloadexport", "--invoke", "--dry-run=false", "--token", "offline-report-token", "--base-url", server.URL, "--param", "appId=fixture", "--query", "language=en-US", "--query", "startTime=20260901", "--query", "endTime=20261001", "--query", "filterCondition=countryId", "--query", "filterCondition=businessType", "--query", "filterConditionValue=CN", "--query", "filterConditionValue=AppGallery") + if err != nil { + t.Fatal(err) + } + if !called { + t.Fatal("transport was not exercised") + } +} + +func TestGameCallbackCLIWorksWithoutHuaweiAuthorization(t *testing.T) { + received := make(chan struct{}, 1) + upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + received <- struct{}{} + if r.Header.Get("Authorization") != "" { + t.Error("unexpected Huawei authorization on callback") + } + if err := r.ParseForm(); err != nil || r.PostForm.Get("sign") != "a+b/=" { + t.Error("callback signature was not encoded exactly once") + } + _, _ = w.Write([]byte(`{"code":0}`)) + })) + defer upstream.Close() + _, err := execute("--project", t.TempDir(), "game-items", "propapi-getroleinfo", "--invoke", "--dry-run=false", "--param", "callbackUrl="+upstream.URL, "--field", "userId=offline-player", "--field", "userIdType=1", "--field", "ts=123", "--field", "sign=a+b/=") + if err != nil { + t.Fatal(err) + } + select { + case <-received: + default: + t.Fatal("CLI did not invoke callback server") + } +} diff --git a/cmd/agc/command/fixture_helpers_test.go b/cmd/agc/command/fixture_helpers_test.go new file mode 100644 index 0000000..0d56f81 --- /dev/null +++ b/cmd/agc/command/fixture_helpers_test.go @@ -0,0 +1,79 @@ +package command + +import ( + "encoding/json" + "fmt" + "github.com/Createitv/agc-cli/pkg/domain" + "strings" + "time" +) + +// Registry-wide smoke tests need syntactically valid values; the independent +// official-reference test owns the method, location, and serialization oracle. +func parameterFixture(p domain.Parameter) string { + if p.Type == "string" && p.Format == "date" { + return time.Now().UTC().AddDate(0, 0, 31).Format("2006-01-02") + } + if p.EncodedJSON != nil { + return parameterFixture(*p.EncodedJSON) + } + if p.Name == "currency" { + return "CNY" + } + if p.In == "query" && (p.Name == "startTime" || p.Name == "endTime") && strings.Contains(p.Description, "YYYYMMDD") { + return "20261001" + } + if len(p.Enum) > 0 { + return p.Enum[0] + } + if p.Type == "integer" || p.Type == "number" { + if p.Minimum != nil { + return fmt.Sprint(*p.Minimum) + } + return "1" + } + if p.Type == "array" { + switch p.ItemsType { + case "object": + if len(p.ItemsProperties) > 0 { + fields := map[string]any{} + for _, child := range p.ItemsProperties { + raw := parameterFixture(child) + var value any + if child.Type == "string" { + value = raw + } else { + _ = json.Unmarshal([]byte(raw), &value) + } + fields[child.Name] = value + } + encoded, _ := json.Marshal([]any{fields}) + return string(encoded) + } + return `[{"key":"fixture"}]` + case "integer": + return `[1]` + default: + return `["fixture"]` + } + } + if p.Type == "object" { + if len(p.Properties) > 0 { + fields := map[string]any{} + for _, child := range p.Properties { + raw := parameterFixture(child) + var value any + if child.Type == "string" { + value = raw + } else { + _ = json.Unmarshal([]byte(raw), &value) + } + fields[child.Name] = value + } + encoded, _ := json.Marshal(fields) + return string(encoded) + } + return `{"key":"fixture"}` + } + return "fixture" +} diff --git a/cmd/agc/command/functions.go b/cmd/agc/command/functions.go new file mode 100644 index 0000000..57b04f4 --- /dev/null +++ b/cmd/agc/command/functions.go @@ -0,0 +1,125 @@ +package command + +import ( + "encoding/json" + "fmt" + "os" + + "github.com/Createitv/agc-cli/pkg/cloudfunctions" + "github.com/Createitv/agc-cli/pkg/domain" + "github.com/Createitv/agc-cli/pkg/output" + "github.com/Createitv/agc-cli/pkg/project" + "github.com/spf13/cobra" +) + +func functionEndpointCommand(opts *options, e domain.Endpoint) *cobra.Command { + r := domain.FunctionRequest{DryRun: true} + var invoke, docs bool + var payload, payloadFile, environment, environmentFile string + var memory, timeout, concurrency int + var handler string + var layers []string + cmd := &cobra.Command{Use: e.ID, Short: e.Name, RunE: func(cmd *cobra.Command, args []string) (runErr error) { + defer func() { + if runErr != nil && opts.output == "json" { + cmd.Root().SilenceErrors = true + cmd.Root().SilenceUsage = true + _ = output.Write(cmd.OutOrStdout(), domain.ErrorEnvelope{Error: cloudfunctions.Feedback(e.ID, runErr)}, output.JSON, opts.pretty) + } + }() + if docs { + raw, ok := domain.EndpointReference(e.FamilyID, e.ID) + if !ok { + return fmt.Errorf("source document missing") + } + return output.Write(cmd.OutOrStdout(), domain.Envelope[json.RawMessage]{Data: raw}, output.Format(opts.output), opts.pretty) + } + if !invoke { + return output.Write(cmd.OutOrStdout(), domain.Envelope[domain.Endpoint]{Data: e}, output.Format(opts.output), opts.pretty) + } + if payload != "" && payloadFile != "" { + return fmt.Errorf("payload and payload-file are mutually exclusive") + } + if environment != "" && environmentFile != "" { + return fmt.Errorf("environment and environment-file are mutually exclusive") + } + if payloadFile != "" { + b, err := os.ReadFile(payloadFile) + if err != nil { + return fmt.Errorf("cannot read payload-file") + } + r.Payload = b + } else if payload != "" { + r.Payload = json.RawMessage(payload) + } + if environmentFile != "" { + b, err := os.ReadFile(environmentFile) + if err != nil { + return fmt.Errorf("cannot read environment-file") + } + environment = string(b) + } + if environment != "" { + var env map[string]string + if err := json.Unmarshal([]byte(environment), &env); err != nil || env == nil { + return fmt.Errorf("environment must be a JSON object of string values") + } + r.Environment = &env + } + if cmd.Flags().Changed("memory") { + r.Memory = &memory + } + if cmd.Flags().Changed("timeout") { + r.Timeout = &timeout + } + if cmd.Flags().Changed("instance-concurrency") { + r.InstanceConcurrency = &concurrency + } + if cmd.Flags().Changed("handler") { + r.Handler = &handler + } + if cmd.Flags().Changed("layers") { + r.Layers = &layers + } + if r.ProjectID == "" { + config, err := project.Load(opts.project) + if err == nil { + r.ProjectID = config.ProjectID + } else if !os.IsNotExist(err) { + return fmt.Errorf("cannot load project context") + } + } + result, err := (&cloudfunctions.Client{}).Execute(cmd.Context(), e.ID, r) + if err != nil { + return err + } + return output.Write(cmd.OutOrStdout(), domain.Envelope[cloudfunctions.Response]{Data: result}, output.Format(opts.output), opts.pretty) + }} + f := cmd.Flags() + f.BoolVar(&invoke, "invoke", false, "Run this native workflow") + f.BoolVar(&docs, "docs", false, "Read official vendor source evidence and limitations") + f.BoolVar(&r.DryRun, "dry-run", true, "Validate locally without reading authorization or contacting Huawei") + f.StringVar(&r.Name, "name", "", "Function name") + f.StringVar(&r.SessionFile, "session-file", "", "Explicit user OAuth session JSON (never publishing credentials)") + f.StringVar(&r.BaseURL, "base-url", "", "Project service base URL, or session projectBaseUrl") + f.StringVar(&r.ProjectID, "project-id", "", "Selected project; must match session productId") + f.StringVar(&r.CodePath, "code-path", "", "Local ZIP deployment package") + f.StringVar(&r.Runtime, "runtime", "", "Runtime, defaults to reviewed AGCLI nodejs14.x contract") + f.StringVar(&handler, "handler", "", "Function entry handler") + f.StringVar(&r.Description, "description", "", "Function description") + f.StringVar(&r.VersionDescription, "version-description", "", "Required publish description") + f.StringVar(&r.Version, "version", "", "Function version or $latest") + f.StringVar(&r.AliasName, "alias-name", "", "Invoke alias; mutually exclusive with version") + f.IntVar(&memory, "memory", 0, "Memory in MiB") + f.IntVar(&timeout, "timeout", 0, "Function timeout in seconds") + f.IntVar(&concurrency, "instance-concurrency", 0, "Concurrent instances") + f.StringVar(&environment, "environment", "", "Environment JSON object; values are never echoed") + f.StringVar(&environmentFile, "environment-file", "", "Environment JSON file") + f.StringSliceVar(&layers, "layers", nil, "Layer names or URNs with versions, max five") + f.StringVar(&payload, "payload", "", "Arbitrary valid JSON invocation event") + f.StringVar(&payloadFile, "payload-file", "", "JSON invocation event file") + f.StringVar(&r.FuzzyName, "fuzzy-name", "", "Function search filter") + f.IntVar(&r.PageSize, "page-size", 0, "Page size, defaults 10") + f.IntVar(&r.PageIndex, "page-index", 0, "Page index, defaults 1") + return cmd +} diff --git a/cmd/agc/command/hvigor_test.go b/cmd/agc/command/hvigor_test.go new file mode 100644 index 0000000..9ec8f52 --- /dev/null +++ b/cmd/agc/command/hvigor_test.go @@ -0,0 +1,23 @@ +package command + +import ( + "path/filepath" + "strings" + "testing" +) + +func TestHvigorLocalCommandDoesNotRequireHuaweiAuthorization(t *testing.T) { + t.Setenv("AGC_CONFIG_DIR", t.TempDir()) + _, err := execute("cicd", "build-hvigor", "--invoke", "--dry-run=false", "--credentials-path", filepath.Join(t.TempDir(), "absent.json"), "--field", "project="+t.TempDir()) + if err == nil || !strings.Contains(err.Error(), "build-profile.json5") { + t.Fatalf("expected local project error without credential loading: %v", err) + } +} + +func TestHvigorDryRunDoesNotExecuteProject(t *testing.T) { + t.Setenv("AGC_CONFIG_DIR", t.TempDir()) + output, err := execute("cicd", "build-hvigor", "--invoke", "--field", "project=/does/not/exist") + if err != nil || !strings.Contains(output, `"dryRun":true`) { + t.Fatalf("dry run should describe local build without executing: %s %v", output, err) + } +} diff --git a/cmd/agc/command/identity_command_test.go b/cmd/agc/command/identity_command_test.go new file mode 100644 index 0000000..64fbbc9 --- /dev/null +++ b/cmd/agc/command/identity_command_test.go @@ -0,0 +1,60 @@ +package command + +import ( + "net/http" + "net/http/httptest" + "path/filepath" + "strings" + "testing" +) + +func TestAuthWhoAmIShowsActiveIdentityWithoutSecrets(t *testing.T) { + path := filepath.Join(t.TempDir(), "credentials.json") + if _, err := execute("auth", "login", "--client-id", "developer-client", "--client-key", "test-secret", "--name", "production", "--credentials-path", path); err != nil { + t.Fatal(err) + } + out, err := execute("auth", "whoami", "--credentials-path", path) + if err != nil { + t.Fatal(err) + } + if !strings.Contains(out, `"name":"production"`) || !strings.Contains(out, `"clientId":"developer-client"`) || !strings.Contains(out, `"teamLookup":"oauth-required"`) { + t.Fatalf("output = %s", out) + } + if strings.Contains(out, "test-secret") || strings.Contains(out, "clientKey") { + t.Fatal("whoami output exposes client key") + } +} + +func TestAuthWhoAmIReadsOfficialOAuthTeamList(t *testing.T) { + t.Setenv("AGC_OAUTH2_TOKEN", "oauth-test-secret") + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/api/ups/user-permission-service/v1/user-team-list" { + t.Errorf("path = %s", r.URL.Path) + } + if r.Header.Get("oauth2Token") != "oauth-test-secret" { + t.Error("missing OAuth team-list token") + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"ret":{"code":0,"msg":"success"},"teams":[{"teamId":"team-1","teamName":"Example Studio"}]}`)) + })) + defer srv.Close() + + out, err := execute("auth", "whoami", "--teams", "--base-url", srv.URL, "--credentials-path", filepath.Join(t.TempDir(), "missing.json")) + if err != nil { + t.Fatal(err) + } + if !strings.Contains(out, `"teamLookup":"verified"`) || !strings.Contains(out, `"teamName":"Example Studio"`) { + t.Fatalf("output = %s", out) + } + if strings.Contains(out, "oauth-test-secret") { + t.Fatal("whoami output exposes OAuth token") + } +} + +func TestAuthWhoAmITeamsRequiresOAuthToken(t *testing.T) { + t.Setenv("AGC_OAUTH2_TOKEN", "") + _, err := execute("auth", "whoami", "--teams", "--credentials-path", filepath.Join(t.TempDir(), "missing.json")) + if err == nil || !strings.Contains(err.Error(), "AGC_OAUTH2_TOKEN") { + t.Fatalf("error = %v", err) + } +} diff --git a/cmd/agc/command/management_session_test.go b/cmd/agc/command/management_session_test.go new file mode 100644 index 0000000..33d6f11 --- /dev/null +++ b/cmd/agc/command/management_session_test.go @@ -0,0 +1,61 @@ +package command + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" + "time" +) + +func TestManagementCookieSessionNeverUsesPublishingCredentials(t *testing.T) { + calls := 0 + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + calls++ + if r.Method != "POST" || r.URL.Path != "/agc/edge/scs/scs-service/v1/eval" { + t.Errorf("wrong transport %s %s", r.Method, r.URL) + } + if r.Header.Get("Authorization") != "" || r.Header.Get("oauth2Token") != "offline-oauth" || r.Header.Get("projectId") != "offline-project" || r.Header.Get("agcTeamId") != "offline-team" || r.Header.Get("Cookie") != "authInfo=offline-auth;csrfToken=offline-csrf;" || r.Header.Get("X-HD-CSRF") != "offline-csrf" { + t.Error("missing explicit management-session context") + } + var body map[string]string + json.NewDecoder(r.Body).Decode(&body) + if body["command"] != "GET offline-key" { + t.Error("command changed") + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"code":0,"result":"ok"}`)) + })) + defer srv.Close() + dir := t.TempDir() + file := filepath.Join(dir, "session.json") + b, _ := json.Marshal(map[string]any{"uid": "offline-user", "teamId": "offline-team", "productId": "offline-project", "accessToken": "offline-oauth", "authInfo": "offline-auth", "csrfToken": "offline-csrf", "expiresAt": time.Now().Add(time.Hour), "projectEdgeBaseUrl": srv.URL}) + os.WriteFile(file, b, 0600) + out, err := execute("cache", "execute-command", "--invoke", "--dry-run=false", "--session-file", file, "--field", "command=GET offline-key") + if err != nil || calls != 1 { + t.Fatalf("calls=%d err=%v output=%s", calls, err, out) + } + for _, forbidden := range []string{"offline-oauth", "offline-auth", "offline-csrf"} { + if containsString(out, forbidden) { + t.Error("credential leaked") + } + } +} + +func containsString(s, v string) bool { + for i := 0; i+len(v) <= len(s); i++ { + if s[i:i+len(v)] == v { + return true + } + } + return false +} + +func TestManagementDryRunDoesNotReadSession(t *testing.T) { + out, err := execute("cache", "execute-command", "--invoke", "--session-file", "/does-not-exist", "--field", "command=GET offline-key") + if err != nil { + t.Fatalf("dry-run loaded authorization: %v %s", err, out) + } +} diff --git a/cmd/agc/command/management_transport_test.go b/cmd/agc/command/management_transport_test.go new file mode 100644 index 0000000..c16d803 --- /dev/null +++ b/cmd/agc/command/management_transport_test.go @@ -0,0 +1,128 @@ +package command + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/Createitv/agc-cli/internal/managementtest" + "github.com/Createitv/agc-cli/pkg/domain" +) + +func managementArgs(t *testing.T, e domain.Endpoint, f managementtest.Fixture, base string, dry bool) []string { + t.Helper() + session := "/must-not-read-management-session" + if !dry { + session = managementtest.SessionFile(t, base) + } + args := []string{"--project", t.TempDir(), e.FamilyID, e.ID, "--invoke", "--session-file", session, "--base-url", base} + if !dry { + args = append(args, "--dry-run=false") + } + for k, v := range f.Params { + args = append(args, "--param", k+"="+v) + } + for k, v := range f.Query { + args = append(args, "--query", k+"="+v) + } + if len(f.Body) > 0 { + p := filepath.Join(t.TempDir(), "body.json") + b, _ := json.Marshal(f.Body) + os.WriteFile(p, b, 0600) + args = append(args, "--body", p) + } + return args +} + +func testReviewedManagementCLI(t *testing.T, e domain.Endpoint) { + if e.FamilyID == "templates" && e.ID == "deploy" { + testTemplateDeployCLI(t, e, false) + return + } + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + f, ok := managementtest.Fixtures()[e.FamilyID+"/"+e.ID] + if !ok { + t.Fatal("missing independent source fixture") + } + for _, scenario := range []struct { + name string + status int + body string + fail bool + }{{"success", 200, `{"code":0,"result":{"marker":"received"}}`, false}, {"business-error", 200, `{"code":17,"message":"denied"}`, true}, {"http-error", 403, `{"code":19,"message":"forbidden"}`, true}} { + t.Run(scenario.name, func(t *testing.T) { + calls := 0 + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + calls++ + managementtest.AssertRequest(t, r, f) + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(scenario.status) + w.Write([]byte(scenario.body)) + })) + defer srv.Close() + out, err := execute(managementArgs(t, e, f, srv.URL, false)...) + if calls != 1 || (err != nil) != scenario.fail { + t.Fatalf("calls=%d error=%v output=%s", calls, err, out) + } + if !json.Valid([]byte(out)) { + t.Fatal("non-JSON feedback") + } + }) + } + }) +} + +func testReviewedManagementDryRun(t *testing.T, e domain.Endpoint) { + if e.FamilyID == "templates" && e.ID == "deploy" { + testTemplateDeployCLI(t, e, true) + return + } + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + f, ok := managementtest.Fixtures()[e.FamilyID+"/"+e.ID] + if !ok { + t.Fatal("fixture missing") + } + out, err := execute(managementArgs(t, e, f, "https://offline.example", true)...) + if err != nil || !strings.Contains(out, `"dryRun":true`) { + t.Fatalf("%v %s", err, out) + } + }) +} + +func testTemplateDeployCLI(t *testing.T, e domain.Endpoint, dry bool) { + t.Run("templates/deploy", func(t *testing.T) { + srv, body := managementtest.Deployment(t) + defer srv.Close() + f := managementtest.Fixture{Body: body} + out, err := execute(managementArgs(t, e, f, srv.URL, dry)...) + if err != nil { + t.Fatalf("%v %s", err, out) + } + if !dry && !strings.Contains(out, `"ready":true`) { + t.Fatal("deployment readiness not read back") + } + }) +} + +func testPrefetchDeviceCLI(t *testing.T, e domain.Endpoint, dry bool) { + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + args := []string{"prefetch", e.ID, "--invoke", "--field", "bundleName=com.example.offline", "--field", "deviceId=offline-device"} + hdc := "/must-not-execute" + if !dry { + hdc = managementtest.HDCFile(t) + args = append(args, "--dry-run=false") + } + args = append(args, "--field", "hdcPath="+hdc) + out, err := execute(args...) + if err != nil { + t.Fatalf("%v %s", err, out) + } + if !dry && !strings.Contains(out, `"dataFreshnessVerified":false`) { + t.Fatal("device debug misreported") + } + }) +} diff --git a/cmd/agc/command/publishing_current_test.go b/cmd/agc/command/publishing_current_test.go new file mode 100644 index 0000000..7a275c3 --- /dev/null +++ b/cmd/agc/command/publishing_current_test.go @@ -0,0 +1,221 @@ +package command + +import ( + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "strings" + "testing" +) + +type publishingReference struct { + Endpoints []struct { + ID string `json:"id"` + Method string `json:"method"` + Path string `json:"path"` + Parameters []struct { + Name string `json:"name"` + In string `json:"in"` + Type string `json:"type"` + Required bool `json:"required"` + Example string `json:"example"` + } `json:"parameters"` + } `json:"endpoints"` +} + +// This fixture was read from official Huawei parameter tables, independently +// of the production registry. Wrong paths, absent commands and misplaced or +// stringified body values must fail at the actual CLI -> HTTP boundary. +func TestCurrentPublishingRequestsMatchOfficialReference(t *testing.T) { + raw, err := os.ReadFile("testdata/publishing-current.json") + if err != nil { + t.Fatal(err) + } + var reference publishingReference + if err = json.Unmarshal(raw, &reference); err != nil { + t.Fatal(err) + } + if len(reference.Endpoints) != 31 { + t.Fatalf("expected 31 official operations, got %d", len(reference.Endpoints)) + } + for _, e := range reference.Endpoints { + t.Run(e.ID, func(t *testing.T) { + args := []string{"--project", t.TempDir(), "publishing", e.ID, "--invoke", "--dry-run=false", "--token", "offline-publishing-token"} + values := map[string]any{} + for _, p := range e.Parameters { + var value any = "fixture" + encoded := "fixture" + if p.In == "body" { + switch { + case strings.HasPrefix(p.Type, "Integer"): + value = float64(1) + encoded = "1" + case strings.HasPrefix(p.Type, "List": + encoded = `[{"deviceType":4}]` + json.Unmarshal([]byte(encoded), &value) + case p.Type == "List": + encoded = `[{"lang":"zh","baseInfo":{"name":"验证协议"}}]` + json.Unmarshal([]byte(encoded), &value) + case p.Type == "List": + encoded = `[{"tagId":"30000322","taskId":"fixture-task"}]` + json.Unmarshal([]byte(encoded), &value) + case p.Type == "List": + encoded = `[{"versionId":"fixture-version","packageId":"fixture-package","vocId":"fixture-voc"}]` + json.Unmarshal([]byte(encoded), &value) + case p.Type == "List": + encoded = `[{"lang":"zh_CN","fileInfoList":[{"deviceType":4,"objectIdList":["fixture"]}]}]` + json.Unmarshal([]byte(encoded), &value) + case p.Type == "List": + encoded = `[{"lang":"zh_CN","permissionName":"ohos.permission.fixture","deviceType":4,"objectId":"fixture"}]` + json.Unmarshal([]byte(encoded), &value) + case strings.HasPrefix(p.Type, "List<"): + value = []any{map[string]any{"fixture": "value"}} + encoded = `[{"fixture":"value"}]` + case !strings.HasPrefix(p.Type, "String"): + value = map[string]any{"fixture": "value"} + encoded = `{"fixture":"value"}` + } + } + if strings.HasPrefix(p.Type, "Integer") && p.In != "body" { + encoded = "1" + value = "1" + } + if p.Example != "" { + encoded = p.Example + if p.In == "body" && strings.HasPrefix(p.Type, "Integer") { + json.Unmarshal([]byte(encoded), &value) + } else { + value = encoded + } + } + values[p.In+"/"+p.Name] = value + flag := map[string]string{"query": "--query", "header": "--header", "body": "--field"}[p.In] + args = append(args, flag, p.Name+"="+encoded) + } + called := false + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + if r.Method != e.Method || r.URL.Path != e.Path { + t.Errorf("got %s %s, want %s %s", r.Method, r.URL.Path, e.Method, e.Path) + } + if r.Header.Get("Authorization") != "Bearer offline-publishing-token" { + t.Error("authorization missing") + } + var body map[string]any + raw, _ := io.ReadAll(r.Body) + if len(raw) > 0 && json.Unmarshal(raw, &body) != nil { + t.Error("invalid JSON body") + } + for _, p := range e.Parameters { + want := values[p.In+"/"+p.Name] + switch p.In { + case "query": + if r.URL.Query().Get(p.Name) != want { + t.Errorf("query %s missing", p.Name) + } + case "header": + if r.Header.Get(p.Name) != want { + t.Errorf("header %s missing", p.Name) + } + case "body": + got, _ := json.Marshal(body[p.Name]) + expected, _ := json.Marshal(want) + if string(got) != string(expected) { + t.Errorf("body %s=%s, want %s", p.Name, got, expected) + } + } + } + w.Header().Set("Content-Type", "application/json") + io.WriteString(w, `{"ret":{"code":0,"msg":"success"}}`) + })) + defer server.Close() + args = append(args, "--base-url", server.URL) + _, err := execute(args...) + if err != nil { + t.Fatal(err) + } + if !called { + t.Fatal("CLI never sent request") + } + }) + } +} + +func TestPublishingVersionListSendsEmptyJSONObject(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + raw, _ := io.ReadAll(r.Body) + if strings.TrimSpace(string(raw)) != "{}" { + t.Errorf("got body %q, want {}", raw) + } + io.WriteString(w, `{"ret":{"code":0}}`) + })) + defer server.Close() + _, err := execute("--project", t.TempDir(), "publishing", "app-version-list", "--invoke", "--dry-run=false", "--token", "offline", "--base-url", server.URL, "--header", "appId=fixture") + if err != nil { + t.Fatal(err) + } +} + +func TestPublishingAgreementListsAcceptExplicitEmptyName(t *testing.T) { + for _, id := range []string{"user-agreement-list", "privacy-agreement-list"} { + t.Run(id, func(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + var body map[string]any + json.NewDecoder(r.Body).Decode(&body) + if name, ok := body["name"]; !ok || name != "" { + t.Errorf("expected explicit empty name, got %v", body) + } + io.WriteString(w, `{"ret":{"code":0}}`) + })) + defer server.Close() + _, err := execute("--project", t.TempDir(), "publishing", id, "--invoke", "--dry-run=false", "--token", "offline", "--base-url", server.URL, "--header", "appId=fixture", "--field", "name=") + if err != nil { + t.Fatal(err) + } + }) + } +} + +// Huawei's creation table says AgreementInfo, but its description and request +// example explicitly use an array of localized agreements with nested baseInfo. +func TestPublishingUserAgreementAcceptsOfficialArrayExample(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + var body map[string]any + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + t.Fatal(err) + } + locales, ok := body["agreementInfos"].([]any) + if !ok || len(locales) != 1 { + t.Errorf("expected localized agreement array, got %v", body) + } + if body["channel"] != float64(1) { + t.Errorf("channel must remain a JSON integer, got %v", body["channel"]) + } + io.WriteString(w, `{"ret":{"code":0}}`) + })) + defer server.Close() + _, err := execute("--project", t.TempDir(), "publishing", "user-agreement-create", "--invoke", "--dry-run=false", "--token", "offline", "--base-url", server.URL, "--header", "appId=fixture", "--field", "type=2", "--field", "channel=1", "--field", `agreementInfos=[{"lang":"zh","baseInfo":{"name":"Fixture","agreementTitle":"Fixture terms","userAgreementUrl":"https://example.com/terms"}}]`) + if err != nil { + t.Fatal(err) + } +} + +func TestPublishingHelpExplainsRequiredParameterLocations(t *testing.T) { + out, err := execute("publishing", "app-package-info-update", "--help") + if err != nil { + t.Fatal(err) + } + for _, want := range []string{"--query appId=", "--field fileName=", "--field objectId="} { + if !strings.Contains(out, want) { + t.Errorf("help missing %q", want) + } + } +} diff --git a/cmd/agc/command/publishing_privacy_test.go b/cmd/agc/command/publishing_privacy_test.go new file mode 100644 index 0000000..8752456 --- /dev/null +++ b/cmd/agc/command/publishing_privacy_test.go @@ -0,0 +1,31 @@ +package command + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +func TestPrivacyCLIRejectsDeepInputBeforeNetwork(t *testing.T) { + called := false + upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + t.Error("invalid input reached transport") + })) + defer upstream.Close() + out, err := execute("--project", t.TempDir(), "publishing", "privacy-agreement-update", "--invoke", "--dry-run=false", "--token", "offline-fixture", "--base-url", upstream.URL, "--header", "appId=fixture", "--field", "id=fixture", "--field", `agreementInfos=[{"lang":"zh","thirdSdkInfo":{"sdkInfos":[{"privacyLabels":[{"dataItems":[{"sensitiveData":2}]}]}]}}]`) + if err == nil || called { + t.Fatal("deep input must fail locally") + } + var result map[string]any + if json.Unmarshal([]byte(out), &result) != nil { + t.Fatalf("JSON stdout not parseable: %s", out) + } + for _, want := range []string{"agreementInfos[0].thirdSdkInfo.sdkInfos[0].privacyLabels[0].dataItems[0].sensitiveData", "data-dataitem", "invalid_request", "documentationCommand", "suggestion"} { + if !strings.Contains(out, want) { + t.Errorf("missing %s: %s", want, out) + } + } +} diff --git a/cmd/agc/command/result_codes_test.go b/cmd/agc/command/result_codes_test.go new file mode 100644 index 0000000..dbb2153 --- /dev/null +++ b/cmd/agc/command/result_codes_test.go @@ -0,0 +1,28 @@ +package command + +import ( + "encoding/json" + "github.com/Createitv/agc-cli/pkg/domain" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +func TestCLIPreservesBusinessSubcodeOriginWithoutRawBody(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(`{"rtnCode":0,"businessCode":2,"rtnDesc":"denied","invitationCode":"raw-secret"}`)) + })) + defer server.Close() + out, err := execute("--project", t.TempDir(), "testing", "test-api-get-test-grouplist", "--invoke", "--dry-run=false", "--header", "appId=fixture", "--token", "offline", "--base-url", server.URL) + if err == nil { + t.Fatal("failed business subcode accepted") + } + var envelope domain.ErrorEnvelope + if json.Unmarshal([]byte(out), &envelope) != nil || envelope.Error.CodeField != "businessCode" || envelope.Error.ResultCodes["rtnCode"] != "0" || envelope.Error.ResultCodes["businessCode"] != "2" { + t.Fatalf("code origin missing: %s", out) + } + if strings.Contains(out, "raw-secret") || strings.Contains(out, "rawBody") { + t.Fatal("raw response secret exposed") + } +} diff --git a/cmd/agc/command/root.go b/cmd/agc/command/root.go index 38b3b36..afbd21a 100644 --- a/cmd/agc/command/root.go +++ b/cmd/agc/command/root.go @@ -3,6 +3,7 @@ package command import ( "context" "encoding/json" + "errors" "fmt" "io" "net" @@ -63,6 +64,7 @@ func NewRootCommand() *cobra.Command { cmd.PersistentFlags().StringVar(&opts.project, "project", ".", "Project directory") cmd.AddCommand(versionCommand(opts)) + cmd.AddCommand(skillsCommand(opts)) cmd.AddCommand(capabilitiesCommand(opts)) cmd.AddCommand(endpointsCommand(opts)) cmd.AddCommand(openAPICommand(opts)) @@ -70,7 +72,6 @@ func NewRootCommand() *cobra.Command { cmd.AddCommand(initCommand(opts)) cmd.AddCommand(webServerCommand()) cmd.AddCommand(docsCommand(opts)) - cmd.AddCommand(skillsCommand()) for _, capability := range domain.DecoratedCapabilities() { cmd.AddCommand(moduleCommand(opts, capability)) } @@ -91,7 +92,7 @@ var runSkillsCLI = func(ctx context.Context, stdout, stderr io.Writer, args ...s return nil } -func skillsCommand() *cobra.Command { +func remoteSkillsCommand() *cobra.Command { const repository = "Createitv/agc-cli" cmd := &cobra.Command{ Use: "skills", @@ -552,6 +553,9 @@ func moduleCommand(opts *options, capability domain.Capability) *cobra.Command { } func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { + if endpoint.Authentication == "agcli-user-oauth" { + return functionEndpointCommand(opts, endpoint) + } var params []string var query []string var headers []string @@ -560,14 +564,51 @@ func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { var uploadFile string var baseURL string var invoke bool + var showDocs bool var dryRun bool var token string var credentialsPath string + var sessionFile, managementProjectID string var outFile string cmd := &cobra.Command{ Use: endpoint.ID, Short: endpoint.Name, - RunE: func(cmd *cobra.Command, args []string) error { + Long: endpointHelp(endpoint), + RunE: func(cmd *cobra.Command, args []string) (runErr error) { + defer func() { + if runErr == nil || opts.output != "json" { + return + } + cmd.Root().SilenceErrors = true + cmd.Root().SilenceUsage = true + detail := domain.ErrorDetail{Code: "invalid_request", Message: runErr.Error(), Endpoint: endpoint.FamilyID + "/" + endpoint.ID, SourceURL: endpoint.SourceURL, Suggestion: "Read the endpoint's documented parameters and requirements, correct the input, then retry.", DocumentationCommand: endpoint.Command + " --docs --pretty"} + var invalid *agcapi.RequestValidationError + if errors.As(runErr, &invalid) { + detail.Violations = invalid.Violations + } + var authErr *agcapi.AuthenticationError + if errors.As(runErr, &authErr) { + detail.Code = "authentication_failed" + detail.Suggestion = "Select a compatible explicit profile or token for this service and region." + } + var upstream agcapi.AGCError + if errors.As(runErr, &upstream) { + detail.Code = upstream.Code + if detail.Code == "" { + detail.Code = "upstream_error" + } + detail.CodeField, detail.ResultCodes = upstream.CodeField, upstream.ResultCodes + detail.Suggestion = "Review the upstream business error against the documented permissions, application state, and prerequisites before retrying." + } + _ = output.Write(cmd.OutOrStdout(), domain.ErrorEnvelope{Error: detail}, output.JSON, opts.pretty) + }() + if showDocs { + doc, ok := domain.EndpointReference(endpoint.FamilyID, endpoint.ID) + if !ok { + return fmt.Errorf("official documentation has not yet been browser-reviewed for %s/%s", endpoint.FamilyID, endpoint.ID) + } + return output.Write(cmd.OutOrStdout(), domain.Envelope[json.RawMessage]{Data: doc}, output.Format(opts.output), opts.pretty) + } if !invoke { return output.Write(cmd.OutOrStdout(), domain.Envelope[domain.Endpoint]{Data: endpoint}, output.Format(opts.output), opts.pretty) } @@ -575,7 +616,7 @@ func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { if err != nil { return err } - queryMap, err := parsePairs(query) + queryMap, queryValues, err := parseQueryPairs(query) if err != nil { return err } @@ -596,7 +637,7 @@ func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { switch parameter.Name { case "appId", "appID": value = config.AppID - case "projectId": + case "projectId", "productId": value = config.ProjectID } if value != "" { @@ -651,7 +692,8 @@ func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { return fmt.Errorf("missing --header %s=value", parameter.Name) } case "body": - if (bodyFile == "" && fieldMap[parameter.Name] == "") || (bodyFile != "" && (len(bodyFields[parameter.Name]) == 0 || string(bodyFields[parameter.Name]) == "null" || string(bodyFields[parameter.Name]) == `""`)) { + _, supplied := fieldMap[parameter.Name] + if (bodyFile == "" && (!supplied || (!parameter.AllowEmpty && fieldMap[parameter.Name] == ""))) || (bodyFile != "" && (len(bodyFields[parameter.Name]) == 0 || string(bodyFields[parameter.Name]) == "null" || (!parameter.AllowEmpty && string(bodyFields[parameter.Name]) == `""`))) { return fmt.Errorf("missing --field %s=value or --body", parameter.Name) } case "file": @@ -674,18 +716,27 @@ func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { } } } + if err := agcapi.ValidateEndpointPathInput(endpoint, paramMap); err != nil { + return err + } + if err := agcapi.ValidateEndpointRequest(endpoint, queryMap, headerMap, body, queryValues); err != nil { + return err + } if err := agcapi.ValidateEndpointBody(endpoint, body); err != nil { return err } + if err := agcapi.ValidateEndpointFileInput(endpoint, uploadFile, headerMap); err != nil { + return err + } explicitAuthHeader := hasHeaderValue(headerMap, "Authorization") || hasHeaderValue(headerMap, "oauth2Token") - if token == "" && !explicitAuthHeader { + if token == "" && !explicitAuthHeader && !agcapi.IsManagementEndpoint(endpoint) { token = os.Getenv("AGC_ACCESS_TOKEN") } ctx, cancel := context.WithTimeout(cmd.Context(), opts.timeout) defer cancel() - if token == "" && !explicitAuthHeader && !dryRun && endpoint.Path != "{uploadUrl}" { + if token == "" && !explicitAuthHeader && !agcapi.IsManagementEndpoint(endpoint) && endpoint.Authentication != "body-client-credentials" && !dryRun && endpoint.Path != "{uploadUrl}" && endpoint.Direction != "local" && endpoint.Direction != "inbound-callback" && endpoint.Authentication != "body-signature" { var clientID string - token, clientID, err = endpointAuthorization(ctx, opts, credentialsPath, baseURL) + token, clientID, err = endpointAuthorizationFor(ctx, opts, credentialsPath, baseURL, endpoint) if clientID != "" && !hasHeader(headerMap, "client_id") { headerMap["client_id"] = clientID } @@ -694,10 +745,13 @@ func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { } } resp, err := agcapi.InvokeEndpoint(ctx, nil, agcapi.InvokeRequest{ + SessionFile: sessionFile, + ProjectID: managementProjectID, Endpoint: endpoint, BaseURL: baseURL, Params: paramMap, Query: queryMap, + QueryValues: queryValues, Headers: headerMap, Body: body, FilePath: uploadFile, @@ -707,25 +761,38 @@ func endpointCommand(opts *options, endpoint domain.Endpoint) *cobra.Command { if err != nil { return err } - if outFile != "" && len(resp.RawBody) > 0 { + if outFile != "" && !resp.DryRun && (len(resp.RawBody) > 0 || (endpoint.FamilyID == "storage" && endpoint.ID == "download-file")) { if err := os.WriteFile(outFile, resp.RawBody, 0644); err != nil { return err } resp.Body = nil + resp.BodyBase64 = "" } return output.Write(cmd.OutOrStdout(), domain.Envelope[agcapi.InvokeResponse]{Data: resp}, output.Format(opts.output), opts.pretty) }, } cmd.Flags().StringArrayVar(¶ms, "param", nil, "Path parameter as key=value; repeatable") - cmd.Flags().StringArrayVar(&query, "query", nil, "Query parameter as key=value; repeatable") + cmd.Flags().StringArrayVar(&query, "query", nil, "Query parameter as key=value; repeat the same key for ordered array values") cmd.Flags().StringArrayVar(&headers, "header", nil, "HTTP header as key=value; repeatable") - cmd.Flags().StringArrayVar(&fields, "field", nil, "JSON body field as key=value; repeatable") + cmd.Flags().StringArrayVar(&fields, "field", nil, "Request body field as key=value; repeatable; supply raw unescaped values for form endpoints") cmd.Flags().StringVar(&bodyFile, "body", "", "JSON body file") cmd.Flags().StringVar(&uploadFile, "file", "", "Raw file for signed upload endpoints") - cmd.Flags().StringVar(&baseURL, "base-url", "https://connect-api.cloud.huawei.com", "Connect API base URL") + defaultBaseURL := endpoint.DefaultBaseURL + if defaultBaseURL == "" { + defaultBaseURL = "https://connect-api.cloud.huawei.com" + } + if agcapi.IsManagementEndpoint(endpoint) { + defaultBaseURL = "" + } + cmd.Flags().StringVar(&baseURL, "base-url", defaultBaseURL, "Upstream service base URL") cmd.Flags().StringVar(&token, "token", "", "Bearer token; defaults to AGC_ACCESS_TOKEN") cmd.Flags().StringVar(&credentialsPath, "credentials-path", "", "Override credentials file path") + if agcapi.IsManagementEndpoint(endpoint) { + cmd.Flags().StringVar(&sessionFile, "session-file", "", "Explicit vendor user-session JSON; never publishing credentials") + cmd.Flags().StringVar(&managementProjectID, "project-id", "", "Selected project; must match session productId") + } cmd.Flags().StringVar(&outFile, "out", "", "Write raw response body to a file") + cmd.Flags().BoolVar(&showDocs, "docs", false, "Read the embedded browser-reviewed official document, including notes, examples, and paragraph links") cmd.Flags().BoolVar(&invoke, "invoke", false, "Invoke the registered endpoint") cmd.Flags().BoolVar(&dryRun, "dry-run", true, "Build the request without sending it") return cmd @@ -832,3 +899,44 @@ func loopbackListenAddress(addr string) bool { ip := net.ParseIP(host) return ip != nil && ip.IsLoopback() } + +// endpointHelp makes upstream parameter locations usable from the terminal. +func endpointHelp(endpoint domain.Endpoint) string { + var help strings.Builder + fmt.Fprintf(&help, "%s\n\nHuawei: %s %s\n", endpoint.Description, endpoint.Method, endpoint.Path) + if endpoint.SourceURL != "" { + fmt.Fprintf(&help, "Reference: %s\n", endpoint.SourceURL) + } + if len(endpoint.Parameters) > 0 { + help.WriteString("\nParameters:\n") + } + for _, parameter := range endpoint.Parameters { + flag := map[string]string{"query": "--query", "header": "--header", "body": "--field", "path": "--param", "file": "--file"}[parameter.In] + required := "optional" + if parameter.Required { + required = "required" + } + fmt.Fprintf(&help, " %s %s=value (%s, %s): %s\n", flag, parameter.Name, parameter.Type, required, parameter.Description) + } + return help.String() +} + +func parseQueryPairs(items []string) (map[string]string, map[string][]string, error) { + scalar, err := parsePairs(items) + if err != nil { + return nil, nil, err + } + all := map[string][]string{} + for _, item := range items { + key, value, _ := strings.Cut(item, "=") + all[key] = append(all[key], value) + } + repeated := map[string][]string{} + for key, values := range all { + if len(values) > 1 { + repeated[key] = values + scalar[key] = values[0] + } + } + return scalar, repeated, nil +} diff --git a/cmd/agc/command/root_test.go b/cmd/agc/command/root_test.go index c342ac0..c5cdfbe 100644 --- a/cmd/agc/command/root_test.go +++ b/cmd/agc/command/root_test.go @@ -8,7 +8,7 @@ import ( "crypto/x509" "encoding/json" "encoding/pem" - "io" + "github.com/Createitv/agc-cli/internal/managementtest" "net/http" "net/http/httptest" "os" @@ -24,6 +24,7 @@ import ( // Tests must never inherit a developer's real local credentials. func TestMain(m *testing.M) { + managementtest.ExitIfHDCStub() for _, name := range []string{"AGC_PROFILE", "AGC_CLIENT_ID", "AGC_CLIENT_KEY", "AGC_CLIENT_SECRET", "AGC_SERVICE_ACCOUNT_FILE", "AGC_CREDENTIALS_PATH", "AGC_ACCESS_TOKEN", "AGC_OAUTH2_TOKEN", "AGC_SERVER_TOKEN"} { if err := os.Unsetenv(name); err != nil { os.Exit(1) @@ -72,8 +73,8 @@ func TestCapabilitiesCommandReturnsAllFamilies(t *testing.T) { if err := json.Unmarshal([]byte(out), &body); err != nil { t.Fatal(err) } - if len(body.Data) != 13 { - t.Fatalf("capabilities = %d, want 13", len(body.Data)) + if len(body.Data) != 21 { + t.Fatalf("capabilities = %d, want 21", len(body.Data)) } } @@ -118,45 +119,6 @@ func TestVersionCommand(t *testing.T) { } } -func TestSkillsListDelegatesToSkillsInstaller(t *testing.T) { - original := runSkillsCLI - t.Cleanup(func() { runSkillsCLI = original }) - var got []string - runSkillsCLI = func(_ context.Context, stdout, _ io.Writer, args ...string) error { - got = append([]string(nil), args...) - _, _ = io.WriteString(stdout, "agc-cli-usage\n") - return nil - } - out, err := execute("skills", "list") - if err != nil { - t.Fatal(err) - } - if strings.Join(got, " ") != "--yes skills add Createitv/agc-cli --list" { - t.Fatalf("installer args = %q", got) - } - if out != "agc-cli-usage\n" { - t.Fatalf("output = %q", out) - } -} - -func TestSkillsInstallSelectsSkillAgentAndScope(t *testing.T) { - original := runSkillsCLI - t.Cleanup(func() { runSkillsCLI = original }) - var got []string - runSkillsCLI = func(_ context.Context, _, _ io.Writer, args ...string) error { - got = append([]string(nil), args...) - return nil - } - _, err := execute("skills", "install", "--name", "agc-auth", "--agent", "codex", "--global") - if err != nil { - t.Fatal(err) - } - want := "--yes skills add Createitv/agc-cli --skill agc-auth --agent codex --global" - if strings.Join(got, " ") != want { - t.Fatalf("installer args = %q, want %q", got, want) - } -} - func TestEveryRegisteredCommandHasHelp(t *testing.T) { root := NewRootCommand() for _, cmd := range root.Commands() { @@ -205,6 +167,11 @@ func TestEndpointCommandShowsSpec(t *testing.T) { func TestEveryRegisteredEndpointCanDryRun(t *testing.T) { for _, endpoint := range domain.AllEndpoints() { + if domain.IsServerlessFamily(endpoint.FamilyID) { + testServerlessOperationDryRun(t, endpoint) + continue + } + args := []string{endpoint.FamilyID, endpoint.ID, "--invoke", "--base-url", "https://example.com"} for _, parameter := range endpoint.Parameters { if !parameter.Required { @@ -212,29 +179,48 @@ func TestEveryRegisteredEndpointCanDryRun(t *testing.T) { } switch parameter.In { case "path": - value := "sample" + value := parameterFixture(parameter) if parameter.Name == "callbackUrl" || parameter.Name == "uploadUrl" { value = "https://callback.example.com/hook" } args = append(args, "--param", parameter.Name+"="+value) case "query": - args = append(args, "--query", parameter.Name+"=sample") + args = append(args, "--query", parameter.Name+"="+parameterFixture(parameter)) case "header": - args = append(args, "--header", parameter.Name+"=sample") - case "body", "file": - value := "sample" - if parameter.Type == "integer" || parameter.Type == "number" { - value = "1" - } - if parameter.Type == "array" { - value = `["fixture"]` - } - if parameter.Type == "object" { - value = `{"key":"fixture"}` + args = append(args, "--header", parameter.Name+"="+parameterFixture(parameter)) + case "file": + if endpoint.FamilyID == "pms" && endpoint.ID == "resourcemanage-harmonyosnext" { + file := filepath.Join(t.TempDir(), "fixture.png") + if err := os.WriteFile(file, []byte("offline-image"), 0600); err != nil { + t.Fatal(err) + } + args = append(args, "--file", file) + continue } + args = append(args, "--field", parameter.Name+"="+parameterFixture(parameter)) + case "body": + value := parameterFixture(parameter) args = append(args, "--field", parameter.Name+"="+value) } } + if endpoint.DynamicBody != nil { + args = append(args, "--field", "additionalProp1="+parameterFixture(*endpoint.DynamicBody)) + } + if endpoint.FamilyID == "resources" && endpoint.ID == "respackapi-queryfile" { + args = append(args, "--query", "versionId=1") + } + if endpoint.FamilyID == "projects" && endpoint.ID == "appbriefinfo" { + args = append(args, "--query", "packageNames=app.example.fixture") + } + if endpoint.FamilyID == "publishing" && endpoint.ID == "app-version-list" { + args = append(args, "--header", "appId=fixture") + } + if endpoint.FamilyID == "upload" && endpoint.ID == "obbfile-init" { + args = append(args, "--query", "fileType=1") + } + if endpoint.FamilyID == "publishing" && endpoint.ID == "app-create" { + args = append(args, "--field", "packageName=app.example.fixture") + } out, err := execute(args...) if err != nil { t.Fatalf("%s dry-run failed: %v", endpoint.Command, err) @@ -305,8 +291,9 @@ func TestEndpointCommandWritesRawResponseToOutFile(t *testing.T) { "--invoke", "--dry-run=false", "--param", "appId=123", - "--query", "from=2026-08-01", - "--query", "to=2026-08-11", + "--query", "language=en-US", + "--query", "startTime=20260801", + "--query", "endTime=20260811", "--base-url", server.URL, "--token", "token", "--out", outFile, @@ -333,7 +320,7 @@ func TestEndpointCommandRequiresCallbackURL(t *testing.T) { } func TestEndpointCommandAcceptsBodyFieldAndHeader(t *testing.T) { - out, err := execute("publishing", "add-packageurl", "--invoke", "--field", "appId=123", "--field", "packageUrl=https://example.com/app.app", "--header", "client_id=client", "--base-url", "https://example.com") + out, err := execute("publishing", "add-packageurl", "--invoke", "--query", "appId=123", "--field", "downloadUrl=https://example.com/app.apk", "--field", "downloadFileName=app.apk", "--field", "requestId=offline-fixture", "--header", "client_id=client", "--base-url", "https://example.com") if err != nil { t.Fatal(err) } @@ -382,57 +369,6 @@ func TestAuthLoginAndCheck(t *testing.T) { } } -func TestAuthWhoAmIShowsActiveIdentityWithoutSecrets(t *testing.T) { - path := filepath.Join(t.TempDir(), "credentials.json") - if _, err := execute("auth", "login", "--client-id", "developer-client", "--client-key", "test-secret", "--name", "production", "--credentials-path", path); err != nil { - t.Fatal(err) - } - out, err := execute("auth", "whoami", "--credentials-path", path) - if err != nil { - t.Fatal(err) - } - if !strings.Contains(out, `"name":"production"`) || !strings.Contains(out, `"clientId":"developer-client"`) || !strings.Contains(out, `"teamLookup":"oauth-required"`) { - t.Fatalf("output = %s", out) - } - if strings.Contains(out, "test-secret") || strings.Contains(out, "clientKey") { - t.Fatal("whoami output exposes client key") - } -} - -func TestAuthWhoAmIReadsOfficialOAuthTeamList(t *testing.T) { - t.Setenv("AGC_OAUTH2_TOKEN", "oauth-test-secret") - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/api/ups/user-permission-service/v1/user-team-list" { - t.Errorf("path = %s", r.URL.Path) - } - if r.Header.Get("oauth2Token") != "oauth-test-secret" { - t.Error("missing OAuth team-list token") - } - w.Header().Set("Content-Type", "application/json") - w.Write([]byte(`{"ret":{"code":0,"msg":"success"},"teams":[{"teamId":"team-1","teamName":"Example Studio"}]}`)) - })) - defer srv.Close() - - out, err := execute("auth", "whoami", "--teams", "--base-url", srv.URL, "--credentials-path", filepath.Join(t.TempDir(), "missing.json")) - if err != nil { - t.Fatal(err) - } - if !strings.Contains(out, `"teamLookup":"verified"`) || !strings.Contains(out, `"teamName":"Example Studio"`) { - t.Fatalf("output = %s", out) - } - if strings.Contains(out, "oauth-test-secret") { - t.Fatal("whoami output exposes OAuth token") - } -} - -func TestAuthWhoAmITeamsRequiresOAuthToken(t *testing.T) { - t.Setenv("AGC_OAUTH2_TOKEN", "") - _, err := execute("auth", "whoami", "--teams", "--credentials-path", filepath.Join(t.TempDir(), "missing.json")) - if err == nil || !strings.Contains(err.Error(), "AGC_OAUTH2_TOKEN") { - t.Fatalf("error = %v", err) - } -} - func TestResolveCredentialUsesProjectProfileAndCLIOverride(t *testing.T) { projectDir := t.TempDir() if err := project.Save(projectDir, project.Config{AppID: "123", Profile: "production"}); err != nil { diff --git a/cmd/agc/command/serverless_auth.go b/cmd/agc/command/serverless_auth.go new file mode 100644 index 0000000..bd11c5e --- /dev/null +++ b/cmd/agc/command/serverless_auth.go @@ -0,0 +1,51 @@ +package command + +import ( + "context" + "fmt" + "net/http" + + "github.com/Createitv/agc-cli/pkg/agcapi" + "github.com/Createitv/agc-cli/pkg/domain" +) + +func endpointAuthorizationFor(ctx context.Context, opts *options, credentialsPath, baseURL string, e domain.Endpoint) (string, string, error) { + if !domain.IsServerlessFamily(e.FamilyID) { + return endpointAuthorization(ctx, opts, credentialsPath, baseURL) + } + path, err := credentialPath(credentialsPath) + if err != nil { + return "", "", err + } + store, err := agcapi.LoadCredentials(path) + if err != nil { + return "", "", err + } + credential, ok, err := resolveCredential(opts, store) + if err != nil { + return "", "", err + } + if !ok { + return "", "", &agcapi.AuthenticationError{Message: "select an API client profile or provide an explicit token"} + } + if e.Authentication != "service-account-or-api-client" && credential.Mode != "api-client" { + return "", "", &agcapi.AuthenticationError{Message: "this endpoint requires an API client profile; Service Account credentials cannot authorize this service"} + } + if e.Authentication == "client-api-token" { + token, err := agcapi.ServerlessClientToken(ctx, nil, baseURL, credential) + if err != nil { + return "", credential.ClientID, &agcapi.AuthenticationError{Message: "Client gateway authentication failed; verify the selected API client and region."} + } + return token, credential.ClientID, nil + } + authBase, err := agcapi.ServerlessTokenBaseURL(baseURL) + if err != nil { + return "", "", err + } + client := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return fmt.Errorf("credential token redirects refused") }} + token, err := agcapi.AccessToken(ctx, client, authBase, credential) + if err != nil { + return "", credential.ClientID, &agcapi.AuthenticationError{Message: "serverless authorization failed; verify selected profile, role and regional API client credentials"} + } + return token.AccessToken, credential.ClientID, nil +} diff --git a/cmd/agc/command/serverless_test.go b/cmd/agc/command/serverless_test.go new file mode 100644 index 0000000..ee32b09 --- /dev/null +++ b/cmd/agc/command/serverless_test.go @@ -0,0 +1,374 @@ +package command + +import ( + "archive/zip" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/Createitv/agc-cli/pkg/agcapi" + "github.com/Createitv/agc-cli/pkg/domain" +) + +func serverlessFixture(p domain.Parameter) any { + if p.Name == "fileSha256" { + return strings.Repeat("0", 64) + } + if len(p.Enum) > 0 { + if p.Type == "integer" { + var n json.Number = json.Number(p.Enum[0]) + return n + } + return p.Enum[0] + } + if p.EncodedJSON != nil { + b, _ := json.Marshal(serverlessFixture(*p.EncodedJSON)) + return string(b) + } + switch p.Type { + case "boolean": + return false + case "integer", "number": + return 1 + case "object": + m := map[string]any{} + for _, c := range p.Properties { + if c.Required { + m[c.Name] = serverlessFixture(c) + } + } + return m + case "array": + if p.ItemsType == "object" { + m := map[string]any{} + for _, c := range p.ItemsProperties { + if c.Required { + m[c.Name] = serverlessFixture(c) + } + } + return []any{m} + } + if p.ItemsType == "integer" { + return []any{1} + } + return []any{"test"} + } + return "test" +} + +// Independent source-based transport and nested-contract tests complement these +// registry-wide CLI exchanges. Every operation sends to an isolated local server. +func testServerlessOperationHTTP(t *testing.T, e domain.Endpoint) { + if e.FamilyID == "prefetch" && e.Direction == "local" { + testPrefetchDeviceCLI(t, e, false) + return + } + if agcapi.IsManagementEndpoint(e) { + testReviewedManagementCLI(t, e) + return + } + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + if e.Authentication == "agcli-user-oauth" { + testNativeFunctionCLI(t, e) + return + } + for _, scenario := range []struct { + name string + status int + body string + fail bool + }{{"success", 200, `{"ret":{"code":0},"marker":"received"}`, false}, {"business-error", 200, `{"ret":{"code":17,"msg":"rejected"}}`, true}, {"http-error", 429, `{"code":429,"message":"limited"}`, true}} { + t.Run(scenario.name, func(t *testing.T) { + seen := false + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + seen = true + if r.Method != e.Method { + t.Errorf("verb=%s want=%s", r.Method, e.Method) + } + if e.Direction == "inbound-callback" || e.Authentication == "body-client-credentials" { + if r.Header.Get("Authorization") != "" { + t.Error("unexpected developer auth") + } + } + if e.Authentication == "signed-upload" && r.Header.Get("Authorization") != "AWS4-HMAC-SHA256 offline" { + t.Error("lost signed header") + } + if e.ID == "upload-file" || e.ID == "upload-version" { + b, _ := io.ReadAll(r.Body) + if string(b) != "offline bytes" { + t.Error("not raw bytes") + } + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(scenario.status) + io.WriteString(w, scenario.body) + })) + defer srv.Close() + args := []string{"--project", t.TempDir(), e.FamilyID, e.ID, "--invoke", "--dry-run=false", "--base-url", srv.URL} + if e.Direction != "inbound-callback" && e.Authentication != "body-client-credentials" && e.Authentication != "signed-upload" { + args = append(args, "--token", "offline") + } + body := map[string]any{} + for _, p := range e.Parameters { + if !p.Required { + continue + } + if p.In == "file" { + continue + } + v := serverlessFixture(p) + value := fmt.Sprint(v) + switch p.In { + case "body": + body[p.Name] = v + case "path": + if p.Name == "uploadUrl" || p.Name == "callbackUrl" { + value = srv.URL + "/test" + } + args = append(args, "--param", p.Name+"="+value) + case "header": + args = append(args, "--header", p.Name+"="+value) + case "query": + args = append(args, "--query", p.Name+"="+value) + } + } + if e.FamilyID == "cloud-auth" { + switch e.ID { + case "register", "request-code": + body["email"] = "test@example.test" + case "update-account": + body["newEmail"] = "test@example.test" + } + } + if e.FamilyID == "clouddb" && (e.ID == "update-data" || e.ID == "delete-data") { + body["schemas"] = []any{map[string]any{"n": "StudentInfo", "fs": []any{map[string]any{"n": "id", "t": "TYPE_INT32"}, map[string]any{"n": "naturalbase_version", "t": "TYPE_LONG"}, map[string]any{"n": "naturalbase_deleted", "t": "TYPE_BOOLEAN"}}}} + body["opData"] = []any{map[string]any{"t": 1, "os": []any{map[string]any{"fs": []any{map[string]any{"i": 1}, map[string]any{"l": nil}, map[string]any{"bl": e.ID == "delete-data"}}}}}} + } + if e.Authentication == "server-api-client" || e.Authentication == "client-api-token" { + args = append(args, "--header", "client_id=offline") + } + if e.ID == "upload-file" || e.ID == "upload-version" { + p := filepath.Join(t.TempDir(), "test.zip") + os.WriteFile(p, []byte("offline bytes"), 0600) + args = append(args, "--file", p) + } + if e.Authentication == "signed-upload" { + sum := sha256.Sum256([]byte("offline bytes")) + args = append(args, "--header", "Authorization=AWS4-HMAC-SHA256 offline", "--header", "x-amz-content-sha256="+hex.EncodeToString(sum[:]), "--header", "x-amz-client-request-id=offline", "--header", "x-amz-date=20261026T000000Z", "--header", "Host="+strings.TrimPrefix(srv.URL, "http://"), "--header", "Content-Type=application/zip") + } + if len(body) > 0 { + p := filepath.Join(t.TempDir(), "body.json") + b, _ := json.Marshal(body) + os.WriteFile(p, b, 0600) + args = append(args, "--body", p) + } + out, err := execute(args...) + if !seen { + t.Fatalf("CLI did not send request: err=%v output=%s", err, out) + } + wantFailure := scenario.fail + // Downloaded JSON is user file content, including fields that + // resemble an AGC business error. Only HTTP errors fail here. + if e.FamilyID == "storage" && e.ID == "download-file" { + wantFailure = scenario.status >= 400 + } + if e.FamilyID == "prefetch" { + wantFailure = scenario.status >= 400 + } + if (err != nil) != wantFailure { + t.Fatalf("err=%v want failure=%v", err, wantFailure) + } + if err == nil { + var parsed any + if json.Unmarshal([]byte(out), &parsed) != nil { + t.Fatalf("invalid JSON stdout: %s", out) + } + } + }) + } + }) +} +func testNativeFunctionCLI(t *testing.T, e domain.Endpoint) { + calls := 0 + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + calls++ + if r.Header.Get("oauth2Token") != "offline-token" { + t.Error("missing selected session") + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"function":{"revisionId":"r1","handler":"handler.myHandler"},"marker":"received"}`)) + })) + defer srv.Close() + dir := t.TempDir() + session := filepath.Join(dir, "session.json") + b, _ := json.Marshal(map[string]any{"uid": "offline", "teamId": "offline", "productId": "offline", "accessToken": "offline-token", "expiresAt": time.Now().Add(time.Hour), "projectBaseUrl": srv.URL}) + os.WriteFile(session, b, 0600) + args := []string{"--project", dir, "functions", e.ID, "--invoke", "--dry-run=false", "--name", "test-func", "--session-file", session, "--version-description", "test"} + if e.ID == "create-function" || e.ID == "update-function-code" || e.ID == "update-and-publish-function" { + p := filepath.Join(dir, "test.zip") + f, _ := os.Create(p) + z := zip.NewWriter(f) + entry, _ := z.Create("handler.js") + entry.Write([]byte("test")) + z.Close() + f.Close() + args = append(args, "--code-path", p) + } + if e.ID == "update-function-config" { + args = append(args, "--memory", "1000") + } + out, err := execute(args...) + if err != nil || calls == 0 { + t.Fatalf("native CLI failed: %v %s", err, out) + } +} +func TestServerlessDryRunDoesNotLoadAuthorization(t *testing.T) { + t.Setenv("AGC_CREDENTIALS_PATH", filepath.Join(t.TempDir(), "missing")) + for _, args := range [][]string{{"functions", "invoke", "--invoke", "--name", "test-func", "--session-file", "/nonexistent"}, {"hosting", "list-sites", "--invoke", "--header", "productId=offline", "--header", "requestid=test", "--header", "service=hosting", "--field", "site={}"}} { + out, err := execute(args...) + if err != nil || !strings.Contains(out, `"dryRun":true`) { + t.Fatalf("dry-run failed: %v %s", err, out) + } + } +} +func TestServerlessRejectsServiceAccountForClientOnlyAPI(t *testing.T) { + dir := t.TempDir() + creds := filepath.Join(dir, "creds.json") + agcapi.SaveCredential(creds, agcapi.Credential{Name: "offline", Mode: "service-account", ServiceAccountFile: "/must-not-read"}) + _, err := execute("--project", dir, "--profile", "offline", "storage", "list-files", "--invoke", "--dry-run=false", "--credentials-path", creds, "--param", "bucket_name=test", "--header", "productId=test") + if err == nil || !strings.Contains(err.Error(), "API client") { + t.Fatalf("must reject wrong credential before reading key: %v", err) + } +} + +func testServerlessOperationDryRun(t *testing.T, e domain.Endpoint) { + if e.FamilyID == "prefetch" && e.Direction == "local" { + testPrefetchDeviceCLI(t, e, true) + return + } + if agcapi.IsManagementEndpoint(e) { + testReviewedManagementDryRun(t, e) + return + } + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + // Capture valid CLI arguments through the real transport fixture, replacing + // only the execution switch is tested separately below for native workflows. + if e.Authentication == "agcli-user-oauth" { + dir := t.TempDir() + args := []string{"--project", dir, "functions", e.ID, "--invoke", "--name", "test-func", "--session-file", "/must-not-read", "--version-description", "test"} + if e.ID == "create-function" || e.ID == "update-function-code" { + p := filepath.Join(dir, "test.zip") + f, _ := os.Create(p) + z := zip.NewWriter(f) + z.Create("handler.js") + z.Close() + f.Close() + args = append(args, "--code-path", p) + } + if e.ID == "update-function-config" { + args = append(args, "--memory", "1000") + } + out, err := execute(args...) + if err != nil || !strings.Contains(out, `"dryRun":true`) { + t.Fatalf("native dry-run failed: %v %s", err, out) + } + return + } + args := []string{"--project", t.TempDir(), e.FamilyID, e.ID, "--invoke", "--base-url", "https://example.test"} + body := map[string]any{} + for _, p := range e.Parameters { + if !p.Required { + continue + } + v := serverlessFixture(p) + switch p.In { + case "body": + body[p.Name] = v + case "header": + args = append(args, "--header", p.Name+"="+fmt.Sprint(v)) + case "query": + args = append(args, "--query", p.Name+"="+fmt.Sprint(v)) + case "path": + value := fmt.Sprint(v) + if p.Name == "callbackUrl" || p.Name == "uploadUrl" { + value = "https://example.test/hook" + } + args = append(args, "--param", p.Name+"="+value) + case "file": + file := filepath.Join(t.TempDir(), "offline.zip") + os.WriteFile(file, []byte("offline"), 0600) + args = append(args, "--file", file) + } + } + if e.FamilyID == "cloud-auth" { + switch e.ID { + case "register", "request-code": + body["email"] = "test@example.test" + case "update-account": + body["newEmail"] = "test@example.test" + } + } + if e.FamilyID == "clouddb" && (e.ID == "update-data" || e.ID == "delete-data") { + body["schemas"] = []any{} + body["opData"] = []any{} + } + if e.Authentication == "signed-upload" { + sum := sha256.Sum256([]byte("offline")) + args = append(args, "--header", "Authorization=AWS4-HMAC-SHA256 offline", "--header", "x-amz-content-sha256="+hex.EncodeToString(sum[:]), "--header", "Host=example.test", "--header", "Content-Type=application/zip") + } + if len(body) > 0 { + b, _ := json.Marshal(body) + file := filepath.Join(t.TempDir(), "body.json") + os.WriteFile(file, b, 0600) + args = append(args, "--body", file) + } + out, err := execute(args...) + if err != nil || !strings.Contains(out, `"dryRun":true`) { + t.Fatalf("dry run failed: %v %s", err, out) + } + }) +} + +func TestStorageEmptyDownloadWritesOutputFile(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Length", "0") + w.WriteHeader(200) + })) + defer s.Close() + out := filepath.Join(t.TempDir(), "empty.bin") + _, err := execute("--project", t.TempDir(), "storage", "download-file", "--invoke", "--dry-run=false", "--base-url", s.URL, "--token", "offline", "--param", "bucket_name=b", "--param", "object_name=empty.bin", "--header", "productId=p", "--header", "client_id=c", "--out", out) + if err != nil { + t.Fatal(err) + } + info, err := os.Stat(out) + if err != nil || info.Size() != 0 { + t.Fatalf("empty download not written: %v", err) + } +} + +func TestNativeFunctionCLIErrorsAreMachineReadable(t *testing.T) { + out, err := execute("functions", "invoke", "--invoke", "--name", "BAD") + if err == nil { + t.Fatal("invalid name accepted") + } + var e domain.ErrorEnvelope + if json.Unmarshal([]byte(out), &e) != nil || e.Error.Endpoint != "functions/invoke" || len(e.Error.Violations) == 0 || e.Error.DocumentationCommand == "" { + t.Fatalf("native feedback missing: %s", out) + } +} +func TestSignedHostingRequiresReturnedAuthorizationBeforeNetwork(t *testing.T) { + e, _ := domain.EndpointByID("hosting", "upload-version") + err := agcapi.ValidateEndpointRequest(e, nil, map[string]string{"x-amz-content-sha256": "test", "x-amz-client-request-id": "test", "x-amz-date": "test", "Host": "example.test", "Content-Type": "application/zip"}, nil) + if err == nil { + t.Fatal("missing signed Authorization accepted") + } +} diff --git a/cmd/agc/command/skills.go b/cmd/agc/command/skills.go new file mode 100644 index 0000000..e89a19f --- /dev/null +++ b/cmd/agc/command/skills.go @@ -0,0 +1,63 @@ +package command + +import ( + _ "embed" + "fmt" + + "github.com/Createitv/agc-cli/pkg/domain" + "github.com/Createitv/agc-cli/pkg/output" + "github.com/spf13/cobra" +) + +//go:embed skills/agc-cli.md +var agcSkillContent string + +type skillSummary struct { + Name string `json:"name"` + Description string `json:"description"` + Command string `json:"command"` +} + +func skillsCommand(opts *options) *cobra.Command { + summary := skillSummary{ + Name: "agc-cli", + Description: "Discover and invoke AppGallery Connect workflows with the agc CLI.", + Command: "agc skills show agc-cli", + } + cmd := &cobra.Command{Use: "skills", Short: "Read bundled agent skills offline"} + var remote bool + list := &cobra.Command{ + Use: "list", Short: "List bundled agent skills", Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + if remote { + return runSkillsCLI(cmd.Context(), cmd.OutOrStdout(), cmd.ErrOrStderr(), "--yes", "skills", "add", "Createitv/agc-cli", "--list") + } + return output.Write(cmd.OutOrStdout(), domain.Envelope[[]skillSummary]{Data: []skillSummary{summary}}, output.Format(opts.output), opts.pretty) + }, + } + list.Flags().BoolVar(&remote, "remote", false, "List published skills using the online installer") + cmd.AddCommand(list) + installer := remoteSkillsCommand() + install, _, _ := installer.Find([]string{"install"}) + installer.RemoveCommand(install) + cmd.AddCommand(install) + cmd.AddCommand(&cobra.Command{ + Use: "show ", Short: "Read a bundled agent skill", Args: cobra.ExactArgs(1), + ValidArgs: []string{summary.Name}, + RunE: func(cmd *cobra.Command, args []string) error { + if args[0] != summary.Name { + return fmt.Errorf("unknown skill %q; run 'agc skills list' to list bundled skills", args[0]) + } + if output.Format(opts.output) == output.Markdown { + _, err := fmt.Fprint(cmd.OutOrStdout(), agcSkillContent) + return err + } + detail := struct { + skillSummary + Content string `json:"content"` + }{summary, agcSkillContent} + return output.Write(cmd.OutOrStdout(), domain.Envelope[any]{Data: detail}, output.Format(opts.output), opts.pretty) + }, + }) + return cmd +} diff --git a/cmd/agc/command/skills/agc-cli.md b/cmd/agc/command/skills/agc-cli.md new file mode 100644 index 0000000..19d7272 --- /dev/null +++ b/cmd/agc/command/skills/agc-cli.md @@ -0,0 +1,36 @@ +--- +name: agc-cli +description: Discover and invoke AppGallery Connect workflows with the agc CLI. +--- + +# AGC CLI + +Use this skill for AppGallery Connect API discovery, request previews, and explicitly authorized operations. + +## Discover before invoking + +- Run `agc version --pretty` and `agc capabilities --pretty` to inspect the installed CLI. +- Run `agc endpoints --pretty` to discover endpoint names; do not invent commands. +- Read `agc --docs --pretty` and `agc --help` before constructing a request. +- Registered endpoints are not proof of successful live validation. Resolve required fields and prerequisites from endpoint documentation. + +## Credentials and project context + +- Inspect local credential configuration with `agc auth check`; this does not prove remote authorization. +- Use the user's explicitly selected profile via `--profile NAME` and project directory via `--project PATH`. +- Never print, commit, or include credentials in reports. Do not request secrets in chat. +- Provide endpoint appId/projectId parameters explicitly when required; project context does not automatically fill them. + +## Preview, authorize, execute, verify + +- Build a preview with `agc --invoke` and documented `--query`, `--header`, or body flags. Invocation defaults to dry-run. +- Only add `--dry-run=false` when the requested live operation is authorized. Do not use publishing or deletion as a smoke test. +- For uploads, follow the documented upload URL, transfer, confirmation and parsing steps; do not assume a file ID means an upload is ready. +- Inspect machine-readable errors and documented prerequisites before retrying. +- Read back resulting state. Distinguish request acceptance, upload processing, review submission, approval and availability. + +## Skill access + +`agc skills list --pretty` lists the guides bundled into this binary. +`agc skills show agc-cli --output markdown` prints this guide as Markdown. +These commands work offline without credentials and do not install files or query a remote skill registry. diff --git a/cmd/agc/command/skills_installer_test.go b/cmd/agc/command/skills_installer_test.go new file mode 100644 index 0000000..2d5a56e --- /dev/null +++ b/cmd/agc/command/skills_installer_test.go @@ -0,0 +1,47 @@ +package command + +import ( + "context" + "io" + "strings" + "testing" +) + +func TestSkillsListDelegatesToSkillsInstaller(t *testing.T) { + original := runSkillsCLI + t.Cleanup(func() { runSkillsCLI = original }) + var got []string + runSkillsCLI = func(_ context.Context, stdout, _ io.Writer, args ...string) error { + got = append([]string(nil), args...) + _, _ = io.WriteString(stdout, "agc-cli-usage\n") + return nil + } + out, err := execute("skills", "list", "--remote") + if err != nil { + t.Fatal(err) + } + if strings.Join(got, " ") != "--yes skills add Createitv/agc-cli --list" { + t.Fatalf("installer args = %q", got) + } + if out != "agc-cli-usage\n" { + t.Fatalf("output = %q", out) + } +} + +func TestSkillsInstallSelectsSkillAgentAndScope(t *testing.T) { + original := runSkillsCLI + t.Cleanup(func() { runSkillsCLI = original }) + var got []string + runSkillsCLI = func(_ context.Context, _, _ io.Writer, args ...string) error { + got = append([]string(nil), args...) + return nil + } + _, err := execute("skills", "install", "--name", "agc-auth", "--agent", "codex", "--global") + if err != nil { + t.Fatal(err) + } + want := "--yes skills add Createitv/agc-cli --skill agc-auth --agent codex --global" + if strings.Join(got, " ") != want { + t.Fatalf("installer args = %q, want %q", got, want) + } +} diff --git a/cmd/agc/command/skills_test.go b/cmd/agc/command/skills_test.go new file mode 100644 index 0000000..03945a5 --- /dev/null +++ b/cmd/agc/command/skills_test.go @@ -0,0 +1,70 @@ +package command + +import ( + "encoding/json" + "strings" + "testing" +) + +func TestSkillsList(t *testing.T) { + out, err := execute("skills", "list", "--pretty") + if err != nil { + t.Fatal(err) + } + var result struct { + Data []struct { + Name string `json:"name"` + Command string `json:"command"` + } `json:"data"` + } + if err := json.Unmarshal([]byte(out), &result); err != nil { + t.Fatal(err) + } + if len(result.Data) != 1 || result.Data[0].Name != "agc-cli" || result.Data[0].Command != "agc skills show agc-cli" { + t.Fatalf("unexpected catalog: %s", out) + } +} + +func TestSkillsShow(t *testing.T) { + out, err := execute("skills", "show", "agc-cli") + if err != nil { + t.Fatal(err) + } + var result struct { + Data struct { + Content string `json:"content"` + } `json:"data"` + } + if err := json.Unmarshal([]byte(out), &result); err != nil { + t.Fatal(err) + } + for _, want := range []string{"name: agc-cli", "agc endpoints", "--dry-run=false"} { + if !strings.Contains(result.Data.Content, want) { + t.Fatalf("missing %q: %s", want, out) + } + } + out, err = execute("skills", "show", "agc-cli", "--output", "markdown") + if err != nil || !strings.HasPrefix(out, "---\nname: agc-cli") { + t.Fatalf("markdown: %s, %v", out, err) + } +} + +func TestSkillsInvalidArguments(t *testing.T) { + for _, args := range [][]string{{"skills", "list", "extra"}, {"skills", "show"}, {"skills", "show", "missing"}, {"skills", "show", "agc-cli", "extra"}, {"skills", "list", "--output", "invalid"}, {"skills", "show", "agc-cli", "--output", "invalid"}} { + if _, err := execute(args...); err == nil { + t.Fatalf("expected error for %v", args) + } + } +} + +func TestSkillsDiscovery(t *testing.T) { + for _, args := range [][]string{{"--help"}, {"skills", "--help"}, {"skills", "list", "--output", "table"}, {"skills", "list", "--output", "markdown"}} { + out, err := execute(args...) + if err != nil { + t.Fatal(err) + } + if !strings.Contains(out, "skills") { + t.Fatalf("missing skills discovery: %s", out) + } + } +} diff --git a/cmd/agc/command/team_oauth_test.go b/cmd/agc/command/team_oauth_test.go new file mode 100644 index 0000000..025493f --- /dev/null +++ b/cmd/agc/command/team_oauth_test.go @@ -0,0 +1,42 @@ +package command + +import ( + "net/http" + "net/http/httptest" + "strings" + "sync/atomic" + "testing" +) + +func TestTeamListRejectsBearerOnlyBeforeNetwork(t *testing.T) { + var calls atomic.Int32 + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { calls.Add(1); w.Write([]byte(`{"ret":{"code":0}}`)) })) + defer server.Close() + out, err := execute("--project", t.TempDir(), "projects", "getteamlist", "--invoke", "--dry-run=false", "--token", "offline-bearer", "--base-url", server.URL) + if err == nil || calls.Load() != 0 { + t.Fatalf("OAuth-only API accepted Bearer or contacted network: %v, %d", err, calls.Load()) + } + if !strings.Contains(out, "oauth2Token") { + t.Fatalf("missing OAuth correction: %s", out) + } +} + +func TestTeamListUsesDocumentedOAuthHeader(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Header.Get("oauth2Token") != "offline-oauth" { + t.Error("OAuth header absent") + } + if r.Header.Get("Authorization") != "" { + t.Error("unexpected Bearer auth") + } + if r.URL.Path != "/api/ups/user-permission-service/v1/user-team-list" { + t.Error("wrong official team path") + } + w.Write([]byte(`{"ret":{"code":0},"teams":[]}`)) + })) + defer server.Close() + _, err := execute("--project", t.TempDir(), "projects", "getteamlist", "--invoke", "--dry-run=false", "--header", "oauth2Token=offline-oauth", "--base-url", server.URL) + if err != nil { + t.Fatal(err) + } +} diff --git a/cmd/agc/command/testdata/publishing-current.json b/cmd/agc/command/testdata/publishing-current.json new file mode 100644 index 0000000..e477ec4 --- /dev/null +++ b/cmd/agc/command/testdata/publishing-current.json @@ -0,0 +1,1279 @@ +{ + "checkedAt": "2026-10-07T02:20:10.353Z", + "source": "Official Huawei documentation read through browser DOM", + "endpoints": [ + { + "name": "创建APP ID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939", + "method": "POST", + "path": "/api/publish/v3/app", + "parameters": [ + { + "name": "projectId", + "in": "query", + "required": false, + "type": "String" + }, + { + "name": "appName", + "in": "body", + "required": true, + "type": "String(64)" + }, + { + "name": "packageName", + "in": "body", + "required": false, + "type": "String(128)" + }, + { + "name": "parentType", + "in": "body", + "required": true, + "type": "Integer(32)", + "example": "13" + }, + { + "name": "installationFree", + "in": "body", + "required": true, + "type": "Integer(32)", + "example": "1" + } + ], + "id": "app-create" + }, + { + "name": "查询应用包名对应的appid", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617", + "method": "GET", + "path": "/api/publish/v2/appid-list", + "parameters": [ + { + "name": "packageName", + "in": "query", + "required": true, + "type": "String(4096)" + }, + { + "name": "packageTypes", + "in": "query", + "required": false, + "type": "String(32)" + } + ], + "id": "appid-list" + }, + { + "name": "查询团队账号下的成员角色列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743", + "method": "GET", + "path": "/api/publish/v3/members-role-list", + "parameters": [ + { + "name": "fromPage", + "in": "query", + "required": true, + "type": "Integer" + }, + { + "name": "pageSize", + "in": "query", + "required": true, + "type": "Integer" + }, + { + "name": "languageCode", + "in": "query", + "required": true, + "type": "String(20)", + "example": "zh_cn" + } + ], + "id": "members-role-list" + }, + { + "name": "查询应用信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422", + "method": "GET", + "path": "/api/publish/v3/app-info", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String(32)" + }, + { + "name": "lang", + "in": "query", + "required": false, + "type": "String(16)" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer", + "example": "1" + }, + { + "name": "versionId", + "in": "query", + "required": false, + "type": "String" + } + ], + "id": "app-info-query-v3" + }, + { + "name": "更新应用基本信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246", + "method": "PUT", + "path": "/api/publish/v3/app-info", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String(32)" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "releasePhase", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "0" + }, + { + "name": "defaultLang", + "in": "body", + "required": false, + "type": "String(16)" + }, + { + "name": "harmonyChildType", + "in": "body", + "required": false, + "type": "Integer(4)" + }, + { + "name": "kindMainTag", + "in": "body", + "required": false, + "type": "Integer(4)" + }, + { + "name": "kindSubTags", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "privacyPolicy", + "in": "body", + "required": false, + "type": "String(255)" + }, + { + "name": "appNetType", + "in": "body", + "required": false, + "type": "Integer" + }, + { + "name": "publishCountry", + "in": "body", + "required": true, + "type": "String(2048)" + }, + { + "name": "appTariffType", + "in": "body", + "required": false, + "type": "String(16)" + }, + { + "name": "publicationNumber", + "in": "body", + "required": false, + "type": "String(50)" + }, + { + "name": "developerWebsite", + "in": "body", + "required": false, + "type": "String(255)" + }, + { + "name": "customInfo", + "in": "body", + "required": false, + "type": "CustInfo" + }, + { + "name": "deviceTypes", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "privacyRightsUrl", + "in": "body", + "required": false, + "type": "String(256)" + }, + { + "name": "registeredDclType", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "2" + }, + { + "name": "registeredIdType", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "registeredIdNumber", + "in": "body", + "required": false, + "type": "String(64)" + }, + { + "name": "registeredEntity", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "registeredEntityName", + "in": "body", + "required": false, + "type": "String(1024)" + }, + { + "name": "privacyAgreementId", + "in": "body", + "required": false, + "type": "String(32)" + }, + { + "name": "userAgreementUrl", + "in": "body", + "required": false, + "type": "String(512)" + }, + { + "name": "userAgreementIds", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "encrypted", + "in": "body", + "required": true, + "type": "Integer(32)" + }, + { + "name": "isAiGenerate", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "0" + }, + { + "name": "aiTypes", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "testUserName", + "in": "body", + "required": false, + "type": "String(128)" + }, + { + "name": "testUserPassword", + "in": "body", + "required": false, + "type": "String(128)" + }, + { + "name": "appRemark", + "in": "body", + "required": false, + "type": "String(300)" + }, + { + "name": "selfTestVideos", + "in": "body", + "required": false, + "type": "String(2000)" + }, + { + "name": "appReviewPhoneInfo", + "in": "body", + "required": false, + "type": "AppReviewContact" + }, + { + "name": "appReviewEmailInfo", + "in": "body", + "required": false, + "type": "AppReviewContact" + }, + { + "name": "appReviewName", + "in": "body", + "required": false, + "type": "String(256)" + }, + { + "name": "versionVocs", + "in": "body", + "required": false, + "type": "List" + } + ], + "id": "app-info-update-v3" + }, + { + "name": "更新应用语言信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569", + "method": "PUT", + "path": "/api/publish/v3/app-language-info", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "releasePhase", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "0" + }, + { + "name": "lang", + "in": "body", + "required": true, + "type": "String(8)" + }, + { + "name": "appName", + "in": "body", + "required": false, + "type": "String(64)" + }, + { + "name": "appDesc", + "in": "body", + "required": false, + "type": "String(8000)" + }, + { + "name": "briefInfo", + "in": "body", + "required": false, + "type": "String(80)" + }, + { + "name": "newFeatures", + "in": "body", + "required": false, + "type": "String(500)" + } + ], + "id": "language-info-update-v3" + }, + { + "name": "删除应用语言信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621", + "method": "DELETE", + "path": "/api/publish/v2/app-language-info", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String" + }, + { + "name": "lang", + "in": "query", + "required": true, + "type": "String" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer", + "example": "1" + } + ], + "id": "language-info-delete" + }, + { + "name": "更新应用文件信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430", + "method": "PUT", + "path": "/api/publish/v3/app-file-info", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String(32)" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "releasePhase", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "0" + }, + { + "name": "appIconList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "screenShotList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "introVideoList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "rcmdVideoList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "rcmdPicList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "elecCertificate", + "in": "body", + "required": false, + "type": "String(512)" + }, + { + "name": "certificateList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "publicationList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "packagePermissionIntroVideoList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "otherCertificatesURL", + "in": "body", + "required": false, + "type": "String(512)" + }, + { + "name": "updateScreenShotList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "updateVideoList", + "in": "body", + "required": false, + "type": "List" + } + ], + "id": "app-file-info-v3" + }, + { + "name": "更新应用软件包信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250", + "method": "PUT", + "path": "/api/publish/v3/app-package-info", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "releasePhase", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "0" + }, + { + "name": "fileName", + "in": "body", + "required": true, + "type": "String(255)" + }, + { + "name": "objectId", + "in": "body", + "required": true, + "type": "String(512)" + } + ], + "id": "app-package-info-update" + }, + { + "name": "更新版本上架时间", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573", + "method": "PUT", + "path": "/api/publish/v2/on-shelf-time", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String" + }, + { + "name": "changeType", + "in": "body", + "required": true, + "type": "Integer", + "example": "2" + }, + { + "name": "releaseTime", + "in": "body", + "required": true, + "type": "String" + }, + { + "name": "releaseType", + "in": "body", + "required": true, + "type": "Integer", + "example": "1" + } + ], + "id": "update-releasetime" + }, + { + "name": "更新分阶段发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625", + "method": "PUT", + "path": "/api/publish/v2/version/phased-release", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "versionId", + "in": "body", + "required": true, + "type": "String(32)" + }, + { + "name": "releasePhase", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "3" + }, + { + "name": "state", + "in": "body", + "required": false, + "type": "String(16)", + "example": "SUSPEND" + }, + { + "name": "description", + "in": "body", + "required": false, + "type": "String(500)" + }, + { + "name": "phaseDay", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "2" + } + ], + "id": "phased-release-update" + }, + { + "name": "查询应用软件包信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469", + "method": "GET", + "path": "/api/publish/v2/app-package-info", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "packageId", + "in": "query", + "required": true, + "type": "String(32)" + } + ], + "id": "app-package-info-query" + }, + { + "name": "查询软件包编译状态", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "method": "GET", + "path": "/api/publish/v3/package/compile/status", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String(32)" + }, + { + "name": "pkgIds", + "in": "query", + "required": true, + "type": "String(500)" + } + ], + "id": "package-compile-status-v3" + }, + { + "name": "查询应用所有版本类型的版本列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254", + "method": "POST", + "path": "/api/publish/v3/version/brief-info/list", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": false, + "type": "String(32)", + "note": "Official packageName remark allows appId OR packageName." + }, + { + "name": "packageName", + "in": "body", + "required": false, + "type": "String(128)" + }, + { + "name": "state", + "in": "body", + "required": false, + "type": "String(64)", + "example": "SUSPEND" + } + ], + "id": "app-version-list" + }, + { + "name": "查询应用未处理的问题工单", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "method": "POST", + "path": "/api/publish/v1/app-voc/version-voc", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "vocId", + "in": "body", + "required": false, + "type": "String(32)" + }, + { + "name": "vocDesc", + "in": "body", + "required": false, + "type": "String(255)" + }, + { + "name": "pageNo", + "in": "body", + "required": true, + "type": "Integer(32)" + }, + { + "name": "pageSize", + "in": "body", + "required": true, + "type": "Integer(32)" + } + ], + "id": "app-version-voc" + }, + { + "name": "查询需要上传的资质文件信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577", + "method": "GET", + "path": "/api/publish/v2/tag-qual-dependent", + "parameters": [], + "id": "tag-qual-dependent" + }, + { + "name": "提交资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", + "method": "POST", + "path": "/api/publish/v2/qualification-review-task", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "tagQualInfos", + "in": "body", + "required": true, + "type": "List" + } + ], + "id": "qualification-review-create" + }, + { + "name": "查询资质审核任务详情", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438", + "method": "GET", + "path": "/api/publish/v2/qualification-review-task", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "tagIds", + "in": "query", + "required": true, + "type": "String(256)" + } + ], + "id": "qualification-review-query" + }, + { + "name": "修改资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", + "method": "PUT", + "path": "/api/publish/v2/qualification-review-task", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "tagQualInfos", + "in": "body", + "required": true, + "type": "List" + } + ], + "id": "qualification-review-update" + }, + { + "name": "撤销资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258", + "method": "PUT", + "path": "/api/publish/v2/qualification-review-task/cancel", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "taskId", + "in": "body", + "required": true, + "type": "String(32)" + } + ], + "id": "qualification-review-cancel" + }, + { + "name": "删除资质审核任务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788", + "method": "DELETE", + "path": "/api/publish/v2/qualification-review-task", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "tagIds", + "in": "body", + "required": true, + "type": "List" + } + ], + "id": "qualification-review-delete" + }, + { + "name": "新建用户协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581", + "method": "POST", + "path": "/api/publish/v2/agreement", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "type", + "in": "body", + "required": true, + "type": "Integer(32)", + "example": "2" + }, + { + "name": "defaultLang", + "in": "body", + "required": false, + "type": "String(20)" + }, + { + "name": "agreementInfos", + "in": "body", + "required": false, + "type": "List", + "note": "Official example and array-length description clarify the table type." + }, + { + "name": "channel", + "in": "body", + "required": false, + "type": "Integer(32)" + } + ], + "id": "user-agreement-create" + }, + { + "name": "查询用户协议列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442", + "method": "POST", + "path": "/api/publish/v2/agreement/list", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "agreementIdList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "name", + "in": "body", + "required": true, + "type": "String(100)" + }, + { + "name": "status", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "2" + }, + { + "name": "type", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "2" + }, + { + "name": "fromRecCount", + "in": "body", + "required": false, + "type": "Integer(32)" + }, + { + "name": "maxReqCount", + "in": "body", + "required": false, + "type": "Integer" + } + ], + "id": "user-agreement-list" + }, + { + "name": "更新用户协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626", + "method": "PUT", + "path": "/api/publish/v2/agreement", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "id", + "in": "body", + "required": true, + "type": "String(32)" + }, + { + "name": "defaultLang", + "in": "body", + "required": false, + "type": "String(20)" + }, + { + "name": "agreementInfos", + "in": "body", + "required": false, + "type": "List" + } + ], + "id": "user-agreement-update" + }, + { + "name": "提交隐私政策协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633", + "method": "PUT", + "path": "/api/publish/v2/agreement/submit", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "id", + "in": "body", + "required": true, + "type": "String(32)" + }, + { + "name": "requireConfirm", + "in": "body", + "required": false, + "type": "Integer(32)" + } + ], + "id": "privacy-agreement-submit" + }, + { + "name": "查询隐私政策协议列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925", + "method": "POST", + "path": "/api/publish/v2/agreement/list", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "agreementIdList", + "in": "body", + "required": false, + "type": "List" + }, + { + "name": "name", + "in": "body", + "required": true, + "type": "String(100)" + }, + { + "name": "status", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "2" + }, + { + "name": "type", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "fromRecCount", + "in": "body", + "required": false, + "type": "Integer(32)" + }, + { + "name": "maxReqCount", + "in": "body", + "required": false, + "type": "Integer" + } + ], + "id": "privacy-agreement-list" + }, + { + "name": "更新隐私政策协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169", + "method": "PUT", + "path": "/api/publish/v2/agreement", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "id", + "in": "body", + "required": true, + "type": "String(32)" + }, + { + "name": "defaultLang", + "in": "body", + "required": false, + "type": "String(20)" + }, + { + "name": "agreementInfos", + "in": "body", + "required": false, + "type": "List" + } + ], + "id": "privacy-agreement-update" + }, + { + "name": "申请年龄分级", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262", + "method": "POST", + "path": "/api/publish/v2/app-age-rating", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "releasePhase", + "in": "query", + "required": false, + "type": "Integer(32)", + "example": "0" + }, + { + "name": "feedback", + "in": "body", + "required": true, + "type": "String(8192)" + }, + { + "name": "expectedRating", + "in": "body", + "required": false, + "type": "Integer(32)" + }, + { + "name": "ratingRule", + "in": "body", + "required": false, + "type": "Integer(32)" + }, + { + "name": "childFlag", + "in": "body", + "required": false, + "type": "Integer(32)" + } + ], + "id": "app-age-rating" + }, + { + "name": "提交发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585", + "method": "POST", + "path": "/api/publish/v3/app-submit", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String(32)" + }, + { + "name": "releaseTime", + "in": "body", + "required": false, + "type": "String(64)" + }, + { + "name": "remark", + "in": "body", + "required": false, + "type": "String(300)" + }, + { + "name": "releaseType", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "1" + }, + { + "name": "releasePhase", + "in": "body", + "required": false, + "type": "Integer(32)", + "example": "0" + }, + { + "name": "phasedReleaseDescription", + "in": "body", + "required": false, + "type": "String(500)" + } + ], + "id": "app-submit-v3" + }, + { + "name": "撤销审核", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637", + "method": "PUT", + "path": "/api/publish/v3/version/on-shelf/cancel", + "parameters": [ + { + "name": "appId", + "in": "header", + "required": true, + "type": "String(32)" + }, + { + "name": "versionId", + "in": "body", + "required": true, + "type": "String" + } + ], + "id": "on-shelf-cancel" + }, + { + "name": "下架应用", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450", + "method": "POST", + "path": "/api/publish/v2/app-shelf-off", + "parameters": [ + { + "name": "appId", + "in": "query", + "required": true, + "type": "String(32)" + }, + { + "name": "reason", + "in": "query", + "required": true, + "type": "String(1024)" + }, + { + "name": "releaseType", + "in": "query", + "required": false, + "type": "Integer", + "example": "1" + } + ], + "id": "app-shelf-off" + } + ] +} diff --git a/docs/AGENT_SKILLS.md b/docs/AGENT_SKILLS.md index 2276a8e..97f8dd7 100644 --- a/docs/AGENT_SKILLS.md +++ b/docs/AGENT_SKILLS.md @@ -25,7 +25,7 @@ agc version 通过 agc-cli 浏览并安装全部技能: ```bash -agc skills list +agc skills list --remote agc skills install --agent codex --global ``` diff --git a/docs/CLI_USAGE.md b/docs/CLI_USAGE.md index b6d03c1..cc887e5 100644 --- a/docs/CLI_USAGE.md +++ b/docs/CLI_USAGE.md @@ -217,6 +217,10 @@ agc endpoints --pretty 包含数组、对象、数字或布尔值的请求请使用 `--body`。dry-run 不展示完整 headers/body,也不校验全部华为业务字段;发送前需要自行核对请求文件、权限和官方协议。 +## 现行 Publishing API 命令 + +通过 `agc endpoints --family publishing` 查询接口,并使用 `--docs --pretty` 阅读参数契约。 + ## 应用发布流程 发布通常涉及:**查询应用 → 上传文件 → 更新应用文件信息 → 完善资料 → 提交审核 → 查询远程状态**。 diff --git a/docs/PUBLISHING_API_REFERENCE.md b/docs/PUBLISHING_API_REFERENCE.md new file mode 100644 index 0000000..e86ac0b --- /dev/null +++ b/docs/PUBLISHING_API_REFERENCE.md @@ -0,0 +1,1724 @@ +# Publishing API 逐项 CLI 参考 + +本文从浏览器保存的官方正文生成,每项说明用途、传输位置、参数和前置条件。生成命令:`python3 scripts/render-publishing-guide.py`。 + +流程和请求文件示例见 [Publishing 使用与核验](PUBLISHING_WORKFLOWS.md)。表格保留官方必选标记;条件要求和表格/示例冲突需要同时阅读说明。本文件不代表所有模型规则已实现或全部线上操作已验收。 + +## 参数位置 + +`query` 使用 `--query key=value`,`header` 使用 `--header key=value`,`body` 使用 JSON 文件 `--body request.json` 或已声明类型的 `--field key=value`。JSON 整数不加引号,对象和数组按实际模型展开。 + +实际调用选择 `--profile PROFILE`,先使用 `--invoke --dry-run` 查看请求计划;只有准备实际调用时才使用 `--invoke --dry-run=false`。dry-run 不证明资源状态、权限或审核结果。 + +## 创建APP ID + +命令:`agc publishing app-create`。请求:`POST /api/publish/v3/app`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939);官网更新:2026-09-04 16:04;浏览器读取:2026-10-07T05:11:11.924Z。 + +此接口用于为HarmonyOS应用/元服务创建APP ID。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### header(OAuth客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| teamId | M | String(64) | 开发者所在团队的团队ID。 | +| oauth2Token | M | String | 认证信息,传入获取用户授权码中获取的Access Token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| projectId | O | String | 项目ID,获取方法请参见查看应用信息。 如果不传projectId,系统会先在内部创建一个与应用同名的项目,随后再创建应用。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appName | M | String(64) | 应用名称。 | +| packageName | O | String(128) | 应用包名,必须唯一,且不能与其他应用(包括Android应用)包名相同。 说明 installationFree取值为0(HarmonyOS应用)时,此参数必填。 installationFree取值为1(元服务)时,系统将自动生成包名,此参数无需填写。 | +| parentType | M | Integer(32) | 应用分类。 取值范围: 2:游戏 13:应用 | +| installationFree | M | Integer(32) | 应用类型。 取值范围: 0:HarmonyOS应用 1:元服务 默认值:0 | + +### 请求说明 + +本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing app-create --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询应用包名对应的appid + +命令:`agc publishing appid-list`。请求:`GET /api/publish/v2/appid-list`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T05:11:13.650Z。 + +此接口用于根据HarmonyOS应用/元服务的应用包名查询对应的应用ID,支持一次查询多个应用包名。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section19247123515514) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| packageName | M | String(4096) | 需要查询的应用包名。 多个包名以逗号分隔,最多支持50个。 | +| packageTypes | O | String(32) | 通过软件包类型过滤应用,只查询指定软件包类型的应用。 取值范围: 7:APP(HarmonyOS应用/元服务) | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing appid-list --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询团队账号下的成员角色列表 + +命令:`agc publishing members-role-list`。请求:`GET /api/publish/v3/members-role-list`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743);官网更新:2026-07-31 17:44;浏览器读取:2026-10-07T05:11:33.888Z。 + +此接口用于查询团队账号下的成员角色列表和团队主账号的开发者信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营、开发、客服、财务。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section420734618165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| fromPage | M | Integer | 起始页。 最小值:1,表示从第1页开始查询。 | +| pageSize | M | Integer | 每页查询的条数。 取值范围:[1,50] | +| languageCode | M | String(20) | 语言码。 取值范围: zh_cn:中文 en_us:英文 ru_ru:俄语 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing members-role-list --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询应用信息 + +命令:`agc publishing app-info-query-v3`。请求:`GET /api/publish/v3/app-info`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422);官网更新:2026-07-31 17:44;浏览器读取:2026-10-07T05:11:36.198Z。 + +此接口用于根据指定语言和应用ID查询HarmonyOS应用/元服务的详细信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String(32) | 需要查询的应用ID。 | +| lang | O | String(16) | 需要查询的语言。 说明 取值参考语言类型。 不传该参数,则查询全部语言的应用信息。 | +| releaseType | O | Integer | 应用发布方式。 取值范围: 1:全网 6:HarmonyOS测试发布方式(API>=10) 默认值:1 | +| versionId | O | String | 需要查询的版本ID。 注意 releaseType为6,该字段必填。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing app-info-query-v3 --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新应用基本信息 + +命令:`agc publishing app-info-update-v3`。请求:`PUT /api/publish/v3/app-info`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T05:11:38.645Z。 + +此接口用于更新指定HarmonyOS应用/元服务的应用详情。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section886219295206) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String(32) | 需要更新的应用ID。 | +| releaseType | O | Integer(32) | 应用发布方式。 取值范围: 1:全网 默认值:1 | +| releasePhase | O | Integer(32) | 分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| defaultLang | O | String(16) | 应用的默认语言。 说明 取值参见语言类型。 | +| harmonyChildType | O | Integer(4) | HarmonyOS应用/元服务的二级分类。 固定ID。 说明 取值参见应用游戏分类。 | +| kindMainTag | O | Integer(4) | HarmonyOS应用/元服务主标签。 固定ID。 说明 取值参见应用游戏分类的“标签”列。 | +| kindSubTags | O | List | HarmonyOS应用/元服务附属标签。 固定ID。最多可选4个附属标签。 说明 取值参见应用游戏分类的“标签”列。 | +| privacyPolicy | O | String(255) | 隐私政策网址。 | +| appNetType | O | Integer | 应用联网类型。 取值范围: 1:单机 2:网游 默认值:1 | +| publishCountry | M | String(2048) | 应用发布国家的国家码。 多个国家以英文逗号分隔,例如:“CN,DE,MC”。 如果取值为“OTHER”,则表示当App Gallery支持的国家或地区列表中新增某个国家或地区时,应用将自动分发到新增的国家和地区。 注意 取值不能只包含OTHER。 如果国家码有设置非CN的地区,将存在个人信息出境的情况,具体请参考个人信息出境授权声明。 | +| appTariffType | O | String(16) | 应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 支持设置多个,使用英文逗号分隔,例如“1,2,3”。 | +| publicationNumber | O | String(50) | 版号信息。 此参数只支持游戏类应用。 | +| developerWebsite | O | String(255) | 开发者官网。 | +| customInfo | O | CustInfo | 客服信息。 | +| deviceTypes | O | List | 设备类型信息。 | +| privacyRightsUrl | O | String(256) | 隐私权利网址。 即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。 | +| registeredDclType | O | Integer(32) | APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP | +| registeredIdType | O | Integer(32) | 主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码) | +| registeredIdNumber | O | String(64) | 主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码 | +| registeredEntity | O | Integer(32) | 主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 若在版本提交时,该字段值选择“一致”,则主办单位名称和证件号,将直接复用开发者联盟注册账号信息。 若您提交的主办单位信息与联盟账号信息不一致,该字段值却选择了“一致”,则系统将自动判定为“不一致”,将会影响审核结果。 | +| registeredEntityName | O | String(1024) | 主办单位名称。 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 | +| privacyAgreementId | O | String(32) | 隐私协议ID。 | +| userAgreementUrl | O | String(512) | 用户协议URL。 | +| userAgreementIds | O | List | 用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。 | +| encrypted | M | Integer(32) | 包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1 | +| isAiGenerate | O | Integer(32) | 是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。 | +| aiTypes | O | List | 涉及的AI生成合成服务类型。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景 说明 isAiGenerate取值为1(涉及)时,此参数必填。 | +| testUserName | O | String(128) | 应用审核信息的测试账号用户名。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号用户名。 | +| testUserPassword | O | String(128) | 应用审核信息的测试账号密码。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号密码。 | +| appRemark | O | String(300) | 应用审核信息的备注。 提供有助于审核人员更准确、高效测试您应用的额外信息,比如在审核时需要的特别设置等。 | +| selfTestVideos | O | String(2000) | 应用审核信息的自测文件。 格式为JSON字符串,示例:{"objectId1":"文件名1","objectId2":"文件名2"...} 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 最多可上传5个自测视频,总大小不超过500MB。 注意 此字段只支持元服务。 元服务需要与设备联动时,此参数必填。 | +| appReviewPhoneInfo | O | AppReviewContact | 应用负责人的手机号信息。用于沟通审核问题。 | +| appReviewEmailInfo | O | AppReviewContact | 应用负责人的邮箱账号信息。用于接收上架审核结果,应用整改或下架通知。 | +| appReviewName | O | String(256) | 应用负责人的姓名。 | +| versionVocs | O | List | 应用版本已解决问题。 数组长度不超过1000。 说明 调用查询应用未处理的问题工单接口可以查询用户反馈的应用问题。如果在应用版本更新时某些问题已经解决,可以将这些问题提交审核,工单平台验证通过后会关闭工单。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带更新的应用信息,参数如下表所示。 + +### 完整模型及示例 + +```sh +agc publishing app-info-update-v3 --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新应用语言信息 + +命令:`agc publishing language-info-update-v3`。请求:`PUT /api/publish/v3/app-language-info`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:55:27.457Z。 + +此接口用于更新指定的HarmonyOS应用/元服务的语言描述信息,如果当前没有语言描述信息则新增。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section41341319578) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String | 需要更新语言描述信息的应用ID。 | +| releaseType | O | Integer(32) | 应用发布方式。 取值范围: 1:全网 默认值:1 | +| releasePhase | O | Integer(32) | 分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| lang | M | String(8) | 语言种类。 说明 取值参见语言类型。 | +| appName | O | String(64) | 对应语言的应用名称。 新增一个语言种类时,此字段必选。 | +| appDesc | O | String(8000) | 对应语言的应用描述信息。 | +| briefInfo | O | String(80) | 对应语言的一句话简介。 | +| newFeatures | O | String(500) | 对应语言的新版本简介。 说明 升级版本时,此参数必填。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带更新的语言描述信息,参数如下表所示。 + +appDesc、briefInfo和newFeatures三个参数的取值不能相同。 + +### 完整模型及示例 + +```sh +agc publishing language-info-update-v3 --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 删除应用语言信息 + +命令:`agc publishing language-info-delete`。请求:`DELETE /api/publish/v2/app-language-info`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:55:29.656Z。 + +此接口用于删除指定HarmonyOS应用/元服务不需要的语言描述信息,默认语言不支持删除。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section23242264517) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String | 需要删除语言描述信息的应用ID。 | +| lang | M | String | 需要删除的语言。 说明 取值参见语言类型。 | +| releaseType | O | Integer | 应用发布方式。 取值范围: 1:全网 默认值:1 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing language-info-delete --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新应用文件信息 + +命令:`agc publishing app-file-info-v3`。请求:`PUT /api/publish/v3/app-file-info`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:55:31.723Z。 + +图片、视频等文件上传完成后,通过该接口刷新HarmonyOS应用/元服务的文件信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section156021546155912) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String(32) | 需要更新的应用ID。 | +| releaseType | O | Integer(32) | 应用发布方式。 取值范围: 1:全网 默认值:1 | +| releasePhase | O | Integer(32) | 分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appIconList | O | List | 应用图标信息。 数组长度不超过20。 说明 应用图标必须与软件包中的应用图标一致,且需符合审核政策与应用文件要求。 | +| screenShotList | O | List | 应用介绍截图信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。 | +| introVideoList | O | List | 应用介绍视频信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。 | +| rcmdVideoList | O | List | 推荐视频信息。 数组长度不超过20。 | +| rcmdPicList | O | List | 推荐图片信息。 数组长度不超过20。 | +| elecCertificate | O | String(512) | 电子版本证书。 | +| certificateList | O | List | 应用版权证书或代理证书。 数组长度不超过10。 | +| publicationList | O | List | 版号证明。 数组长度不超过10。 | +| packagePermissionIntroVideoList | O | List | 包权限使用场景说明视频。 数组长度不超过100。 说明 隐私权限说明的“权限描述”、“权限使用设备范围”和“权限使用理由”从上传的软件包体中读取,无需通过接口更新。 | +| otherCertificatesURL | O | String(512) | 授权书及其他材料文件压缩包的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 若文件格式不正确,提交发布时会出错,具体限制如下: 压缩包必须为zip格式,不超过200MB。 解压后的大小不超过1GB。 文件夹层级不超过3层。 只能包含JPG、JPEG、BMP格式图片和PDF格式的文件,累计不超过200个。 说明 此字段只支持HarmonyOS应用,不支持元服务。 | +| updateScreenShotList | O | List | 更新截图素材。 数组长度不超过20。 | +| updateVideoList | O | List | 更新视频素材。 数组长度不超过20。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带更新的应用文件信息,参数如下表所示。 + +各文件类型对应的文件上传要求请参见应用文件要求。 + +### 完整模型及示例 + +```sh +agc publishing app-file-info-v3 --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新应用软件包信息 + +命令:`agc publishing app-package-info-update`。请求:`PUT /api/publish/v3/app-package-info`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:55:46.452Z。 + +APP软件包上传完成后,通过该接口刷新HarmonyOS应用/元服务的软件包信息。 + +该接口支持解析软件包中的构建版本号(buildVersion),用于区分同一主版本下的不同测试子版本。解析完成后,可以从查询应用软件包信息接口返回的packageInfo参数中获取buildVersion字段。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section156021546155912) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String | 需要更新的应用ID。 | +| releaseType | O | Integer(32) | 应用发布方式。 取值范围: 1:全网 默认值:1 | +| releasePhase | O | Integer(32) | 分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1131102811712) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| fileName | M | String(255) | 文件名称,包括文件的后缀名。 | +| objectId | M | String(512) | 文件在文件服务器中的对象ID。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带更新的应用软件包信息,参数如下表所示。 + +### 完整模型及示例 + +```sh +agc publishing app-package-info-update --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新版本上架时间 + +命令:`agc publishing update-releasetime`。请求:`PUT /api/publish/v2/on-shelf-time`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:55:48.314Z。 + +此接口用于设置版本的上架时间。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section165302018915) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String | 应用ID。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| changeType | M | Integer | 修改类型。 取值范围: 2:指定时间上架改为审核通过立即上架 3:变更定时上架时间 | +| releaseTime | M | String | 指定的版本上架时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 changeType为3时有效。 | +| releaseType | M | Integer | 发布方式。 取值范围: 1:全网 目前支持全网及releasePhase为3的分阶段发布。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带更新版本上架时间内容,参数如下表所示。 + +### 完整模型及示例 + +```sh +agc publishing update-releasetime --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新分阶段发布 + +命令:`agc publishing phased-release-update`。请求:`PUT /api/publish/v2/version/phased-release`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:55:50.500Z。 + +此接口用于将分阶段发布修改为全网发布,或者更新分阶段发布的设置。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| versionId | M | String(32) | 版本ID。 可从查询应用所有版本类型的版本列表接口返回的versionId参数中获取。 | +| releasePhase | O | Integer(32) | 分阶段发布标识。 取值范围: 3:分阶段。 4:分阶段转全网。 | +| state | O | String(16) | 分阶段发布的状态。 取值范围: SUSPEND:暂停。 RELEASE:恢复为发布中。 | +| description | O | String(500) | 分阶段发布说明。 | +| phaseDay | O | Integer(32) | 更新分阶段天数。 取值范围2、3、4、5、6、7,对应分阶段发布比例加速到2%、5%、10%、20%、50%、100%。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带分阶段发布信息,参数如下表所示。 + +### 完整模型及示例 + +```sh +agc publishing phased-release-update --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询应用软件包信息 + +命令:`agc publishing app-package-info-query`。请求:`GET /api/publish/v2/app-package-info`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:01.749Z。 + +此接口用于查询HarmonyOS应用/元服务的软件包信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section165302018915) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| packageId | M | String(32) | 待查询的软件包ID。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing app-package-info-query --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询软件包编译状态 + +命令:`agc publishing package-compile-status-v3`。请求:`GET /api/publish/v3/package/compile/status`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:03.411Z。 + +此接口用于查询HarmonyOS应用/元服务的软件包的编译状态。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section165302018915) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String(32) | 应用ID。 | +| pkgIds | M | String(500) | 待查询的软件包ID。 多个ID之间用英文逗号分隔。 可从更新应用软件包信息接口返回的packageId参数中获取。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing package-compile-status-v3 --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询应用所有版本类型的版本列表 + +命令:`agc publishing app-version-list`。请求:`POST /api/publish/v3/version/brief-info/list`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254);官网更新:2026-07-31 17:44;浏览器读取:2026-10-07T04:56:06.794Z。 + +此接口用于获取HarmonyOS应用/元服务的所有版本类型(含商用版本和测试版本)的版本列表,帮助开发者了解版本发布状态。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| packageName | O | String(128) | 应用包名。 说明 appId和packageName至少传一个。 | +| state | O | String(64) | 版本状态。 多个状态用逗号分隔。 说明 state字段的取值请参考AppInfo中的releaseState参数。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带查询应用所有版本类型的版本列表,参数如下表所示。 + +### 完整模型及示例 + +```sh +agc publishing app-version-list --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询应用未处理的问题工单 + +命令:`agc publishing app-version-voc`。请求:`POST /api/publish/v1/app-voc/version-voc`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:19.563Z。 + +此接口用于查询HarmonyOS应用/元服务未处理的问题工单。 + +调用本接口前必须保证应用软件包已经上传。 + +接口调用者的角色:账号持有者、管理员、APP管理员、开发。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section11431111271820) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| vocId | O | String(32) | 工单ID。 | +| vocDesc | O | String(255) | 工单描述。 | +| pageNo | M | Integer(32) | 当前页。 最小值:1 | +| pageSize | M | Integer(32) | 每页数量。 最大值:100 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing app-version-voc --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询需要上传的资质文件信息 + +命令:`agc publishing tag-qual-dependent`。请求:`GET /api/publish/v2/tag-qual-dependent`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:24.391Z。 + +此接口用于查询元服务需要上传的所有资质文件信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing tag-qual-dependent --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 提交资质审核任务 + +命令:`agc publishing qualification-review-create`。请求:`POST /api/publish/v2/qualification-review-task`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:28.028Z。 + +此接口用于提交元服务的资质审核任务。 + +应用设备类型仅选择智能手表或运动手表时,不支持提交资质审核任务。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| tagQualInfos | M | List | 标签和标签对应的资质信息列表。 数组长度不超过5。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing qualification-review-create --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询资质审核任务详情 + +命令:`agc publishing qualification-review-query`。请求:`GET /api/publish/v2/qualification-review-task`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:44.080Z。 + +此接口用于查询元服务的资质审核任务详情。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section165302018915) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| tagIds | M | String(256) | 审核任务包含的标签ID列表,逗号分隔。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing qualification-review-query --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 修改资质审核任务 + +命令:`agc publishing qualification-review-update`。请求:`PUT /api/publish/v2/qualification-review-task`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:45.618Z。 + +此接口用于修改元服务的资质审核任务。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| tagQualInfos | M | List | 标签和标签对应的资质信息列表。 数组长度不超过5。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing qualification-review-update --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 撤销资质审核任务 + +命令:`agc publishing qualification-review-cancel`。请求:`PUT /api/publish/v2/qualification-review-task/cancel`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:56:47.305Z。 + +此接口用于撤销元服务的资质审核任务。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| taskId | M | String(32) | 资质审核任务ID。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing qualification-review-cancel --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 删除资质审核任务 + +命令:`agc publishing qualification-review-delete`。请求:`DELETE /api/publish/v2/qualification-review-task`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:57:03.034Z。 + +此接口用于删除元服务的资质审核任务。 + +如果元服务资质审核已通过,但在提交上架时因资质问题被驳回,需要先调用该接口移除旧的资质材料,然后重新提交资质审核任务。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| tagIds | M | List | 需要删除的资质审核标签ID列表,逗号分隔。 数组长度不超过5。 说明 具体取值请参见元服务的“标签ID”列。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing qualification-review-delete --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 新建用户协议 + +命令:`agc publishing user-agreement-create`。请求:`POST /api/publish/v2/agreement`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:57:04.732Z。 + +此接口用于新建HarmonyOS应用/元服务的用户协议。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section11431111271820) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| type | M | Integer(32) | 协议类型。 取值范围: 2:用户协议 | +| defaultLang | O | String(20) | 用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾) | +| agreementInfos | O | AgreementInfo | 用户协议列表。 数组长度不超过100。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing user-agreement-create --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询用户协议列表 + +命令:`agc publishing user-agreement-list`。请求:`POST /api/publish/v2/agreement/list`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:57:06.324Z。 + +此接口用于查询HarmonyOS应用/元服务的用户协议信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| agreementIdList | O | List | 用户协议ID。 数组长度为1~1000。 | +| name | M | String(100) | 用户协议名称。 使用模糊查询方式。 | +| status | O | Integer(32) | 用户协议状态。 取值范围: 2:已完成 3:已删除 | +| type | O | Integer(32) | 协议类型。 取值范围: 2:用户协议 | +| fromRecCount | O | Integer(32) | 查询起始位置。 默认值:1 | +| maxReqCount | O | Integer | 最大请求查询数。 取值范围:[1,100] 默认值:30 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing user-agreement-list --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新用户协议 + +命令:`agc publishing user-agreement-update`。请求:`PUT /api/publish/v2/agreement`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:57:18.109Z。 + +此接口用于更新HarmonyOS应用/元服务的用户协议信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section11431111271820) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| id | M | String(32) | 用户协议ID。 | +| defaultLang | O | String(20) | 用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾) | +| agreementInfos | O | List | 用户协议列表。 数组长度不超过100。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing user-agreement-update --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 提交隐私政策协议 + +命令:`agc publishing privacy-agreement-submit`。请求:`PUT /api/publish/v2/agreement/submit`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:57:20.479Z。 + +此接口用于提交HarmonyOS应用/元服务的隐私政策协议。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section1131102811712) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| id | M | String(32) | 隐私政策协议ID。 | +| requireConfirm | O | Integer(32) | 是否弹窗确认。 取值范围: 1:是 0:否 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing privacy-agreement-submit --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 查询隐私政策协议列表 + +命令:`agc publishing privacy-agreement-list`。请求:`POST /api/publish/v2/agreement/list`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T05:10:26.407Z。 + +此接口用于查询HarmonyOS应用/元服务的隐私政策协议信息。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| agreementIdList | O | List | 隐私政策协议ID。 数组长度为1~1000。 | +| name | M | String(100) | 隐私政策协议名称。 使用模糊查询方式。 | +| status | O | Integer(32) | 隐私政策协议状态。 取值范围: 1:草稿 2:已完成 3:已删除 不传值:默认查未删除的记录 | +| type | O | Integer(32) | 协议类型。 取值范围: 1:隐私政策协议 | +| fromRecCount | O | Integer(32) | 起始页数。 默认值:1 | +| maxReqCount | O | Integer | 每页返回条数。 取值范围:[1,100] 默认值:30 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing privacy-agreement-list --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 更新隐私政策协议 + +命令:`agc publishing privacy-agreement-update`。请求:`PUT /api/publish/v2/agreement`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T05:06:42.704Z。 + +此接口用于更新HarmonyOS应用/元服务的隐私政策协议。接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +若隐私政策协议被在架版本关联,编辑后需要提交华为运营审核,待协议审核通过后,更新的内容方可生效。 + +若隐私政策协议被状态为“审核中”的应用关联,将不支持编辑。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section11431111271820) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| id | M | String(32) | 隐私政策协议ID。 | +| defaultLang | O | String(20) | 隐私政策协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾) | +| agreementInfos | O | List | 隐私政策协议列表。 数组长度不超过100。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing privacy-agreement-update --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 申请年龄分级 + +命令:`agc publishing app-age-rating`。请求:`POST /api/publish/v2/app-age-rating`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:57:45.706Z。 + +此接口用于申请或修改HarmonyOS应用/元服务的年龄分级。 + +接口调用者的角色:账号持有者、管理员、APP管理员、运营。 + +调用本接口前需完成应用分类设置,明确是游戏类应用还是普通应用。 + +### header(认证方式以正文说明为准) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID。 | +| Authorization | M | String | 认证信息。 格式:Authorization: Bearer ${access_token} | +| appId | M | String(32) | 应用ID。 获取方法参考查看应用信息。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section23242264517) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| releaseType | O | Integer(32) | 应用发布方式。 取值范围: 1:全网 默认值:1 | +| releasePhase | O | Integer(32) | 分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| feedback | M | String(8192) | 问卷内容。 说明 具体请参见feedback获取方式。 | +| expectedRating | O | Integer(32) | 预期年龄分级。 取值范围: 1:巴西适用所有年龄段,中国区及其他区域年满3周岁 2:中国区年满8周岁,巴西年满10周岁,其他区域年满7周岁 3:巴西年满14周岁,中国区及其他区域年满12周岁 4:年满16周岁 5:年满18周岁 | +| ratingRule | O | Integer(32) | 年龄分级生效规则。 取值范围: 0:以问卷内容评级结果为准。 1:当预期年龄分级expectedRating设置的值大于问卷评级结果中的年龄值时,以预期年龄分级为准,否则以问卷内容评级结果为准。 | +| childFlag | O | Integer(32) | 应用是否仅面向儿童。 取值范围: 0:应用不仅面向儿童 1:应用仅面向儿童 | + +### 请求说明 + +本接口请使用API客户端认证方式,请参见API客户端方式获取服务端授权获取客户端ID和access_token。 + +feedback获取方式 + +该问卷为独立页面,需要开发者通过window.open()方法打开,并监听message事件获取问卷填写内容。 + +调用window.open()方法打开页面,代码如下: window.open("https://developer.huawei.com/consumer/cn/service/josp/agc/amp/ageRatingQuestionnaire.html#/?appType={appType}&lang={lang}") 其中,appType和lang为参数变量。 appType可选值为app/game,app为应用年龄分级问卷,game为游戏年龄分级问卷。 lang可选值为cn/en/ru,cn为中文问卷,en为英文问卷,ru为俄文问卷。 说明 如果无法打开问卷,请先退出AppGallery Connect登录,然后重新访问该页面。 + +window.open("https://developer.huawei.com/consumer/cn/service/josp/agc/amp/ageRatingQuestionnaire.html#/?appType={appType}&lang={lang}") + +其中,appType和lang为参数变量。 + +appType可选值为app/game,app为应用年龄分级问卷,game为游戏年龄分级问卷。 + +lang可选值为cn/en/ru,cn为中文问卷,en为英文问卷,ru为俄文问卷。 + +如果无法打开问卷,请先退出AppGallery Connect登录,然后重新访问该页面。 + +填写完问卷后点击提交,问卷页面会发起postMessage请求,调用方通过监听message事件获取问卷内容feedback,代码如下: window.addEventListener("message", (event) => { console.log(event.data); //问卷内容feedback }) + +window.addEventListener("message", (event) => { + +console.log(event.data); //问卷内容feedback + +}) + +### 完整模型及示例 + +```sh +agc publishing app-age-rating --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 提交发布 + +命令:`agc publishing app-submit-v3`。请求:`POST /api/publish/v3/app-submit`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:57:47.737Z。 + +此接口用于提交HarmonyOS应用/元服务审核,调用本接口前必须保证应用信息已补充完整,应用软件包已经上传。 + +接口调用者的角色:账号持有者、管理员、APP管理员。 + +软件包采用异步解析方式,请您在传包后等候2分钟再调用提交发布接口。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section292816392364) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String(32) | 应用ID。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| releaseTime | O | String(64) | 指定发布时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 可以不用填写,则表示立刻发布。 说明 如果在首次提交发布时已设置过releaseTime参数,撤销审核后再次提交发布时,需要将releaseTime参数重新设置为过去的时间,才能实现立即发布。 | +| remark | O | String(300) | 提审发布备注。 可以为空,如果填写则长度范围为10-300。 | +| releaseType | O | Integer(32) | 应用发布方式。 取值范围: 1:全网 默认值:1 | +| releasePhase | O | Integer(32) | 分阶段发布标识。 取值范围: 0:全网发布 3:分阶段发布(7天内自动更新) 默认值:0 | +| phasedReleaseDescription | O | String(500) | 分阶段发布说明。 说明 releasePhase取值为3(分阶段发布)时,此参数必填。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +Body中使用JSON格式携带发布信息,参数如下表所示。 + +### 完整模型及示例 + +```sh +agc publishing app-submit-v3 --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 撤销审核 + +命令:`agc publishing on-shelf-cancel`。请求:`PUT /api/publish/v3/version/on-shelf/cancel`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637);官网更新:2026-06-25 19:52;浏览器读取:2026-10-07T04:58:00.948Z。 + +此接口用于HarmonyOS应用/元服务的撤销审核,当应用发布方式为“全网”时,只有处于“审核中”、“预审中”、“升级审核中”、“待上架/预约上架”、“申请下架”状态的应用可以撤销审核;当应用发布方式为“HarmonyOS测试发布方式(API>=10)”时,只有处于“正在审核”状态的应用可以撤销审核。 + +可通过查询应用信息接口的appInfo参数获取应用状态,具体请参见releaseState应用状态说明。 + +接口调用者的角色:账号持有者、管理员、APP管理员。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | +| appId | M | String(32) | 应用ID,获取方法参考查看应用信息。 | + +### body + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section13576204051611) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| versionId | M | String | 版本ID。 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +请求Body中使用JSON格式携带撤销审核信息,参数如下表所示。 + +### 完整模型及示例 + +```sh +agc publishing on-shelf-cancel --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 + +## 下架应用 + +命令:`agc publishing app-shelf-off`。请求:`POST /api/publish/v2/app-shelf-off`。 + +[官方正文](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450);官网更新:2026-07-31 09:08;浏览器读取:2026-10-07T04:58:02.750Z。 + +此接口用于对已经上架的应用进行下架处理。 + +接口调用者的角色:账号持有者、管理员、APP管理员。 + +本接口仅对允许清单内用户开放,普通Publishing API开发者请勿调用本接口。 + +### header(Service Account方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。 | + +### header(API客户端方式:) + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| client_id | M | String | 客户端ID,获取方法参考创建API客户端。 | +| Authorization | M | String | 认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。 | + +### query + +[参数来源](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section198511327144414) + +| 参数名称 | 必选(M)/可选(O) | 类型 | 参数说明 | +| --- | --- | --- | --- | +| appId | M | String(32) | 需要下架的应用ID。 | +| reason | M | String(1024) | 下架的原因描述。 说明 中文字符需要进行URL编码后再传入。 | +| releaseType | O | Integer | 下架的方式。 取值范围: 1:全网下架。 默认值:1 | + +### 请求说明 + +本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。 + +### 完整模型及示例 + +```sh +agc publishing app-shelf-off --docs --pretty +``` + +该命令返回官方请求/响应示例及已捕获的关联模型。业务响应中的 `ret.code` 应与 HTTP 状态分别检查;修改后使用相应查询接口确认目标状态。 diff --git a/docs/PUBLISHING_WORKFLOWS.md b/docs/PUBLISHING_WORKFLOWS.md new file mode 100644 index 0000000..83bf2cf --- /dev/null +++ b/docs/PUBLISHING_WORKFLOWS.md @@ -0,0 +1,239 @@ +# Publishing API 使用与核验 + +Publishing 命令用于管理 HarmonyOS 应用和元服务的上架资料、软件包、资质、协议、年龄分级及发布状态。资料更新成功、软件包上传成功、审核通过和用户可下载是不同结果,必须分别查询确认。 + +官方入口:[Publishing API参考](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565)。本次浏览器确认入口更新时间为 2026-09-04 16:04,包含 31 项操作,以及数据模型和错误码入口。命令清单见 [CLI_USAGE.md](CLI_USAGE.md#现行-publishing-api-命令)。 + +每项用途、角色、参数表及前置条件见 [逐项 CLI 参考](PUBLISHING_API_REFERENCE.md)。 + +## 发现命令和参数 + +```sh +agc publishing endpoints --pretty +agc publishing user-agreement-create --docs --pretty +agc publishing privacy-agreement-update --docs --pretty +``` + +`--docs` 返回仓库保存的官方正文,包括参数表、说明、请求/响应示例和来源 URL。`relatedDocuments` 附带已捕获的关联模型,并沿模型链接继续展开。只附带已读过的文档;没有捕获的链接不代表已验证。`checkedAt` 是捕获日期,`updatedAt` 是官网更新日期。 + +请求参数按位置传入:`--query key=value` 对应 URL 查询参数,`--header key=value` 对应请求头,`--field key=value` 对应 JSON 字段。复杂对象数组使用 `--body request.json`。同名字段在不同操作中可能位于不同位置;例如基本信息查询使用 `appId` 查询参数,协议操作使用 `appId` 请求头。 + +实际调用要明确选择 `--profile PROFILE`。下文 `APP_ID`、`PROFILE`、协议 ID 和 URL 都是占位符,需要替换成目标资源的真实值。不要把鉴权令牌写入示例文件。认证方式依官方页面选择一个分支,不需要同时提供所有认证方式的请求头。 + +不带 `--invoke` 时,命令只展示接口定义,即使提供请求参数也不会执行请求。`--invoke --dry-run` 在本地构建并校验请求;实际发送必须使用 `--invoke --dry-run=false`。下文流程命令使用实际发送的写法;预检查时将 `--dry-run=false` 改成 `--dry-run`。预检查不创建资源,也不证明远端资源状态或权限。 + +## 用户协议:创建、查询、更新 + +用户协议描述用户使用应用的约定。它与隐私政策协议使用不同的数据模型。创建接口的 `type` 为 2;`agreementInfos` 是对象数组,而不是名为 AgreementInfo 的 JSON 包装对象。 + +创建请求 `user-agreement.json`: + +```json +{ + "type": 2, + "defaultLang": "zh", + "agreementInfos": [ + { + "lang": "zh", + "baseInfo": { + "name": "示例应用用户协议", + "agreementTitle": "用户协议", + "userAgreementUrl": "https://example.com/terms" + } + } + ] +} +``` + +```sh +agc publishing user-agreement-create --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --body user-agreement.json --pretty +agc publishing user-agreement-list --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --field name=示例应用用户协议 --field type=2 --pretty +``` + +创建后,从响应及列表查询确认协议 ID。更新时在请求体中加入 `id`,使用 `user-agreement-update`;更新后再查询该 ID 的内容,确认目标语言和网址。不要仅以 HTTP 200 判断成功,还应检查华为业务码。 + +每个 `agreementInfos` 条目必须有 `lang`,支持 `zh`、`en`、`ug`、`bo`、`zh-Hant-HK`、`zh-Hant-TW`。这里的简体中文是 `zh`,不要套用应用语言资料的 `zh-CN`。最多 100 个条目。`baseInfo` 可省略,但提供时 `name` 必填且最多 100 字符;标题最多 100 字符,网址最多 512 字符。 + +规则来源:[AgreementInfo(用户协议)](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482)、[AgreementBaseInfo(用户协议)](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290)。 + +## 隐私政策协议:查询、更新、提交 + +隐私政策说明应用怎样处理个人信息。该目录提供列表查询、更新和提交接口;不能把“新建用户协议”当成“新建隐私政策协议”。先查询现有隐私协议,确认 ID、状态和模板信息,再决定更新方式。 + +```sh +agc publishing privacy-agreement-list --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --field name= --field type=1 --pretty +``` + +隐私政策的 `baseInfo` 使用 `name`、`appName`、`companyName`、`briefDesc`、`effectiveTime`。这些字段与用户协议的标题和网址字段不同。`effectiveTime` 是整数毫秒时间戳,不能用字符串日期替代。 + +更新请求 `privacy-update.json` 的基础信息示例: + +```json +{ + "id": "EXISTING_PRIVACY_AGREEMENT_ID", + "defaultLang": "zh", + "agreementInfos": [ + { + "lang": "zh", + "baseInfo": { + "name": "示例应用隐私政策", + "appName": "示例应用", + "companyName": "实际运营主体名称" + } + } + ] +} +``` + +这个示例只展示基础信息结构,不能作为完整隐私政策提交材料。`personalInfo`、设备权限、第三方 SDK、共享信息和扩展信息应依据应用实际行为及官方模型填写。部分更新是否保留未传入内容,需要在专用资源中读回验证,不能假定属于 JSON Merge Patch。 + +```sh +agc publishing privacy-agreement-update --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --body privacy-update.json --pretty +agc publishing privacy-agreement-submit --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --field id=EXISTING_PRIVACY_AGREEMENT_ID \ + --field requireConfirm=0 --pretty +``` + +每个语言条目的 `lang` 必填;提供 `baseInfo` 时 `name` 必填。名称最多 100 字符,应用名称 255 字符,公司名称 1024 字符,简介 500 字符。这里的协议更新不等于已经完成后台的“隐私标签信息录入”。 + +若隐私协议被在架版本关联,修改内容需要提交运营审核,审核通过后才能生效。审核中的协议,或被审核中应用关联的协议,不支持编辑。查询响应中的子协议信息和审核结果有助于判断当前状态。[SubAgreement](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-subagreement-0000002328805241) + +### 填写 SDK、共享、权限和存储信息 + +这些字段直接放在 `agreementInfos` 的语言条目中,不增加 `PersonalInfo` 或 `SdkInfo` 等类型名称的包装层。当前 CLI 校验以下 28 个关联模型的字段类型、明确的字符/数组限制,以及敏感数据枚举: + +| 语言条目字段 | 用途和结构 | 主要限制 | +| --- | --- | --- | +| `personalInfo` | 通过 `requiredInfo`、`recommendInfo`、`adsInfo` 或相应服务模式描述收集数据的场景 | `sceneItems` 和场景内 `dataItems` 各最多 200 项;`sensitiveData` 为整数 0 或 1 | +| `devicePermissions` | 权限组、用途和组内 `permissions` | 权限组最多 200 项;提供组内权限数组时须为 1–200 项 | +| `thirdSdkInfo.sdkInfos` | SDK 名称、提供方、声明及 `privacyLabels` 收集场景 | SDK 最多 50 项;每个 SDK 的场景最多 200 项 | +| `thirdSharedInfos` | 接收方、共享目的、官网/隐私链接及数据种类 | 最多 200 项;链接最多 1024 字符 | +| `extInfo` | 联系方式、存储、用户权利入口、自定义章节、儿童隐私和版本说明 | 联系邮箱/电话各最多 10 项;电话每项最多 31 字符;额外自定义章节最多 5 项 | + +以下片段展示 SDK 和存储字段的类型与嵌套。将它放到前述更新请求的语言条目中,并依据应用真实行为填写;数据项和场景 ID 应使用该协议模板/后台中的真实值。 + +```json +{ + "lang": "zh", + "thirdSdkInfo": { + "sdkInfos": [ + { + "name": "实际 SDK 名称", + "providerName": "实际提供方", + "privacyDeclare": "https://example.com/sdk/privacy", + "privacyLabels": [ + { + "sceneReason": "实际使用目的", + "dataItems": [ + {"itemId": "REAL_DATA_ITEM_ID", "itemDesc": "实际数据种类", "sensitiveData": 0} + ] + } + ] + } + ] + }, + "extInfo": { + "storageInfo": {"country": "中国境内", "isCrossBorder": false}, + "contactInfo": {"phoneNum": ["0086-13700000000"]} + } +} +``` + +`isCrossBorder` 必须是 JSON 布尔值,不能写成字符串 `"false"`。模型表标为可选的对象可以省略;提供对象时才检查其字段,提供有下限的数组时才检查下限。CLI 不会因为存在这些字段而默认要求所有隐私章节都填写,也不根据 `Integer(32)` 编造数值范围。 + +完整官方请求结构对应两份离线示例:[HarmonyOS 应用](../pkg/agcapi/testdata/privacy-harmonyos-request.json)、[元服务](../pkg/agcapi/testdata/privacy-atomic-request.json)。示例的协议 ID 和联系信息已替换为测试值,不能直接用于真实应用。两份结构均由独立回归测试验证,官网未在参数表定义的示例扩展字段仍保持兼容。 + +字段错误会返回完整路径,例如 `body.agreementInfos[0].thirdSdkInfo.sdkInfos[0].privacyLabels[0].dataItems[0].sensitiveData`,同时提供 `sourceUrl`、修正建议和 `documentationCommand`。这些检查在鉴权与 HTTP 请求之前执行。 + +规则来源:[AgreementInfo(隐私政策协议)](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630)、[AgreementBaseInfo(隐私政策协议)](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929)。 + +## 元服务资质审核:查询要求、上传材料、创建与修改 + +先查询标签依赖的资质,不猜测标签或资质编码: + +```sh +agc publishing tag-qual-dependent --invoke --dry-run=false --profile PROFILE --pretty +``` + +随后按上传流程取得真实 `objectId`,并保留本地文件名称、字节数和 SHA256。`qualificationFileInfos` 是文件描述对象数组;这个接口不接收本地文件二进制,也不会因一个 objectId 就确认文件内容正确。 + +创建请求 `qualification.json` 的结构: + +```json +{ + "tagQualInfos": [ + { + "tagId": "REAL_TAG_ID", + "qualificationInfos": [ + { + "qualificationCode": "REAL_QUALIFICATION_CODE", + "qualificationFileInfos": [ + { + "objectId": "REAL_UPLOADED_OBJECT_ID", + "fileName": "实际资质文件.pdf", + "fileSize": 12345, + "sha256": "REAL_FILE_SHA256" + } + ], + "validityType": 0, + "startTime": "2030-01-01", + "expireTime": "2031-01-01" + } + ] + } + ] +} +``` + +日期、文件大小和 SHA256 均为格式示意,实际调用必须填写资质文件上的真实日期及真实文件数据。`validityType=0` 表示自定义有效期,日期使用 `yyyy-MM-dd`,提供截止日期时剩余有效期须大于 30 天;永久有效使用 `validityType=1`。日期在模型表中可选,CLI 不会将永久有效分支改成强制提供日期。 + +```sh +agc publishing qualification-review-create --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --body qualification.json --pretty +agc publishing qualification-review-query --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --query tagIds=REAL_TAG_ID --pretty +``` + +修改现有任务时,在对应的 `tagQualInfos` 条目中加入真实 `taskId`,使用 `qualification-review-update`,再查询确认结果。创建时 `taskId` 可选,修改时必填。每次最多 5 个标签,每个标签最多 10 项资质,每项资质最多 10 个文件。文件描述中 `objectId`、`fileName`、`fileSize`、`sha256` 都必填。 + +`qualification-review-cancel` 使用请求体 `taskId` 撤销任务;`qualification-review-delete` 使用请求体 `tagIds` 字符串数组移除旧资质任务。两者用途和输入不同。官方说明:资质已通过但上架因资质被驳回时,需要先移除旧材料再重新提交;不应把这一步用于无关的业务资源。 + +规则来源:[TagQualInfo](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478)、[QualificationInfo](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286)、[QualificationFileInfo](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609)。 + +## 提交版本已解决的问题工单 + +先用 `app-version-voc` 查询未处理工单;官方要求应用软件包已上传。将已解决的问题作为 `app-info-update-v3` 请求中的 `versionVocs` 数组提交,每个条目都需要 `versionId`、`packageId`、`vocId`,每个 ID 最多 32 字符。上报已解决不代表工单立即关闭,工单平台验证通过后才会关闭。 + +```sh +agc publishing app-version-voc --invoke --dry-run=false --profile PROFILE \ + --header appId=APP_ID --field pageNo=1 --field pageSize=20 --pretty +``` + +调用基本资料更新时,还需按该接口的要求提供 `publishCountry` 和 `encrypted`。不要根据工单 ID 猜测对应的版本或软件包 ID。[VersionVoc 模型](https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924) + +## 核验边界与复跑 + +年龄分级页面明确要求使用 API 客户端认证,并先设置应用分类、完成官方问卷取得 `feedback`。`expectedRating` 是评级枚举,不能直接填写年龄。提交发布要求资料完整、软件包上传完成;官方说明软件包异步解析,上传后等待 2 分钟再提交。成功提交仍需查询审核和上架状态。 + +资质审核系列用于元服务。仅选择智能手表或运动手表的应用不支持提交资质审核任务。下架接口仅向允许清单内用户开放,普通 Publishing API 开发者不能仅凭命令已登记就认为具备调用权限。上述说明的来源与完整参数见逐项参考。 + +隐私模型 `SdkInfo.privacyLabels` 描述 SDK 收集的信息;这证实隐私政策接口包含相关数据结构,但仍不能证明更新这些字段会完成后台独立的“隐私标签信息录入”步骤。需要以专用应用的实际后台读回结果确认这种关联。 + +顶层对照、模型捕获、规则实现、离线测试和真实业务验证分别记录。31 项方法/路径及顶层参数对照通过,不意味着所有模型和业务状态均已验证。当前仍在逐页复核模型、错误码和附录;不得将本文件作为全部接口验收完成的证明。 + +```sh +python3 scripts/audit-publishing-contracts.py +go test ./pkg/domain ./pkg/agcapi -run 'TestPublishingAgreement|TestFileEndpointIncludes' -count=1 +go test ./pkg/domain ./pkg/agcapi ./cmd/agc/command ./pkg/server -run 'TestPrivacy|TestPublishingPrivacy' -count=1 +python3 scripts/audit-publishing-models.py +go test ./pkg/domain ./pkg/agcapi ./cmd/agc/command -run 'TestPublishingQualification|TestQualificationOpenAPI|TestCurrentPublishingRequestsMatchOfficialReference' -count=1 +node --test scripts/test_browser_capture.mjs +make ci +go test -race ./... +``` + +嵌套错误应提供数组索引、具体子字段、官方来源与修正建议。协议校验独立于 HTTP 和用户凭据;离线回归测试不调用华为。线上写操作需要专用测试应用,执行后查询确认结果;发布、下架和既有业务资源变更不能用作普通冒烟测试。 diff --git a/docs/SERVERLESS.md b/docs/SERVERLESS.md new file mode 100644 index 0000000..84f24a7 --- /dev/null +++ b/docs/SERVERLESS.md @@ -0,0 +1,93 @@ +# 云开发(Serverless) + +本工作区接入八类服务的 102 项操作:49 个官方文档明确的 HTTP/开发者回调入口、42 个依据华为 AGCLI 1.12.0 源码实现的管理传输、10 个原生工作流,以及 1 个设备调试入口。SDK 方法、控制台功能和未公开的资源管理接口不自动算作已支持的 HTTP API。新增管理、SAM 部署及预加载的用法与边界见[管理扩展](SERVERLESS_MANAGEMENT.md)。 + +所有操作默认 dry-run;增加 `--invoke --dry-run=false` 才会发送。`--docs --pretty` 显示本地保存的完整官方参数表、例子、段落链接、错误码、前提文档及已记录冲突。命令、REST 和 OpenAPI 使用同一领域契约。 + +| 命令族 | 操作数 | 范围 | +| --- | ---: | --- | +| `agc cloud-auth` | 17 | 客户端令牌、验证码、注册、密码/验证码登录、更新身份/密码、关联/取消关联、登出、注销、重认证;服务端导入/导出、验证/撤销用户凭据 | +| `agc clouddb` | 16 | 客户端数据操作,以及 schema、存储区与异步进度管理;两者鉴权不同 | +| `agc storage` | 6 | 原始文件上传下载、删除、元数据读写、分页列表 | +| `agc hosting` | 16 | 站点四项、环境三项、版本九项(含签名上传) | +| `agc functions` | 29 | 原有 9 个工作流,以及别名、HTTP/定时触发器、调用策略和层管理传输 | +| `agc templates` | 8 | 2 个认证回调、5 个 SAM 应用/计划管理传输、1 个本地 ZIP 到新应用的部署工作流;不等同于控制台模板库 | +| `agc cache` | 6 | 命令执行、连接信息、三天内用量、开通、初设密码与重置密码 | +| `agc prefetch` | 4 | 安装/周期性/跳链安装的开发者服务器 GET 模拟,以及显式设备的 `cf_prefetch getcache` 调试 | + +## 发现、文档和请求 + +```sh +./bin/agc capabilities +./bin/agc storage endpoints --pretty +./bin/agc storage upload-file --docs --pretty +./bin/agc clouddb query-data --docs --pretty +./bin/agc functions create-function --docs --pretty +./bin/agc openapi > /tmp/agc-openapi.json +``` + +公开 REST 使用 `--param`(路径)、`--query`、`--header`、`--body` 或 `--field`。文件传输使用 `--file`;下载用 `--out` 保存原始字节。REST 的二进制下载响应用 `bodyBase64` 无损承载。 + +```sh +# 预演文件上传,确认后才增加 --dry-run=false。 +./bin/agc --profile dedicated-test storage upload-file --invoke \ + --param bucket_name=TEST_BUCKET --param object_name=checks/hello.txt \ + --header productId=TEST_PROJECT --file ./hello.txt + +# 预演站点查询。requestid 必须唯一,service 固定为 hosting。 +./bin/agc --profile dedicated-test hosting list-sites --invoke \ + --header productId=TEST_PROJECT --header requestid=UNIQUE_REQUEST_ID \ + --header service=hosting --field 'site={}' + +# 数据库查询:queryCond 是 JSON 字符串,opStore 按官方例子是对象。 +./bin/agc --profile dedicated-test clouddb query-data --invoke \ + --header productId=TEST_PROJECT --query _v=4 --body ./query.json +``` + +## 鉴权边界 + +- 认证服务端的四项操作支持 Service Account 或 API 客户端;API 客户端分支需要 `client_id`,不得同时强制两种分支。 +- 客户端认证和 CloudDB 的客户端网关令牌与发布接口令牌分开获取;自动令牌获取使用官方记录的中国站点。其他未核实的客户端区域应显式提供令牌和对应地址。 +- 云存储和云托管使用 API 客户端;存储实例域名对应的 Token 区域必须一致。CLI 拒绝把 Service Account 自动用于这些客户端专用服务。 +- 云托管上传使用返回的 `uploadInfo.url` 和整组签名头,`--param uploadUrl=... --file ...`;不能加入 AGC Bearer。上传前生成签名和归档/发布状态均需分别读回。 +- 模板认证接口是华为向开发者服务器发送的 JSON 回调。`templates` 的调用仅用于模拟,不读取凭据、不转发 AGC Bearer,不证明华为已实际调用或模板已部署。 + +## 原生云函数 + +源码依据为 `@hw-agconnect/agc-cli@1.12.0`,不是公开 REST 规范。源码路径和 SHA256 保存在 `--docs` 中。运行不依赖 Node 子进程,不读取官方 CLI 的加密 scratch,不复用发布凭据,也不复现官方包关闭 TLS 验证的行为。 + +显式 OAuth 会话 JSON 存在 Git 仓库外,权限建议 `0600`。字段为 `uid`、`teamId`、`productId`、`accessToken`、RFC3339 格式的 `expiresAt` 和项目的 `projectBaseUrl`。这些值需来自开发者自己授权的有效会话,不要将真实值写入文档或报告。CLI 会拒绝过期会话和项目不一致;dry-run 不读取会话。 + +```sh +./bin/agc functions create-function --invoke --name test-function \ + --session-file /PRIVATE_PATH/session.json --project-id TEST_PROJECT \ + --runtime nodejs14.x --code-path ./function.zip +./bin/agc functions update-function-code --invoke --name test-function \ + --session-file /PRIVATE_PATH/session.json --code-path ./function.zip +./bin/agc functions update-function-config --invoke --name test-function \ + --session-file /PRIVATE_PATH/session.json --memory 1000 +./bin/agc functions publish-function --invoke --name test-function \ + --session-file /PRIVATE_PATH/session.json --version-description 'test release' +./bin/agc functions invoke --invoke --name test-function \ + --session-file /PRIVATE_PATH/session.json --payload '{"request":"test"}' +``` + +创建时内存、超时、并发默认值分别为 500、55、100;运行时默认值来自所审阅官方 CLI(nodejs14.x),不代表华为当前仍允许创建这个运行时。其他运行时及上下限见 `--docs` 和 OpenAPI,云端可用性需实测。 + +更新先读取 `$latest` 的 revision,保留未提供的环境变量、层和 handler;冲突停止,不自动重试。发布失败会明确报告更新可能已生效。管理接口返回的环境值和用户会话不进入响应;函数调用的业务结果按原始 JSON 保留,不把业务 code 或 uid 当作管理错误或凭据。HTTP 状态与执行状态独立返回。 + +REST 路径仍为 `/api/v1/functions/endpoints/OP/invoke`,请求根字段对应函数输入(`name`、`sessionFile`、`codePath`、`payload` 等);默认 `dryRun:true`。不能套用通用接口的 `body`、`token` 封装。 + +## 数据与文档冲突 + +已保存官方表格和请求例子。CloudDB 的 `opStore` 文本称 JSON 字符串,实际例子是对象;适配器采用实际例子的对象。`queryCond` 明确保留为字符串,并验证解码后的条件及聚合类型。更新与删除共用 upsert 路径,`naturalbase_deleted` 分别必须为 false/true,列顺序与值数量必须匹配。删除表格对字段个数的描述与例子冲突,没有静默应用会拒绝官方例子的单字段上限。 + +认证导出的 `block` 表格为字符串、例子为整数;响应 `users`/`ret` 也存在字符串与对象/数组描述冲突。适配器保留实际类型,不自行转换。云存储元数据更新的 GET 与 Java 示例一致。 + +## 验证与限制 + +离线验证涵盖每项操作的 CLI HTTP 收发、REST 收发、dry-run、发现/文档和 OpenAPI,另有独立来源断言、嵌套字段、条件规则、文件字节、签名头、区域鉴权、revision 工作流与失败场景测试。模拟服务器通过不代表华为真实业务通过。 + +真实验证必须显式指定 profile、项目和专用资源;未指定时不选择活动业务账号、不发送验证码、不部署业务函数、不发布站点。报告中每项 live 状态为未执行,直至用专用资源执行并完成相应读回。当前未取得可复核管理协议的能力包括控制台模板库部署/升级、预加载云端绑定配置、层删除,以及非 HTTP/定时类型触发器的创建;这些没有被猜测为可调用接口。详见[管理扩展](SERVERLESS_MANAGEMENT.md)。 + +开发验证:`make ci`、`go test -race ./...`、`make build`。本次工作区二进制是 `./bin/agc`;不代表系统安装的 `agc` 已升级,也不代表已发版或 GitHub Actions 已通过。 diff --git a/docs/SERVERLESS_MANAGEMENT.md b/docs/SERVERLESS_MANAGEMENT.md new file mode 100644 index 0000000..bcbbad5 --- /dev/null +++ b/docs/SERVERLESS_MANAGEMENT.md @@ -0,0 +1,107 @@ +# 云开发管理扩展 + +本轮新增 47 项操作,并保留了 23 页通过 Computer Use 阅读的官方页面、嵌套规则、段落链接及审查日期。管理传输来自公开的 `@hw-agconnect/agc-cli@1.12.0`,每份 `--docs` 都包含对应源码、SHA256 和相关指南。这是源码适配,不是华为承诺稳定的公开 REST 规范。 + +## 命令与鉴权 + +```sh +./bin/agc cache endpoints --pretty +./bin/agc functions create-alias --docs --pretty +./bin/agc clouddb create-object-type --docs --pretty +./bin/agc templates deploy --docs --pretty +./bin/agc prefetch fetch-periodic --docs --pretty +``` + +管理入口使用 `--session-file /PRIVATE_PATH/session.json`,REST 请求根字段为 `sessionFile`,可选 `projectId` 必须匹配会话。`--profile` 的发布凭据不会替代用户会话。默认 dry-run 不读取会话、不访问华为,也不执行设备命令。实际执行需要 `--invoke --dry-run=false`。 + +会话文件保存在仓库外,建议权限 `0600`。通用字段为 `uid`、`teamId`、`productId`、`accessToken`、RFC3339 `expiresAt`。额外字段取决于入口: + +| 入口 | 会话字段及传输 | +| --- | --- | +| 云函数管理 | `projectBaseUrl`;用户 OAuth 头 | +| schema、存储区、云缓存 | `projectEdgeBaseUrl`、`authInfo`、`csrfToken`;同时保留 OAuth、Cookie 和 CSRF 头,与官方源码一致 | +| SAM 应用与计划 | `teamBaseUrl`;用户 OAuth 头 | +| SAM 部署代码上传 | `projectStorageBaseUrl`;用户 OAuth 头,原始 ZIP 文件流 | + +不读取官方 CLI 的加密 scratch,不从浏览器提取凭据,不推测 Cookie 与 OAuth 的对应关系。TLS 验证始终保留,认证重定向不能跨源。响应中的凭据与管理环境变量会脱敏。 + +## 云缓存 + +六项操作:`execute-command`、`connection-info`、`usage`、`enable-service`、`set-password`、`reset-password`。 + +```sh +./bin/agc cache execute-command --invoke \ + --session-file /PRIVATE_PATH/session.json --field 'command=GET dedicated:key' +./bin/agc cache usage --invoke --session-file /PRIVATE_PATH/session.json \ + --query views=query_cache_metric_trend \ + --query startTime=1792962000000 --query endTime=1792965600000 +``` + +Web CLI 支持的命令名单、ASCII/空格与 4096 字符限制来自官方页面。Redis 命令参数的完整语法仍由服务端判断。时间戳为毫秒,区间不超过三天。密码须以字母开头、8–32 位,包含大小写字母、数字和文档列出的特殊字符。开通与设置密码是两个请求;密码重置可能影响已有连接,测试不能选用业务缓存。 + +## 数据库 schema 与存储区 + +十一项操作:`schema-versions`、`get-object-type`、`create-object-type`、`update-object-type`、`delete-object-type`、`import-object-types`、`export-object-types`、`list-zones`、`create-zone`、`delete-zone`、`process-status`。 + +```sh +./bin/agc clouddb schema-versions --invoke --session-file /PRIVATE_PATH/session.json +./bin/agc clouddb get-object-type --invoke --session-file /PRIVATE_PATH/session.json \ + --query schemaVersion=1 --query objectTypeName=Book +./bin/agc clouddb create-object-type --invoke --session-file /PRIVATE_PATH/session.json \ + --body ./object.json +``` + +创建使用 `{"objectType":{...}}`。更新同时需要完整 `objectType` 和查询得到的 `originObjectType`;不能通过改名实现迁移。导入使用包含 `schemaVersion`、`objectTypes`、可选 `permissions` 的原始 JSON 文档,不增加包装字段。官方 CLI 将该 JSON 字符串原样交给 Axios,最终 Content-Type 为 `application/x-www-form-urlencoded`,但字节不是表单编码;适配器保留此行为,并有独立传输断言。 + +嵌套检查包括名称/保留字、字段类型、1–5 个主键、自增字段、加密/敏感字段总数与互斥关系、默认值、索引字段及 16 个索引/5 个组合字段限制。上线后能否修改已有结构和权限依赖真实应用状态;CLI 不能仅从本地 JSON 证明迁移可行。返回 `processId` 仅表示开始处理,必须用 `process-status` 并重新导出/查询 schema 确认完成。 + +## 云函数管理 + +新增二十项传输:别名创建/查询/列表/更新/删除;HTTP 与其他触发器查询/列表/删除;HTTP/定时触发器创建、定时触发器更新;调用策略查询/创建;层列表、版本列表、版本查询和层版本创建。 + +```sh +./bin/agc functions get-alias --invoke --session-file /PRIVATE_PATH/session.json \ + --param functionName=dedicated-func --param aliasName=dedicated-alias +./bin/agc functions create-alias --invoke --session-file /PRIVATE_PATH/session.json \ + --param functionName=dedicated-func --body ./alias.json +``` + +别名路由为动态版本键到整数权重的对象,最多两个版本,总权重 100。CLI 要求明确提供完整权重,不自动选择“最新”版本。更新需先读别名并提供 `revisionId`。触发器的 `funcId` 必须来自函数查询并带正确限定符;创建触发器与创建调用策略是独立步骤,不会自动授予调用权限。 + +层上传的 `body.zipFile` 为 Base64 ZIP。当前指南上限为压缩 150MiB、解压 300MiB、30000 文件;旧 CLI 本地检查仅允许小于 50MiB。此直接 API 适配选择当前指南限制,并保留这一差异。旧 CLI 运行时枚举与当前指南仅允许新建 Node.js 20.x/latest 的说明也有差异,现代运行时的精确 wire 值及云端可用性不能由旧包源码证明。定时触发器开关同样存在“当前指南称创建后不可更改、旧 CLI 提供更新请求”的冲突,不能把离线更新请求通过当作云端支持证明。 + +## SAM 模板部署 + +`search-applications`、`create-application`、`create-plan`、`get-plan`、`apply-plan` 暴露官方 SAM 的应用与变更计划传输。`deploy` 提供新应用完整流程:先校验全部本地 ZIP,按应用名前缀转换组件名,查询同名应用,上传 ZIP,创建应用,再独立查询同一应用 ID 的 readiness。 + +```sh +./bin/agc templates deploy --invoke --session-file /PRIVATE_PATH/session.json \ + --body ./sam-deploy.json +``` + +部署文件为 SAM JSON 根对象,包含 `name`、`components` 以及本地选项 `storageInstance`、可选 `waitForReady`。组件使用 `Huawei::AGC::CloudFunctions`,`properties.codeUri` 在此工作流中是本地 ZIP;底层 `create-application`/`create-plan` 的 `codeUri` 则是已上传的 `bucket/object.zip`。代码存储实例必须事先存在,不自动开通云存储。 + +默认创建模式拒绝覆盖同名应用。更新需显式创建并阅读计划后再应用。默认 `waitForReady:false`;实际执行仍进行一次独立读回。`true` 最多查询 15 次,间隔 2.4 秒。结果分开返回 `applicationAccepted` 与 `ready`;上传/创建/读回失败不自动重试,已上传对象可能保留,不自动删除。 + +这些是 SAM CloudFunctions 应用部署,不是控制台“抽奖活动、排行榜”等模板库的一键部署/升级。浏览器审查到的模板库页面描述控制台流程,尚未提供其管理接口契约。 + +## 预加载 + +`fetch-install`、`fetch-periodic`、`fetch-deferred` 模拟华为对开发者服务器的 GET 请求,不加载/转发 AGC 凭据;安装响应最多 2MiB,另外两种最多 3MiB。周期请求的用户 `token` 最多 2048 字符、`params` 最多 1024 字符;响应中任何 `code` 都是应用数据,不能当成管理接口错误。 + +```sh +./bin/agc prefetch fetch-periodic --invoke --param callbackUrl=https://www.example.com/prefetchData \ + --query appId=DEDICATED_APP --query 'params={"theme":"holiday"}' +./bin/agc prefetch device-getcache --invoke \ + --field bundleName=com.example.dedicated --field deviceId=EXPLICIT_DEVICE +``` + +`device-getcache` 通过独立 argv 执行 `hdc -t DEVICE shell cf_prefetch getcache -m BUNDLE`,可用 `body.hdcPath` 指定已安装的 hdc。设备须满足官方 ROM、debug HAP 与调试证书条件。进程成功仅表示命令完成,`dataFreshnessVerified:false` 提醒调用方检查 `fetch data timestamp`;旧时间戳表示本次拉取失败。已保留官方错误码与修正指引。云端绑定云函数/下载地址仍只有控制台文档,未猜测管理接口。 + +## 验证边界 + +逐项 CLI/REST 本地 HTTP 测试使用独立源码夹具,同时覆盖 dry-run、业务错误、HTTP 错误、会话过期与项目隔离、嵌套输入、原始文件、回调数据和部署阶段。设备入口使用测试可执行文件确认 argv,不会接触用户手机。 + +真实云端写验证仍需专用项目、显式 profile/用户会话和可清理资源。未执行的项目不会标为云端通过。当前没有取得可复核 wire 契约的控制台模板库部署/升级、预加载绑定配置、层删除和其他服务类型触发器创建保留为未支持,不用猜测 URL 填补。 + +本次工作区二进制为 `./bin/agc`;系统安装版升级、稳定版发布和 GitHub Actions 验证是独立步骤。 diff --git a/docs/SPONSORSHIP.md b/docs/SPONSORSHIP.md new file mode 100644 index 0000000..260ab41 --- /dev/null +++ b/docs/SPONSORSHIP.md @@ -0,0 +1,35 @@ +# 支持 agc-cli / Support agc-cli + +agc-cli 由[林逍遥(Createitv)](https://github.com/Createitv)维护。[GitHub Sponsors](https://github.com/sponsors/Createitv)属于维护者个人账号,用于支持他在应用开发工具、自动化与 AI Agent 工作流方面的开源工作;agc-cli 是其中的一个项目。 + +## 中文 + +agc-cli 将 AppGallery Connect 的接口发现、请求预览和调用带到终端,为鸿蒙开发者、脚本和 AI Agent 提供一致的工作入口。 + +赞助将用于: + +- 跟进华为 API 变化,改进接口定义与请求处理。 +- 完善 macOS、Windows 和 Linux 的安装与使用体验。 +- 增加有意义的回归验证,处理用户反馈。 +- 维护中英文文档、示例和网站。 + +项目保持 MIT 开源。赞助是自愿支持,不购买华为权限、审核结果、功能交付期限或优先响应承诺。 + +**当前状态:GitHub Sponsors 已提交,等待 GitHub 审核,尚未公开上线或开放收款。** 本文和 README 中的主页链接不代表已经可以付款。审核通过后再启用仓库的 Sponsor 按钮。可公开展示的赞助者信息应先取得本人同意;当前没有赞助者名单。 + +## English + +agc-cli is maintained by [lingxiaoyao (Createitv)](https://github.com/Createitv). [GitHub Sponsors](https://github.com/sponsors/Createitv) supports the maintainer's open-source work on app development tools, automation, and AI-agent workflows. It is a personal account profile; agc-cli is one of the projects it supports. + +agc-cli brings AppGallery Connect endpoint discovery, request previews, and API invocation to the terminal, giving HarmonyOS developers, scripts, and AI agents a consistent interface. + +Sponsorship helps fund: + +- Adapting endpoint contracts and request handling to Huawei API changes. +- Improving installation and usability on macOS, Windows, and Linux. +- Meaningful regression checks and fixes based on user feedback. +- Maintaining bilingual documentation, examples, and the website. + +The project remains MIT licensed. Sponsorship is voluntary support and does not purchase Huawei permissions, review outcomes, delivery deadlines, or priority response guarantees. + +**Current status: GitHub Sponsors has been submitted for review; the profile is not yet live and payments are not available.** The profile links in this document and the README do not indicate that payments are enabled. The repository's Sponsor button will be enabled after approval. Sponsor recognition is opt-in; there are currently no listed sponsors. diff --git a/docs/community/assets/agc-cli-cover-zh-CN-xiaohongshu.png b/docs/community/assets/agc-cli-cover-zh-CN-xiaohongshu.png new file mode 100644 index 0000000..1286349 Binary files /dev/null and b/docs/community/assets/agc-cli-cover-zh-CN-xiaohongshu.png differ diff --git a/docs/features/cloud-auth.md b/docs/features/cloud-auth.md new file mode 100644 index 0000000..ef955d1 --- /dev/null +++ b/docs/features/cloud-auth.md @@ -0,0 +1,3 @@ +# cloud-auth + +See [Serverless documentation](../SERVERLESS.md) for operations, authorization, examples and verification boundaries. diff --git a/docs/features/clouddb.md b/docs/features/clouddb.md new file mode 100644 index 0000000..96274b8 --- /dev/null +++ b/docs/features/clouddb.md @@ -0,0 +1,3 @@ +# clouddb + +See [Serverless documentation](../SERVERLESS.md) for operations, authorization, examples and verification boundaries. diff --git a/docs/features/functions.md b/docs/features/functions.md new file mode 100644 index 0000000..e92242a --- /dev/null +++ b/docs/features/functions.md @@ -0,0 +1,3 @@ +# functions + +See [Serverless documentation](../SERVERLESS.md) for operations, authorization, examples and verification boundaries. diff --git a/docs/features/hosting.md b/docs/features/hosting.md new file mode 100644 index 0000000..911ad63 --- /dev/null +++ b/docs/features/hosting.md @@ -0,0 +1,3 @@ +# hosting + +See [Serverless documentation](../SERVERLESS.md) for operations, authorization, examples and verification boundaries. diff --git a/docs/features/storage.md b/docs/features/storage.md new file mode 100644 index 0000000..da5eb4f --- /dev/null +++ b/docs/features/storage.md @@ -0,0 +1,3 @@ +# storage + +See [Serverless documentation](../SERVERLESS.md) for operations, authorization, examples and verification boundaries. diff --git a/docs/features/templates.md b/docs/features/templates.md new file mode 100644 index 0000000..a5781d9 --- /dev/null +++ b/docs/features/templates.md @@ -0,0 +1,3 @@ +# templates + +See [Serverless documentation](../SERVERLESS.md) for operations, authorization, examples and verification boundaries. diff --git a/docs/sponsors-setup.md b/docs/sponsors-setup.md new file mode 100644 index 0000000..bbff0a6 --- /dev/null +++ b/docs/sponsors-setup.md @@ -0,0 +1,31 @@ +# GitHub Sponsors profile material + +Account: Createitv. This personal profile supports the maintainer's open-source work, with agc-cli as one featured project. The English-only bio and introduction were saved through GitHub on 2026-10-07, and GitHub confirmed the update. The profile is pending approval and is not yet live; payment and payout availability have not been verified. This document contains no bank, identity, or tax details. + +## Short bio + +Independent developer building open-source tools for app development, automation, and AI-agent workflows. + +## Introduction + +## Hi, I'm lingxiaoyao 👋 + +I'm an independent developer building practical tools for app development, automation, and AI-agent workflows. I enjoy turning repetitive work into simple, reusable tools so developers can spend more time building useful products. + +### What I'm working on + +I build and maintain open-source tools, including their installation experience, tests, examples, and Chinese and English documentation. One of my current projects is: + +- [agc-cli](https://github.com/Createitv/agc-cli): an independent, MIT-licensed CLI for Huawei AppGallery Connect, bringing endpoint discovery, request previews, and API calls into terminals, scripts, and AI-agent workflows. [Project website](https://agccli.app/) + +### What your support makes possible + +Your sponsorship helps me spend more time maintaining open-source projects, fixing issues, keeping up with platform and API changes, improving cross-platform validation and documentation, and exploring new tools. + +If my work saves you time or you like what I'm building, please consider supporting my open-source work. Bug reports, shared experiences, and code contributions are also welcome. Thank you! + +[GitHub projects](https://github.com/Createitv?tab=repositories) + +## Repository sponsorship links + +README.md, README.en.md, and docs/SPONSORSHIP.md link to https://github.com/sponsors/Createitv and explain the pending approval status. Enable github: Createitv in .github/FUNDING.yml after approval. Other projects can use the same personal account profile. diff --git a/docs/superpowers/plans/2026-10-26-cloud-functions.md b/docs/superpowers/plans/2026-10-26-cloud-functions.md new file mode 100644 index 0000000..0fe0f00 --- /dev/null +++ b/docs/superpowers/plans/2026-10-26-cloud-functions.md @@ -0,0 +1,28 @@ +# Cloud Functions Implementation Plan + +> **For agentic workers:** Use superpowers:executing-plans inline. User authorized implementation and opted out of routine questions; preserve all pre-existing dirty changes. No commits or deployment of business resources for tests. + +**Goal:** Add native Go cloud-function create/upload, code/config update, publish, list/query/version and invoke commands, with discoverable local REST/OpenAPI. + +**Architecture:** Domain requests and source-derived endpoint metadata live in pkg/domain; HTTP multipart, digest, OAuth headers and revision workflows live in pkg/cloudfunctions; CLI and REST translate shared request types. Source: Huawei-published @hw-agconnect/agc-cli 1.12.0, independently inspected with file hashes. Distinguish vendor package source review from a public REST specification or live verification. + +**Tech Stack:** Go standard library, existing Cobra and JSON envelopes; no dependency on a Node subprocess at runtime. + +## Global Constraints + +Keep native agc dry-run default, JSON stdout, local API authentication and project context. Never automatically forward Service Account credentials to an OAuth-only endpoint. Session file explicitly supplies user OAuth uid/teamId/productId/accessToken, with expiry check and project mismatch rejection. Never print session values or function environment values. Preserve TLS verification and refuse cross-origin redirects for authenticated requests. + +## Review Focus + +- ZIP upload uses actual bytes and correct digest, length and multipart fields. +- Code/config update obtains revision and preserves environment, layers and handler; concurrent modification errors stop without blind retry. +- Failed update must never publish. Publish failure must report that update may already have succeeded. +- Dry-run never reads authorization or contacts Huawei; invalid local input fails before auth/network. +- Invoke payload is arbitrary valid JSON; headers such as function execution status must remain observable independently of HTTP success. + +## Tasks + +1. Source and domain contracts: write failing tests for functions discovery, docs provenance and OpenAPI. Capture reproducible package-source evidence; register 9 operations and shared input types. +2. Transport: write httptest failures for digests, read-before-write, config preservation, OAuth isolation, payload fidelity, conflict/no-publish, failed invocation and dry-run. Implement native client with bounded ZIP streaming/temp files, revision workflows and redacted responses. +3. CLI and REST: failing tests for official-style flags, session-file validation, no automatic credentials, structured errors, arbitrary JSON payload and shared local API behavior. Implement adapters and metadata schemas. +4. Verify and document: source-backed parameter cases, full Go suite/race, make ci; build bin/agc and read back real binary help/discovery/dry-run. Record any existing suite failures separately. No cloud write claims without dedicated-resource live readback. diff --git a/docs/superpowers/plans/2026-10-26-serverless-all.md b/docs/superpowers/plans/2026-10-26-serverless-all.md new file mode 100644 index 0000000..4f9b120 --- /dev/null +++ b/docs/superpowers/plans/2026-10-26-serverless-all.md @@ -0,0 +1,22 @@ +# Serverless full integration and verification + +Scope: all HTTP operations exposed by the six official Serverless navigation groups, plus the nine native function workflows already specified in cloud-functions.md. SDK class methods are not automatically public HTTP management contracts. Template callback operations remain inbound callbacks. No implicit live credentials or business-resource writes. + +1. Capture endpoint bodies, nested models, examples, errors and authorization prerequisites through Computer Use; preserve capture tables and paragraph URLs. +2. Add source-based failing tests for discovery, nested requiredness, auth alternatives, encoded JSON, binary/signed uploads, callbacks and native function revision workflows. +3. Register domain contracts and shared serialization/validation; expose CLI, REST, OpenAPI and --docs. +4. Verify every operation through isolated local HTTP transports and negative input tests; build and inspect workspace binary; make ci and race suite. +5. Live operations require an explicitly selected profile/project and dedicated resources. Record each operation as passed/failed/not-run with reason. Never equate simulation with live verification. + +## Ledger + +- Initial: existing dirty checkout retained; pre-change status in /tmp/agc-serverless-before-status.txt. Existing TestCloudFunctionsDiscoveryAndNativeContract fails because native functions are missing. +- Computer Use: 65 official rendered pages captured, including 46 REST/callback endpoint documents, request/response models and status-code appendices. Full capture saved locally via TextEdit, not by direct HTTP scraping. +- Ruling: implement native Go function transport from Huawei AGCLI 1.12.0 source, preserving provenance distinct from public REST specifications. Do not reproduce its disabled TLS validation. +- Live selection: question pending for explicit profile/project and dedicated test resources; independent offline work continues. +- Implemented: 46 documented HTTP/callback operations and 9 native function workflows, with 71 browser-read endpoint/model/prerequisite pages and hashed vendor source evidence. Scope boundaries are explicit in docs/SERVERLESS.md; private console-only resource lifecycles are not advertised as complete. +- Independent final review: reproduced and fixed JSON-file download handling, arbitrary function results, CPU allocation, description-only updates, signed auth requiredness, native error envelopes, resumable/digest checks and response overflow. Each finding has a regression test. +- CI observation: make ci stops in the untouched scripts/test_goal_progress.py test_domain_precheck_requires_real_code_file_readback_and_cleanup. Continued gates initially found missing Web dependencies; npm ci restored lockfile dependencies. Final checks and operation matrix follow. +- Final evidence supersedes earlier transient failures: make ci passes; full race suite passes with CGO_ENABLED=1 GOARCH=arm64 on this Apple Silicon host. The default installed Intel Go toolchain caused Rosetta startup stalls in earlier runs. All 55 CLI, REST and dry-run operations passed; report generation requires both entire packages to pass and never marks cloud validation from offline events. +- Independent binary readback: native arm64 bin/agc, all 55 endpoint discoveries and --docs parsed, dry-run with nonexistent session succeeded without reading authorization. /usr/local/bin/agc remains the pre-existing v0.1.0 installation; no package publication or system upgrade performed. +- Live remains not-run pending explicit profile/project/resources and function user OAuth session selection. No commits, pushes, cloud writes or business-resource changes. diff --git a/docs/superpowers/plans/2026-10-26-serverless-management.md b/docs/superpowers/plans/2026-10-26-serverless-management.md new file mode 100644 index 0000000..ed22703 --- /dev/null +++ b/docs/superpowers/plans/2026-10-26-serverless-management.md @@ -0,0 +1,30 @@ +# Serverless management continuation + +User scope: continue browser review and implement the missing cache, prefetch, schema, function alias/trigger/layer and template deployment capabilities. Preserve the existing dirty checkout and use no implicit business-resource writes. + +1. Read rendered official guides and recursive prerequisites; preserve 23 pages with merged cells and paragraph links through Computer Use. +2. Review public Huawei AGCLI 1.12.0 management, cookie/CSRF, SAM upload/deployment and schema model source. Preserve exact source text and hashes separately from public HTTP specifications. +3. Add failing independent source-based tests before implementation; register 47 additional operations and expose CLI, REST, OpenAPI and `--docs`. +4. Validate all inputs before authorization, isolate explicit user sessions, preserve binary/JSON/form semantics, and test each operation through local HTTP. Device tests use test-owned executables. +5. Review deployment failure stages and immutable nested schema rules independently; fix and reproduce review findings. Run final CI, race and per-operation matrix, regenerate Web registry and rebuild/read the workspace binary. +6. Live writes require a user-selected dedicated project and session; do not use the existing business project as a smoke test. System package upgrades and publishing remain distinct from workspace build verification. + +## Reviewed boundaries + +- Current browser guides and old CLI disagree on layer ZIP local bounds, runtime support and timer switch mutability; retain both sources and report cloud behavior as unverified. +- SAM applications are distinct from console gallery templates. Do not advertise SAM create/plan/deploy as gallery deployment or upgrades. +- Prefetch developer GET protocols and explicit-device commands are implemented; no cloud binding API is invented from console screenshots. +- Layer deletion and non-HTTP/Cron trigger creation still lack a verified wire contract in the reviewed public sources. + +## Review findings addressed + +- Duplicate SAM component names and corrupt ZIP CRC are rejected before reading sessions or starting uploads. +- Existing schema fields cannot change encryption/sensitivity flags; same-name index definitions cannot change in place. Violations retain full child paths. +- SAM handler, environment, inline HTTP/Cron events and display-width limits are validated recursively. +- Prefetch linked configuration/error pages survive attachment of generic supplemental documents. +- Cross-catalog JSON decoding uses a fresh slice so omitted fields cannot inherit previous endpoints' enums. +- Schema import preserves the vendor's raw JSON string bytes with its Axios form Content-Type; no double/form encoding is introduced. + +## Evidence + +Final results are recorded separately in `docs/verification/serverless-management-2026-10-26.json`. No commits, pushes, service activation, business-resource changes, package publication or system installation changes are part of the offline evidence. diff --git a/internal/managementtest/fixtures.go b/internal/managementtest/fixtures.go new file mode 100644 index 0000000..a788b49 --- /dev/null +++ b/internal/managementtest/fixtures.go @@ -0,0 +1,198 @@ +// Package managementtest contains independent source-based fixtures for offline +// CLI and REST transport assertions. No fixture is derived from the registry. +package managementtest + +import ( + "archive/zip" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + "time" +) + +type Fixture struct { + Method, Path string + Params, Query map[string]string + Body map[string]any +} + +func Fixtures() map[string]Fixture { + out := map[string]Fixture{} + put := func(key, method, path string, params, query map[string]string, body map[string]any) { + out[key] = Fixture{method, path, params, query, body} + } + put("cache/execute-command", "POST", "/agc/edge/scs/scs-service/v1/eval", nil, nil, map[string]any{"command": "GET fixture-key"}) + put("cache/connection-info", "GET", "/agc/edge/scs/scs-service/v1/cache-invoke-address", nil, nil, nil) + put("cache/usage", "POST", "/agc/edge/spms/v1/query/metric/scs-metric", nil, map[string]string{"views": "query_cache_metric_trend", "startTime": "1792962000000", "endTime": "1792965600000"}, nil) + put("cache/enable-service", "POST", "/agc/edge/cpms/project-service/v1/services/order", nil, map[string]string{"projectId": "offline-project"}, map[string]any{"serviceName": "cloudCache"}) + for _, v := range []struct{ id, method string }{{"set-password", "POST"}, {"reset-password", "PUT"}} { + put("cache/"+v.id, v.method, "/agc/edge/scs/scs-service/v1/cache-password", nil, nil, map[string]any{"password": "Offline9!fixture"}) + } + db := "/agc/edge/clouddb/clouddbservice/v1/" + object := map[string]any{"objectTypeName": "Book", "fields": []any{map[string]any{"fieldName": "id", "fieldType": "Integer", "belongPrimaryKey": true, "notNull": true}}, "indexes": []any{}, "permissions": []any{map[string]any{"role": "Administrator", "rights": []any{"Read", "Upsert", "Delete"}}}} + put("clouddb/schema-versions", "GET", db+"schemaVersion", nil, nil, nil) + put("clouddb/get-object-type", "GET", db+"objectType", nil, map[string]string{"schemaVersion": "1", "objectTypeName": "Book"}, nil) + put("clouddb/create-object-type", "POST", db+"objectType", nil, nil, map[string]any{"objectType": object}) + put("clouddb/update-object-type", "PUT", db+"objectType", nil, nil, map[string]any{"objectType": object, "originObjectType": object}) + put("clouddb/delete-object-type", "DELETE", db+"objectType", nil, nil, map[string]any{"objectTypeName": "Book"}) + put("clouddb/import-object-types", "POST", db+"importObjectType", nil, nil, map[string]any{"schemaVersion": 1, "objectTypes": []any{map[string]any{"objectTypeName": "Book", "fields": object["fields"], "indexes": []any{}}}}) + put("clouddb/export-object-types", "POST", db+"exportObjectType", nil, nil, map[string]any{"schemaVersion": 1, "type": "json"}) + put("clouddb/list-zones", "GET", db+"naturalStore", nil, nil, nil) + put("clouddb/create-zone", "POST", db+"naturalStore", nil, nil, map[string]any{"cloudDBZoneName": "Offline"}) + put("clouddb/delete-zone", "DELETE", db+"naturalStore", nil, nil, map[string]any{"cloudDBZoneName": "Offline"}) + put("clouddb/process-status", "POST", db+"processPercentage", nil, nil, map[string]any{"processId": "offline-process"}) + fn := "/api/wisefunction/serverless/v1/" + fp := map[string]string{"functionName": "test-func"} + ap := map[string]string{"functionName": "test-func", "aliasName": "test-alias"} + put("functions/create-alias", "POST", fn+"functions/test-func/aliases", fp, nil, map[string]any{"name": "test-alias", "functionVersion": "1", "routingConfig": map[string]any{"1": 100}}) + put("functions/list-aliases", "GET", fn+"functions/test-func/aliases", fp, nil, nil) + put("functions/get-alias", "GET", fn+"functions/test-func/aliases/test-alias", ap, nil, nil) + put("functions/delete-alias", "DELETE", fn+"functions/test-func/aliases/test-alias", ap, nil, nil) + put("functions/update-alias", "PUT", fn+"functions/test-func/aliases/test-alias", ap, nil, map[string]any{"functionVersion": "1", "revisionId": "revision-1", "routingConfig": map[string]any{"1": 80, "2": 20}}) + put("functions/create-http-trigger", "POST", fn+"trigger", nil, nil, map[string]any{"funcId": "urn:offline:test-func:1", "mode": "NO_PATH", "authFlag": true, "authAlgor": "HDA-SYSTEM", "authType": "cloudgw-client", "enableUrlDecode": true}) + cron := map[string]any{"funcId": "urn:offline:test-func:1", "triggerType": "Cron", "triggerMode": "ASync", "triggerSwitch": false, "spec": map[string]any{"schedule": "@every 6m", "payload": map[string]any{"hello": "world"}}} + put("functions/create-cron-trigger", "POST", fn+"triggers", nil, nil, cron) + update := map[string]any{"funcId": cron["funcId"], "triggerMode": "ASync", "triggerSwitch": true, "spec": cron["spec"], "revisionId": "revision-1"} + put("functions/update-cron-trigger", "PUT", fn+"triggers/offline-trigger", map[string]string{"triggerId": "offline-trigger"}, nil, update) + for _, v := range []struct{ kind, route, list string }{{"http-trigger", "trigger", "http-triggers"}, {"trigger", "triggers", "triggers"}} { + for _, op := range []struct{ id, method string }{{"get", "GET"}, {"delete", "DELETE"}} { + put("functions/"+op.id+"-"+v.kind, op.method, fn+v.route+"/offline-trigger", map[string]string{"triggerId": "offline-trigger"}, nil, nil) + } + put("functions/list-"+v.list, "GET", fn+v.route+"/list/urn:offline:test-func:1", map[string]string{"funcId": "urn:offline:test-func:1"}, nil, nil) + } + put("functions/get-function-policy", "GET", fn+"functions/test-func/policy", fp, map[string]string{"qualifier": "1"}, nil) + put("functions/create-function-policy", "POST", fn+"functions/test-func/policy", fp, map[string]string{"qualifier": "1"}, map[string]any{"effect": "Allow", "action": "InvokeFunction", "sourceProvider": "Cron", "sourceId": "offline-trigger"}) + put("functions/list-layers", "GET", fn+"layers", nil, nil, nil) + put("functions/list-layer-versions", "GET", fn+"layers/test-layer/versions", map[string]string{"layerName": "test-layer"}, nil, nil) + put("functions/get-layer-version", "GET", fn+"layers/test-layer/versions/1", map[string]string{"layerName": "test-layer", "layerVersion": "1"}, nil, nil) + put("functions/create-layer-version", "POST", fn+"layers/test-layer/versions", map[string]string{"layerName": "test-layer"}, nil, map[string]any{"sharedScope": 0, "compatibleRuntimes": []any{"nodejs14.x"}, "zipFile": "UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA=="}) + sam := map[string]any{"name": "offline-app", "components": []any{map[string]any{"name": "test-func", "type": "Huawei::AGC::CloudFunctions", "properties": map[string]any{"codeUri": "offline-bucket/test.zip", "runtime": "nodejs14.x", "memorySize": 500, "timeout": 55, "handler": "handler.myHandler", "instanceConcurrency": 100}}}} + samProperties := sam["components"].([]any)[0].(map[string]any)["properties"].(map[string]any) + samProperties["description"] = "offline SAM fixture" + samProperties["env"] = []any{map[string]any{"name": "ENV_ONE", "value": "offline-value"}} + samProperties["events"] = []any{map[string]any{"name": "http-event", "type": "http", "properties": map[string]any{"authType": "cloudgw-client", "enableUrlDecode": false}}, map[string]any{"name": "cron-event", "type": "cron", "properties": map[string]any{"schedule": "@every 6m", "input": `{"test":true}`}}} + put("templates/search-applications", "GET", "/api/adm/v1/applications/search", nil, map[string]string{"appName": "offline-app"}, nil) + put("templates/create-application", "POST", "/api/adm/v1/applications", nil, nil, sam) + put("templates/create-plan", "POST", "/api/adm/v1/applications/offline-app/plans", map[string]string{"applicationId": "offline-app"}, nil, sam) + put("templates/get-plan", "GET", "/api/adm/v1/applications/plans/offline-plan", map[string]string{"planId": "offline-plan"}, nil, nil) + put("templates/apply-plan", "PUT", "/api/adm/v1/applications/offline-app/plans/offline-plan", map[string]string{"applicationId": "offline-app", "planId": "offline-plan"}, nil, nil) + return out +} + +func SessionFile(t *testing.T, base string) string { + t.Helper() + p := filepath.Join(t.TempDir(), "session.json") + b, _ := json.Marshal(map[string]any{"uid": "offline-user", "teamId": "offline-team", "productId": "offline-project", "accessToken": "offline-oauth", "authInfo": "offline-auth", "csrfToken": "offline-csrf", "expiresAt": time.Now().Add(time.Hour), "projectBaseUrl": base, "projectEdgeBaseUrl": base, "teamBaseUrl": base}) + var session map[string]any + json.Unmarshal(b, &session) + session["projectStorageBaseUrl"] = base + b, _ = json.Marshal(session) + if err := os.WriteFile(p, b, 0600); err != nil { + t.Fatal(err) + } + return p +} + +func Deployment(t *testing.T) (*httptest.Server, map[string]any) { + t.Helper() + file := filepath.Join(t.TempDir(), "function.zip") + f, err := os.Create(file) + if err != nil { + t.Fatal(err) + } + z := zip.NewWriter(f) + entry, _ := z.Create("handler.js") + entry.Write([]byte("exports.myHandler=()=>1")) + z.Close() + f.Close() + body := Fixtures()["templates/create-application"].Body + body["storageInstance"] = "offline-bucket" + body["waitForReady"] = true + body["components"].([]any)[0].(map[string]any)["properties"].(map[string]any)["codeUri"] = file + created, uploaded := false, false + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + if r.Header.Get("oauth2Token") != "offline-oauth" { + t.Error("deployment session lost") + } + switch { + case r.Method == "GET" && r.URL.Path == "/api/adm/v1/applications/search": + if created { + io.WriteString(w, `[{"id":"application:offline","name":"offline-app","status":{"ready":true}}]`) + } else { + io.WriteString(w, `[]`) + } + case r.Method == "PUT" && strings.HasPrefix(r.URL.Path, "/v0/offline-bucket/"): + data, _ := io.ReadAll(r.Body) + expected, _ := os.ReadFile(file) + if string(data) != string(expected) { + t.Error("deployment ZIP changed") + } + uploaded = true + io.WriteString(w, `{}`) + case r.Method == "POST" && r.URL.Path == "/api/adm/v1/applications": + if !uploaded { + t.Error("application before upload") + } + created = true + io.WriteString(w, `{"id":"application:offline"}`) + default: + t.Errorf("unexpected deployment request %s %s", r.Method, r.URL) + http.Error(w, "unexpected", 500) + } + })) + return server, body +} + +func HDCFile(t *testing.T) string { + t.Helper() + t.Setenv("AGC_OFFLINE_HDC_STUB", "1") + p, err := os.Executable() + if err != nil { + t.Fatal(err) + } + return p +} + +func AssertRequest(t *testing.T, r *http.Request, f Fixture) { + t.Helper() + if f.Path == "/agc/edge/clouddb/clouddbservice/v1/importObjectType" && r.Header.Get("Content-Type") != "application/x-www-form-urlencoded" { + t.Error("vendor raw JSON-string import content type changed") + } + if r.Method != f.Method || r.URL.Path != f.Path { + t.Errorf("wire=%s %s want %s %s", r.Method, r.URL.Path, f.Method, f.Path) + } + for k, v := range f.Query { + if r.URL.Query().Get(k) != v { + t.Errorf("query %s lost/changed", k) + } + } + if len(f.Body) > 0 { + var got any + if json.NewDecoder(r.Body).Decode(&got) != nil { + t.Error("missing JSON body") + } + want, _ := json.Marshal(f.Body) + raw, _ := json.Marshal(got) + if string(raw) != string(want) { + t.Errorf("JSON wire differs: %s", raw) + } + } + if r.Header.Get("oauth2Token") != "offline-oauth" || r.Header.Get("Authorization") != "" { + t.Error("wrong authentication branch") + } +} + +// ExitIfHDCStub handles only the explicit offline device command in a child test process. +func ExitIfHDCStub() { + if os.Getenv("AGC_OFFLINE_HDC_STUB") == "1" && len(os.Args) == 8 && os.Args[1] == "-t" && os.Args[3] == "shell" && os.Args[4] == "cf_prefetch" && os.Args[5] == "getcache" && os.Args[6] == "-m" { + fmt.Println(strings.Join(os.Args[1:], "\n")) + os.Exit(0) + } +} diff --git a/pkg/agcapi/authentication_error.go b/pkg/agcapi/authentication_error.go new file mode 100644 index 0000000..8c7f6c7 --- /dev/null +++ b/pkg/agcapi/authentication_error.go @@ -0,0 +1,7 @@ +package agcapi + +// AuthenticationError distinguishes a missing/incompatible credential from +// invalid business input, transport failure and Huawei business result codes. +type AuthenticationError struct{ Message string } + +func (e *AuthenticationError) Error() string { return e.Message } diff --git a/pkg/agcapi/body.go b/pkg/agcapi/body.go index d6ffeff..d364b06 100644 --- a/pkg/agcapi/body.go +++ b/pkg/agcapi/body.go @@ -15,6 +15,9 @@ func MarshalEndpointFields(endpoint domain.Endpoint, fields map[string]string) ( values := map[string]json.RawMessage{} for name, value := range fields { encoded, _ := json.Marshal(value) + if endpoint.DynamicBody != nil { + encoded = []byte(value) + } for _, parameter := range endpoint.Parameters { if parameter.Name == name && parameter.In == "body" && parameter.Type != "" && parameter.Type != "string" { encoded = []byte(value) @@ -26,6 +29,17 @@ func MarshalEndpointFields(endpoint domain.Endpoint, fields map[string]string) ( if err != nil { return nil, fmt.Errorf("body fields must contain valid JSON values") } + // 字段输入也使用结构化校验,保留数组下标;请求的 header/query + // 和跨字段条件由调用方拿到完整请求后统一检查。 + bodyEndpoint := domain.Endpoint{SourceURL: endpoint.SourceURL, DynamicBody: endpoint.DynamicBody, DynamicBodyKeyPattern: endpoint.DynamicBodyKeyPattern} + for _, parameter := range endpoint.Parameters { + if parameter.In == "body" { + bodyEndpoint.Parameters = append(bodyEndpoint.Parameters, parameter) + } + } + if err := ValidateEndpointRequest(bodyEndpoint, nil, nil, encoded); err != nil { + return nil, err + } if err := ValidateEndpointBody(endpoint, encoded); err != nil { return nil, err } @@ -52,12 +66,18 @@ func ValidateEndpointBody(endpoint domain.Endpoint, body []byte) error { continue } raw, ok := fields[parameter.Name] - if !ok || bytes.Equal(bytes.TrimSpace(raw), []byte("null")) { + if !ok { if parameter.Required { return fmt.Errorf("missing required body field %s", parameter.Name) } continue } + if bytes.Equal(bytes.TrimSpace(raw), []byte("null")) { + if parameter.Required { + return fmt.Errorf("body field %s must not be null", parameter.Name) + } + continue + } decoder := json.NewDecoder(bytes.NewReader(raw)) decoder.UseNumber() var value any @@ -68,7 +88,7 @@ func ValidateEndpointBody(endpoint domain.Endpoint, body []byte) error { switch parameter.Type { case "string": text, ok := value.(string) - valid = ok && (!parameter.Required || strings.TrimSpace(text) != "") + valid = ok && (!parameter.Required || parameter.AllowEmpty || strings.TrimSpace(text) != "") case "integer": if number, ok := value.(json.Number); ok { _, err := number.Int64() diff --git a/pkg/agcapi/business_error_test.go b/pkg/agcapi/business_error_test.go index 8cf9702..32e84da 100644 --- a/pkg/agcapi/business_error_test.go +++ b/pkg/agcapi/business_error_test.go @@ -5,6 +5,7 @@ import ( "errors" "net/http" "net/http/httptest" + "strings" "testing" "github.com/Createitv/agc-cli/pkg/domain" @@ -14,6 +15,7 @@ func TestInvokeEndpointBusinessErrors(t *testing.T) { for _, tc := range []struct{ name, body, code, message string }{ {"ret numeric", `{"ret":{"code":204144703,"msg":"permission denied"},"appList":null}`, "204144703", "permission denied"}, {"ret string", `{"ret":{"code":"204144703","msg":"permission denied"}}`, "204144703", "permission denied"}, + {"JSON string ret", `{"ret":"{\"code\":123,\"msg\":\"fingerprint denied\"}"}`, "123", "fingerprint denied"}, {"testing", `{"rtnCode":123,"rtnDesc":"testing denied"}`, "123", "testing denied"}, {"PMS", `{"error":{"errorCode":"123","errorMsg":"PMS denied"}}`, "123", "PMS denied"}, {"flat", `{"code":123,"message":"denied"}`, "123", "denied"}, @@ -39,7 +41,7 @@ func TestInvokeEndpointBusinessErrors(t *testing.T) { } func TestInvokeEndpointBusinessSuccess(t *testing.T) { - for _, body := range []string{`{"ret":{"code":0}}`, `{"ret":{"code":"0"}}`, `{"rtnCode":"0"}`, `{"error":{"errorCode":0}}`, `{"code":0}`, `{"data":[]}`, `{"code":null}`, "binary\x00data"} { + for _, body := range []string{`{"ret":{"code":0}}`, `{"ret":{"code":"0"}}`, `{"ret":"{\"code\":0}"}`, `{"rtnCode":"0"}`, `{"error":{"errorCode":0}}`, `{"code":0}`, `{"data":[]}`, `{"code":null}`, "binary\x00data"} { t.Run(body, func(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(body)) })) defer server.Close() @@ -50,3 +52,25 @@ func TestInvokeEndpointBusinessSuccess(t *testing.T) { }) } } + +func TestBusinessErrorRetainsCodeProvenance(t *testing.T) { + for _, tc := range []struct{ body, field string }{ + {`{"rtnCode":2,"businessCode":0,"rtnDesc":"denied"}`, "rtnCode"}, + {`{"rtnCode":0,"businessCode":2,"rtnDesc":"denied"}`, "businessCode"}, + } { + err := ParseAGCError(200, []byte(tc.body)) + if err.Code != "2" || err.CodeField != tc.field || len(err.ResultCodes) != 2 { + t.Fatalf("code origin lost: %#v", err) + } + } +} + +func TestCodeWithoutDescriptionDoesNotEchoWholeResponse(t *testing.T) { + err := ParseAGCError(200, []byte(`{"rtnCode":0,"businessCode":2,"invitationCode":"raw-secret"}`)) + if strings.Contains(err.Message, "raw-secret") { + t.Fatal("raw response exposed through error message") + } + if err.Code != "2" { + t.Fatal("upstream code lost") + } +} diff --git a/pkg/agcapi/callback_form_test.go b/pkg/agcapi/callback_form_test.go new file mode 100644 index 0000000..16455b5 --- /dev/null +++ b/pkg/agcapi/callback_form_test.go @@ -0,0 +1,47 @@ +package agcapi + +import ( + "context" + "github.com/Createitv/agc-cli/pkg/domain" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +func TestGameCallbackUsesOfficialFormEncodingWithoutAGCToken(t *testing.T) { + for _, id := range []string{"propapi-getroleinfo", "propapi-order"} { + t.Run(id, func(t *testing.T) { + endpoint, _ := domain.EndpointByID("game-items", id) + called := false + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + if !strings.HasPrefix(r.Header.Get("Content-Type"), "application/x-www-form-urlencoded") { + t.Errorf("wrong callback content type: %s", r.Header.Get("Content-Type")) + } + if r.Header.Get("Authorization") != "" { + t.Error("AGC token leaked to callback server") + } + if err := r.ParseForm(); err != nil { + t.Fatal(err) + } + if r.PostForm.Get("sign") != "a+b/=" || r.PostForm.Get("userId") != "测试+player" || r.PostForm.Get("userIdType") != "1" { + t.Errorf("callback form lost original values: %v", r.PostForm) + } + _, _ = w.Write([]byte(`{"code":0}`)) + })) + defer server.Close() + payload := `{"userId":"测试+player","userIdType":1,"ts":123,"sign":"a+b/="}` + if id == "propapi-order" { + payload = `{"requestId":"offline-request","userId":"测试+player","userIdType":1,"zoneId":"offline-zone","roleId":"offline-role","productId":"offline-product","price":199,"quantity":1,"currency":"CNY","ts":123,"sign":"a+b/="}` + } + _, err := InvokeEndpoint(context.Background(), server.Client(), InvokeRequest{Endpoint: endpoint, Params: map[string]string{"callbackUrl": server.URL}, AccessToken: "offline-agc-token", Body: []byte(payload)}) + if err != nil { + t.Fatal(err) + } + if !called { + t.Fatal("callback transport was not exercised") + } + }) + } +} diff --git a/pkg/agcapi/file_validation.go b/pkg/agcapi/file_validation.go new file mode 100644 index 0000000..15550d8 --- /dev/null +++ b/pkg/agcapi/file_validation.go @@ -0,0 +1,40 @@ +package agcapi + +import ( + "os" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +// File prerequisites use the same structured feedback in CLI, REST and API. +func ValidateEndpointFileInput(e domain.Endpoint, path string, headerSets ...map[string]string) error { + if (e.FamilyID == "storage" && e.ID == "upload-file") || (e.FamilyID == "hosting" && e.ID == "upload-version") { + var headers map[string]string + if len(headerSets) > 0 { + headers = headerSets[0] + } + return validateServerlessUploadFile(e, path, headers) + } + if e.FamilyID != "pms" || e.ID != "resourcemanage-harmonyosnext" { + return nil + } + source := e.SourceURL + for _, p := range e.Parameters { + if p.In == "file" && p.Name == "file" && p.SourceURL != "" { + source = p.SourceURL + } + } + code, message := "file_required", "Multipart resource upload requires a local file." + if path != "" { + file, err := os.Open(path) + if err == nil { + info, statErr := file.Stat() + file.Close() + if statErr == nil && info.Mode().IsRegular() { + return nil + } + } + code, message = "invalid_file", "The selected upload file must be readable and regular." + } + return &RequestValidationError{Violations: []domain.InputViolation{{Code: code, Field: "filePath", Message: message, SourceURL: source, Suggestion: "Select a readable local image with --file PATH in CLI or filePath in REST; supply requestId, fileType=1, zoneId=1 and fileName separately."}}} +} diff --git a/pkg/agcapi/file_validation_test.go b/pkg/agcapi/file_validation_test.go new file mode 100644 index 0000000..6860883 --- /dev/null +++ b/pkg/agcapi/file_validation_test.go @@ -0,0 +1,26 @@ +package agcapi + +import ( + "errors" + "path/filepath" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestResourceFileErrorsDoNotExposeLocalPaths(t *testing.T) { + e, _ := domain.EndpointByID("pms", "resourcemanage-harmonyosnext") + dir := t.TempDir() + for _, path := range []string{dir, filepath.Join(dir, "private-missing-file.png")} { + err := ValidateEndpointFileInput(e, path) + var invalid *RequestValidationError + if !errors.As(err, &invalid) || len(invalid.Violations) != 1 { + t.Fatalf("unclassified local file failure: %v", err) + } + v := invalid.Violations[0] + if v.Code != "invalid_file" || v.Field != "filePath" || v.SourceURL == "" || strings.Contains(v.Message, path) { + t.Fatalf("wrong file feedback: %+v", v) + } + } +} diff --git a/pkg/agcapi/gameplay_resources_test.go b/pkg/agcapi/gameplay_resources_test.go new file mode 100644 index 0000000..61a0436 --- /dev/null +++ b/pkg/agcapi/gameplay_resources_test.go @@ -0,0 +1,38 @@ +package agcapi + +import ( + "context" + "github.com/Createitv/agc-cli/pkg/domain" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +func TestGameplayResourceUsesDocumentedHostAndSignedForm(t *testing.T) { + e, _ := domain.EndpointByID("gameplay", "resources") + body := []byte(`{"method":"external.hms.gs.syncGameResources","appId":"fixture","resources":"[{\"index\":\"offline\",\"name\":\"offline\",\"type\":1,\"url\":\"https://example.test/image.png\",\"updateTime\":1,\"operType\":0}]","ts":1,"sign":"offline-sign"}`) + dry, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Body: body, DryRun: true}) + if err != nil { + t.Fatal(err) + } + if !strings.HasPrefix(dry.URL, "https://jos-open-api.cloud.huawei.com/") { + t.Fatalf("wrong documented service host: %s", dry.URL) + } + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Header.Get("Authorization") != "" { + t.Error("AGC token sent to body-signature service") + } + if !strings.HasPrefix(r.Header.Get("Content-Type"), "application/x-www-form-urlencoded") { + t.Error("resource body was not a form") + } + if err := r.ParseForm(); err != nil || r.PostForm.Get("method") != "external.hms.gs.syncGameResources" || !strings.Contains(r.PostForm.Get("resources"), `"index":"offline"`) { + t.Error("resource JSON string changed during form encoding") + } + _, _ = w.Write([]byte(`{"code":0}`)) + })) + defer server.Close() + if _, err := InvokeEndpoint(context.Background(), server.Client(), InvokeRequest{Endpoint: e, BaseURL: server.URL, Body: body, AccessToken: "offline-agc-token"}); err != nil { + t.Fatal(err) + } +} diff --git a/pkg/agcapi/invoke.go b/pkg/agcapi/invoke.go index 55911c7..593f334 100644 --- a/pkg/agcapi/invoke.go +++ b/pkg/agcapi/invoke.go @@ -3,6 +3,7 @@ package agcapi import ( "bytes" "context" + "encoding/base64" "encoding/json" "fmt" "io" @@ -13,21 +14,27 @@ import ( "strings" "github.com/Createitv/agc-cli/pkg/domain" + "github.com/Createitv/agc-cli/pkg/hvigor" ) type InvokeRequest struct { - Endpoint domain.Endpoint `json:"endpoint"` - BaseURL string `json:"baseUrl"` - Params map[string]string `json:"params,omitempty"` - Query map[string]string `json:"query,omitempty"` - Headers map[string]string `json:"headers,omitempty"` - FilePath string `json:"filePath,omitempty"` - Body []byte `json:"-"` - AccessToken string `json:"-"` - DryRun bool `json:"dryRun"` + SessionFile string `json:"sessionFile,omitempty"` + ProjectID string `json:"projectId,omitempty"` + QueryValues map[string][]string `json:"queryValues,omitempty"` + Endpoint domain.Endpoint `json:"endpoint"` + BaseURL string `json:"baseUrl"` + Params map[string]string `json:"params,omitempty"` + Query map[string]string `json:"query,omitempty"` + Headers map[string]string `json:"headers,omitempty"` + FilePath string `json:"filePath,omitempty"` + Body []byte `json:"-"` + AccessToken string `json:"-"` + DryRun bool `json:"dryRun"` } type InvokeResponse struct { + ETag string `json:"etag,omitempty"` + BodyBase64 string `json:"bodyBase64,omitempty"` Method string `json:"method"` URL string `json:"url"` StatusCode int `json:"statusCode,omitempty"` @@ -38,19 +45,138 @@ type InvokeResponse struct { } func InvokeEndpoint(ctx context.Context, client *http.Client, req InvokeRequest) (InvokeResponse, error) { + if req.Endpoint.Authentication == "agcli-user-oauth" { + return InvokeResponse{}, fmt.Errorf("native function workflows require the cloudfunctions client and an explicit OAuth session") + } + if err := ValidateEndpointPathInput(req.Endpoint, req.Params); err != nil { + return InvokeResponse{}, err + } + if domain.IsServerlessFamily(req.Endpoint.FamilyID) { + if err := ValidateEndpointRequest(req.Endpoint, req.Query, req.Headers, req.Body, req.QueryValues); err != nil { + return InvokeResponse{}, err + } + } + if err := ValidateEndpointFileInput(req.Endpoint, req.FilePath, req.Headers); err != nil { + return InvokeResponse{}, err + } + if req.Endpoint.FamilyID == "templates" && req.Endpoint.ID == "deploy" { + return invokeTemplateDeploy(ctx, client, req) + } + if IsManagementEndpoint(req.Endpoint) { + var err error + req, err = managementSessionRequest(req) + if err != nil { + return InvokeResponse{}, err + } + } + if req.Endpoint.Direction == "local" { + if req.Endpoint.FamilyID == "prefetch" && req.Endpoint.ID == "device-getcache" { + return invokePrefetchDevice(ctx, req) + } + result := InvokeResponse{Method: req.Endpoint.Method, URL: req.Endpoint.Path, DryRun: req.DryRun} + if req.Endpoint.FamilyID != "cicd" || req.Endpoint.ID != "build-hvigor" { + return result, fmt.Errorf("unsupported local endpoint") + } + var build hvigor.Request + if err := json.Unmarshal(req.Body, &build); err != nil { + return result, fmt.Errorf("local build requires a JSON request") + } + if build.Project == "" { + return result, fmt.Errorf("project directory required") + } + if req.DryRun { + return result, nil + } + artifact, err := hvigor.Build(ctx, build) + if err != nil { + return result, err + } + result.StatusCode, result.ContentType = 200, "application/json" + result.Body, err = json.Marshal(artifact) + result.RawBody = result.Body + return result, err + } if client == nil { client = http.DefaultClient } - url, err := BuildEndpointURL(req.BaseURL, req.Endpoint.Path, req.Params, req.Query) + if req.BaseURL == "" && req.Endpoint.DefaultBaseURL != "" { + req.BaseURL = req.Endpoint.DefaultBaseURL + } + endpointURL, err := BuildEndpointURLWithValues(req.BaseURL, req.Endpoint.Path, req.Params, req.Query, req.QueryValues) if err != nil { return InvokeResponse{}, err } - result := InvokeResponse{Method: req.Endpoint.Method, URL: url, DryRun: req.DryRun} - signedUpload := req.Endpoint.Method == http.MethodPut && req.Endpoint.Path == "{uploadUrl}" && (req.Endpoint.ID == "upload-file-new" || req.Endpoint.ID == "obbfile-upload") + if domain.IsServerlessFamily(req.Endpoint.FamilyID) { + u, parseErr := url.Parse(endpointURL) + loopback := parseErr == nil && (u.Hostname() == "127.0.0.1" || u.Hostname() == "localhost" || u.Hostname() == "::1") + if parseErr != nil || u.Host == "" || u.User != nil || (u.Scheme != "https" && !(u.Scheme == "http" && loopback)) { + field := "baseUrl" + if req.Endpoint.Direction == "inbound-callback" { + field = "params.callbackUrl" + } + if req.Endpoint.Authentication == "signed-upload" { + field = "params.uploadUrl" + } + return InvokeResponse{}, uploadIssue(req.Endpoint, field, "Serverless and developer callback URLs require HTTPS; only loopback HTTP is allowed for isolated tests, and URL user credentials are forbidden.") + } + } + result := InvokeResponse{Method: req.Endpoint.Method, URL: endpointURL, DryRun: req.DryRun} + if req.Endpoint.FamilyID == "prefetch" { + u, _ := url.Parse(result.URL) + q := u.Query() + if q.Has("token") { + q.Set("token", "[redacted]") + } + u.RawQuery = q.Encode() + result.URL = u.String() + } + signedUpload := req.Endpoint.Authentication == "signed-upload" || (req.Endpoint.Method == http.MethodPut && req.Endpoint.Path == "{uploadUrl}" && (req.Endpoint.ID == "upload-file-new" || req.Endpoint.ID == "obbfile-upload")) + storageUpload := req.Endpoint.FamilyID == "storage" && req.Endpoint.ID == "upload-file" || req.Endpoint.ID == "template-code-upload" + // Publishing JSON operations accept an empty object, not an absent entity. + if req.Endpoint.FamilyID == "publishing" && req.Endpoint.Body != "" && len(req.Body) == 0 && !signedUpload { + req.Body = []byte("{}") + } + // Vendor schema import passes a JSON file's raw string to Axios, which sets + // its default form content type but does not form-encode that string. + rawSchemaImport := IsManagementEndpoint(req.Endpoint) && req.Endpoint.FamilyID == "clouddb" && req.Endpoint.ID == "import-object-types" + if strings.HasPrefix(req.Endpoint.RequestContentType, "application/x-www-form-urlencoded") && !rawSchemaImport && req.Endpoint.ID != "template-code-upload" { + decoder := json.NewDecoder(bytes.NewReader(req.Body)) + decoder.UseNumber() + var fields map[string]any + if err := decoder.Decode(&fields); err != nil || fields == nil { + return result, fmt.Errorf("callback form requires a JSON object of documented fields") + } + form := url.Values{} + for name, value := range fields { + switch typed := value.(type) { + case string: + form.Set(name, typed) + case json.Number: + form.Set(name, typed.String()) + default: + return result, fmt.Errorf("callback form field %s must be a string or number", name) + } + } + req.Body = []byte(form.Encode()) + result.ContentType = req.Endpoint.RequestContentType + } var body io.Reader = bytes.NewReader(req.Body) var fileSize int64 - if req.FilePath != "" { - if !signedUpload { + multipartResource := req.Endpoint.FamilyID == "pms" && req.Endpoint.ID == "resourcemanage-harmonyosnext" + if multipartResource { + if req.FilePath == "" { + return result, fmt.Errorf("multipart resource upload requires a file") + } + file, size, contentType, uploadErr := preparePMSResourceUpload(req.FilePath, req.Body) + if uploadErr != nil { + return result, uploadErr + } + defer os.Remove(file.Name()) + defer file.Close() + body, fileSize = file, size + result.ContentType = contentType + } else if req.FilePath != "" { + if !signedUpload && !storageUpload { return result, fmt.Errorf("file upload is unsupported for endpoint %s", req.Endpoint.ID) } if len(req.Body) > 0 { @@ -73,16 +199,31 @@ func InvokeEndpoint(ctx context.Context, client *http.Client, req InvokeRequest) if req.DryRun { return result, nil } - httpReq, err := http.NewRequestWithContext(ctx, req.Endpoint.Method, url, body) + if domain.IsServerlessFamily(req.Endpoint.FamilyID) { + switch req.Endpoint.Authentication { + case "server-api-client", "client-api-token", "service-account-or-api-client": + if req.AccessToken == "" && uploadHeader(req.Headers, "Authorization") == "" { + return result, &AuthenticationError{Message: "Explicit service-compatible authorization is required."} + } + if req.Endpoint.Authentication != "service-account-or-api-client" && uploadHeader(req.Headers, "client_id") == "" { + return result, &AuthenticationError{Message: "API client authorization requires the matching client_id header."} + } + } + } + httpReq, err := http.NewRequestWithContext(ctx, req.Endpoint.Method, endpointURL, body) if err != nil { return InvokeResponse{}, err } - if req.AccessToken != "" && !signedUpload { + if req.AccessToken != "" && !signedUpload && req.Endpoint.Direction != "inbound-callback" && req.Endpoint.Authentication != "body-signature" && req.Endpoint.Authentication != "body-client-credentials" { httpReq.Header.Set("Authorization", "Bearer "+req.AccessToken) } for key, value := range req.Headers { if value != "" { - httpReq.Header.Set(key, value) + if strings.EqualFold(key, "Host") { + httpReq.Host = value + } else { + httpReq.Header.Set(key, value) + } } } if req.FilePath != "" { @@ -91,6 +232,12 @@ func InvokeEndpoint(ctx context.Context, client *http.Client, req InvokeRequest) httpReq.Body = http.NoBody } } + if req.Endpoint.RequestContentType != "" { + httpReq.Header.Set("Content-Type", req.Endpoint.RequestContentType) + } + if multipartResource { + httpReq.Header.Set("Content-Type", result.ContentType) + } if httpReq.Header.Get("Content-Type") == "" { if signedUpload { httpReq.Header.Set("Content-Type", "application/octet-stream") @@ -98,25 +245,66 @@ func InvokeEndpoint(ctx context.Context, client *http.Client, req InvokeRequest) httpReq.Header.Set("Content-Type", "application/json") } } + if domain.IsServerlessFamily(req.Endpoint.FamilyID) { + // Authenticated redirects cannot change origin (including signed uploads). + clone := *client + previous := clone.CheckRedirect + clone.CheckRedirect = func(next *http.Request, via []*http.Request) error { + if len(via) > 0 && (next.URL.Scheme != via[0].URL.Scheme || next.URL.Host != via[0].URL.Host) { + return fmt.Errorf("cross-origin redirect refused for serverless credentials") + } + if previous != nil { + return previous(next, via) + } + if len(via) >= 10 { + return fmt.Errorf("too many redirects") + } + return nil + } + client = &clone + } resp, err := client.Do(httpReq) if err != nil { return InvokeResponse{}, err } defer resp.Body.Close() - data, err := io.ReadAll(resp.Body) + var responseReader io.Reader = resp.Body + responseLimit := int64(0) + if req.Endpoint.FamilyID == "prefetch" { + responseLimit = 3 << 20 + if req.Endpoint.ID == "fetch-install" { + responseLimit = 2 << 20 + } + responseReader = io.LimitReader(resp.Body, responseLimit+1) + } + if IsManagementEndpoint(req.Endpoint) { + responseLimit = 32 << 20 + responseReader = io.LimitReader(resp.Body, responseLimit+1) + } + data, err := io.ReadAll(responseReader) if err != nil { return InvokeResponse{}, err } + if responseLimit > 0 && int64(len(data)) > responseLimit { + return InvokeResponse{}, uploadIssue(req.Endpoint, "response.body", "Response exceeds the documented prefetch quota or local management response limit; refusing truncated success.") + } + if IsManagementEndpoint(req.Endpoint) { + data = redactManagementResponse(data, req.Headers, req.Body) + } result.StatusCode = resp.StatusCode result.ContentType = resp.Header.Get("Content-Type") + // 只暴露内容校验值,不把认证头或签名地址复制到响应元数据中。 + result.ETag = resp.Header.Get("ETag") result.RawBody = data - if len(data) > 0 && json.Valid(data) { + if req.Endpoint.FamilyID == "storage" && req.Endpoint.ID == "download-file" && resp.StatusCode < 400 { + result.BodyBase64 = base64.StdEncoding.EncodeToString(data) + } else if len(data) > 0 && json.Valid(data) { result.Body = data } else if len(data) > 0 { encoded, _ := json.Marshal(string(data)) result.Body = encoded } - if resp.StatusCode >= 400 || businessFailure(data) { + if resp.StatusCode >= 400 || (!(req.Endpoint.FamilyID == "storage" && req.Endpoint.ID == "download-file") && req.Endpoint.FamilyID != "prefetch" && businessFailure(data)) { return result, ParseAGCError(resp.StatusCode, data) } return result, nil @@ -135,6 +323,17 @@ func BuildEndpointURL(baseURL, path string, params, query map[string]string) (st baseURL = "" } for key, value := range params { + if key != "uploadUrl" && key != "callbackUrl" { + if key == "object_name" { + parts := strings.Split(value, "/") + for i := range parts { + parts[i] = url.PathEscape(parts[i]) + } + value = strings.Join(parts, "/") + } else { + value = url.PathEscape(value) + } + } path = strings.ReplaceAll(path, "{"+key+"}", value) } if strings.Contains(path, "{") { @@ -171,3 +370,42 @@ func appendQuery(fullURL string, query map[string]string) string { sort.Strings(parts) return fullURL + separator + strings.Join(parts, "&") } + +// BuildEndpointURLWithValues preserves ordered repeated keys from official +// report examples. Scalar query entries remain compatible with existing clients. +func BuildEndpointURLWithValues(baseURL, path string, params, query map[string]string, values map[string][]string) (string, error) { + full, err := BuildEndpointURL(baseURL, path, params, query) + if err != nil || len(values) == 0 { + return full, err + } + parsed, err := url.Parse(full) + if err != nil { + return "", err + } + encoded := parsed.Query() + for key, entries := range values { + encoded.Del(key) + for _, value := range entries { + encoded.Add(key, value) + } + } + parsed.RawQuery = encoded.Encode() + return parsed.String(), nil +} + +// ScalarQuery supplies required-field and scalar-rule validation with the +// first value of each ordered query list, without modifying the caller's maps. +func ScalarQuery(query map[string]string, values map[string][]string) map[string]string { + result := make(map[string]string, len(query)+len(values)) + for key, value := range query { + result[key] = value + } + for key, entries := range values { + if len(entries) > 0 { + result[key] = entries[0] + } else { + delete(result, key) + } + } + return result +} diff --git a/pkg/agcapi/management_session.go b/pkg/agcapi/management_session.go new file mode 100644 index 0000000..d45adad --- /dev/null +++ b/pkg/agcapi/management_session.go @@ -0,0 +1,178 @@ +package agcapi + +import ( + "encoding/json" + "io" + "net/url" + "os" + "strings" + "time" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +// ManagementSession is explicit and never read from the publishing profile or +// the official CLI's encrypted session store. Cookie transport is source-based. +type ManagementSession struct { + UID string `json:"uid"` + TeamID string `json:"teamId"` + ProductID string `json:"productId"` + AccessToken string `json:"accessToken"` + AuthInfo string `json:"authInfo"` + CSRFToken string `json:"csrfToken"` + ExpiresAt time.Time `json:"expiresAt"` + ProjectBaseURL string `json:"projectBaseUrl"` + ProjectEdgeBaseURL string `json:"projectEdgeBaseUrl"` + TeamBaseURL string `json:"teamBaseUrl"` + ProjectStorageBaseURL string `json:"projectStorageBaseUrl"` +} + +func IsManagementEndpoint(e domain.Endpoint) bool { + return e.Authentication == "agcli-management-oauth" || e.Authentication == "agcli-management-cookie" +} + +func managementSessionRequest(req InvokeRequest) (InvokeRequest, error) { + if req.DryRun { + if req.BaseURL == "" { + req.BaseURL = "https://session-required.invalid" + } + req.AccessToken = "" + return req, nil + } + fail := func(message string) (InvokeRequest, error) { return req, &AuthenticationError{Message: message} } + if req.SessionFile == "" { + return fail("An explicit --session-file (REST sessionFile) with an unexpired user session is required; publishing profiles are not compatible.") + } + f, err := os.Open(req.SessionFile) + if err != nil { + return fail("Cannot read explicitly selected management session file.") + } + defer f.Close() + b, err := io.ReadAll(io.LimitReader(f, 65537)) + if err != nil || len(b) > 65536 { + return fail("Management session file exceeds the 64 KiB local limit or cannot be read.") + } + var s ManagementSession + if json.Unmarshal(b, &s) != nil || s.UID == "" || s.TeamID == "" || s.ProductID == "" || s.AccessToken == "" || !s.ExpiresAt.After(time.Now()) { + return fail("Explicit user session must include uid, teamId, productId, accessToken and a future RFC3339 expiresAt.") + } + if req.ProjectID != "" && req.ProjectID != s.ProductID { + return fail("Selected projectId does not match management session productId.") + } + if req.Query["projectId"] != "" && req.Query["projectId"] != s.ProductID { + return fail("query.projectId does not match management session productId.") + } + base := s.ProjectBaseURL + if req.Endpoint.Authentication == "agcli-management-cookie" { + base = s.ProjectEdgeBaseURL + } + if req.Endpoint.FamilyID == "templates" { + base = s.TeamBaseURL + } + if req.Endpoint.ID == "template-code-upload" { + base = s.ProjectStorageBaseURL + } + if req.BaseURL != "" { + base = req.BaseURL + } + u, err := url.Parse(base) + if err != nil || u.Host == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || (u.Scheme != "https" && !(u.Scheme == "http" && (u.Hostname() == "127.0.0.1" || u.Hostname() == "localhost" || u.Hostname() == "::1"))) { + return fail("Management session requires the source-defined HTTPS base URL; only loopback HTTP is supported for offline testing.") + } + req.BaseURL = base + req.AccessToken = "" + headers := map[string]string{} + for k, v := range req.Headers { + headers[k] = v + } + for k := range headers { + switch strings.ToLower(k) { + case "authorization", "oauth2token", "cookie", "x-hd-csrf", "uid", "teamid", "productid", "projectid", "agcteamid": + delete(headers, k) + } + } + for _, v := range []string{s.UID, s.TeamID, s.ProductID, s.AccessToken, s.AuthInfo, s.CSRFToken} { + if strings.ContainsAny(v, "\r\n") { + return fail("Management session contains invalid header characters.") + } + } + headers["uid"] = s.UID + headers["teamId"] = s.TeamID + headers["productId"] = s.ProductID + headers["oauth2Token"] = s.AccessToken + headers["X-HD-DATE"] = time.Now().UTC().Format("20060102T150405Z") + if req.Endpoint.Authentication == "agcli-management-cookie" { + if s.AuthInfo == "" || s.CSRFToken == "" || strings.ContainsAny(s.AuthInfo+s.CSRFToken, ";") { + return fail("This vendor transport requires explicit authInfo and csrfToken session fields; they are not inferred from an OAuth token.") + } + headers["projectId"] = s.ProductID + headers["agcTeamId"] = s.TeamID + headers["Cookie"] = "authInfo=" + s.AuthInfo + ";csrfToken=" + s.CSRFToken + ";" + headers["X-HD-CSRF"] = s.CSRFToken + } + req.Headers = headers + return req, nil +} + +func redactManagementResponse(data []byte, headers map[string]string, requestBody []byte) []byte { + // Replace credential values even if an upstream error echoes them. Never + // expose raw HTML/text replies from an authenticated management endpoint. + var root any + dec := json.NewDecoder(strings.NewReader(string(data))) + dec.UseNumber() + if dec.Decode(&root) != nil { + return []byte(`{"message":"Non-JSON management response omitted"}`) + } + secrets := []string{} + var input map[string]any + if json.Unmarshal(requestBody, &input) == nil { + for _, key := range []string{"password", "accessToken", "authInfo", "csrfToken"} { + if value, ok := input[key].(string); ok && value != "" { + secrets = append(secrets, value) + } + } + } + for k, v := range headers { + if strings.EqualFold(k, "oauth2Token") || strings.EqualFold(k, "Cookie") || strings.EqualFold(k, "X-HD-CSRF") { + secrets = append(secrets, v) + if strings.EqualFold(k, "Cookie") { + for _, pair := range strings.Split(v, ";") { + _, value, ok := strings.Cut(pair, "=") + if ok && value != "" { + secrets = append(secrets, value) + } + } + } + } + } + var walk func(any) any + walk = func(v any) any { + switch x := v.(type) { + case map[string]any: + for k, c := range x { + switch strings.ToLower(k) { + case "accesstoken", "authinfo", "csrftoken", "password", "authorization", "cookie", "oauth2token", "environment", "env": + delete(x, k) + default: + x[k] = walk(c) + } + } + return x + case []any: + for i, c := range x { + x[i] = walk(c) + } + return x + case string: + for _, secret := range secrets { + if secret != "" { + x = strings.ReplaceAll(x, secret, "[redacted]") + } + } + return x + } + return v + } + out, _ := json.Marshal(walk(root)) + return out +} diff --git a/pkg/agcapi/management_session_test.go b/pkg/agcapi/management_session_test.go new file mode 100644 index 0000000..4dc531c --- /dev/null +++ b/pkg/agcapi/management_session_test.go @@ -0,0 +1,66 @@ +package agcapi + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "net/http/httptest" + "os" + "strings" + "testing" + "time" + + "github.com/Createitv/agc-cli/internal/managementtest" + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestManagementErrorsRedactRequestPasswordsAndSessionValues(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(400) + w.Write([]byte(`{"code":123,"message":"Offline9!fixture offline-auth offline-csrf offline-oauth","password":"Offline9!fixture"}`)) + })) + defer srv.Close() + e, _ := domain.EndpointByID("cache", "reset-password") + out, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, SessionFile: managementtest.SessionFile(t, srv.URL), Body: []byte(`{"password":"Offline9!fixture"}`)}) + if err == nil { + t.Fatal("upstream failure hidden") + } + for _, secret := range []string{"Offline9!fixture", "offline-auth", "offline-csrf", "offline-oauth"} { + if strings.Contains(err.Error()+string(out.Body), secret) { + t.Fatal("credential exposed in management failure feedback") + } + } +} + +func TestManagementSessionIsolationRejectsInvalidContextBeforeNetwork(t *testing.T) { + e, _ := domain.EndpointByID("cache", "connection-info") + for _, change := range []struct { + name string + update func(map[string]any) + }{ + {"expired", func(s map[string]any) { s["expiresAt"] = time.Now().Add(-time.Minute) }}, + {"missing-cookie", func(s map[string]any) { delete(s, "authInfo") }}, + {"header-injection", func(s map[string]any) { s["csrfToken"] = "unsafe\nvalue" }}, + {"non-https", func(s map[string]any) { s["projectEdgeBaseUrl"] = "http://example.invalid" }}, + } { + t.Run(change.name, func(t *testing.T) { + called := false + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { called = true })) + defer srv.Close() + path := managementtest.SessionFile(t, srv.URL) + b, _ := os.ReadFile(path) + var s map[string]any + json.Unmarshal(b, &s) + change.update(s) + b, _ = json.Marshal(s) + os.WriteFile(path, b, 0600) + _, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, SessionFile: path}) + var auth *AuthenticationError + if called || !errors.As(err, &auth) { + t.Fatalf("called=%v error=%v", called, err) + } + }) + } +} diff --git a/pkg/agcapi/management_validation.go b/pkg/agcapi/management_validation.go new file mode 100644 index 0000000..fbef954 --- /dev/null +++ b/pkg/agcapi/management_validation.go @@ -0,0 +1,419 @@ +package agcapi + +import ( + "archive/zip" + "bytes" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "regexp" + "strconv" + "strings" + "unicode/utf16" + "unicode/utf8" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func validateManagementContent(e domain.Endpoint, query map[string]string, body []byte, root map[string]any) []domain.InputViolation { + if !IsManagementEndpoint(e) { + return nil + } + var issues []domain.InputViolation + add := func(path, message string) { + issues = append(issues, domain.InputViolation{Code: "management_input", Field: path, Message: message, SourceURL: e.SourceURL, Suggestion: "Correct the field using " + e.Command + " --docs --pretty before invoking."}) + } + text := func(key string) string { v, _ := root[key].(string); return v } + if e.FamilyID == "cache" { + if e.ID == "execute-command" { + c := text("command") + tokens := strings.Split(c, " ") + supported := " DEL EXISTS EXPIRE PEXPIRE TTL TYPE APPEND DECR DECRBY GET GETSET INCR INCRBY MGET MSET MSETNX SET SETEX SETNX LINDEX LLEN LPOP LPUSH LRANGE LREM LSET LTRIM RPOP RPUSH SADD SCARD SISMEMBER SMEMBERS SPOP SRANDMEMBER SREM HDEL HEXISTS HGET HGETALL HINCRBY HLEN HKEYS HMGET HMSET HSET HVALS " + valid := len(tokens) > 1 && len(c) <= 4096 && strings.Contains(supported, " "+strings.ToUpper(tokens[0])+" ") + for _, b := range []byte(c) { + if b < 32 || b > 126 { + valid = false + } + } + for _, token := range tokens { + if token == "" { + valid = false + } + } + if !valid { + add("body.command", "Use a supported Web CLI command with ASCII arguments, no empty or space-containing arguments, at most 4096 characters.") + } + } + if e.ID == "reset-password" || e.ID == "set-password" { + p := text("password") + valid := len(p) >= 8 && len(p) <= 32 && regexp.MustCompile(`^[A-Za-z][A-Za-z0-9\-~!@#%^*_=+?$&()|<>{}\[\]]*$`).MatchString(p) + for _, pattern := range []string{`[a-z]`, `[A-Z]`, `[0-9]`, `[\-~!@#%^*_=+?$&()|<>{}\[\]]`} { + valid = valid && regexp.MustCompile(pattern).MatchString(p) + } + if !valid { + add("body.password", "Password must start with a letter and contain lower/uppercase letters, a digit and an allowed special character, 8-32 ASCII characters.") + } + } + if e.ID == "usage" { + start, a := strconv.ParseInt(query["startTime"], 10, 64) + end, b := strconv.ParseInt(query["endTime"], 10, 64) + if a != nil || b != nil || start >= end || end-start > 259200000 { + add("query.endTime", "Supply millisecond epoch startTime and endTime with startTime before endTime and an interval no longer than three days.") + } + } + } + if e.FamilyID == "functions" { + if strings.Contains(e.ID, "alias") && (e.Method == "POST" || e.Method == "PUT") { + config, ok := root["routingConfig"].(map[string]any) + sum := 0 + valid := ok && len(config) > 0 && len(config) <= 2 + for version, value := range config { + if version != "$latest" && !regexp.MustCompile(`^[1-9][0-9]{0,3}$`).MatchString(version) { + valid = false + } + n, ok := value.(json.Number) + weight, err := strconv.Atoi(n.String()) + if !ok || err != nil || weight < 0 || weight > 100 { + valid = false + } + sum += weight + } + if !valid || sum != 100 { + add("body.routingConfig", "Provide one or two version-to-integer-weight entries totaling 100; dynamic version keys are not literal required properties.") + } + } + if strings.Contains(e.ID, "cron-trigger") { + spec, _ := root["spec"].(map[string]any) + schedule, _ := spec["schedule"].(string) + valid := regexp.MustCompile(`^@every [1-9][0-9]*[smh]$`).MatchString(schedule) + if strings.HasPrefix(schedule, "cron(") && strings.HasSuffix(schedule, ")") { + valid = validCron(strings.TrimSuffix(strings.TrimPrefix(schedule, "cron("), ")")) + } + if !valid { + add("body.spec.schedule", "Use @every or a five-field cron(...) expression with documented ranges.") + } + } + if e.ID == "create-http-trigger" { + if flag, ok := root["authFlag"].(bool); ok && !flag { + add("body.authFlag", "Reviewed HTTP trigger creation requires authentication enabled (authFlag=true).") + } + } + if e.ID == "create-layer-version" { + encoded := text("zipFile") + data, err := base64.StdEncoding.Strict().DecodeString(encoded) + if err != nil || len(data) > 150<<20 { + add("body.zipFile", "Supply Base64 ZIP bytes no larger than 150 MiB compressed.") + } else { + z, err := zip.NewReader(bytes.NewReader(data), int64(len(data))) + if err != nil || len(z.File) > 30000 { + add("body.zipFile", "ZIP must be valid and contain at most 30000 entries.") + } else { + var total uint64 + for _, f := range z.File { + total += f.UncompressedSize64 + if total > 300<<20 { + break + } + r, err := f.Open() + if err != nil { + total = 301 << 20 + break + } + n, err := io.Copy(io.Discard, io.LimitReader(r, int64(f.UncompressedSize64)+1)) + r.Close() + if err != nil || uint64(n) != f.UncompressedSize64 { + total = 301 << 20 + break + } + } + if total > 300<<20 { + add("body.zipFile", "ZIP content is corrupt or exceeds 300 MiB uncompressed.") + } + } + } + } + } + if e.FamilyID == "clouddb" { + if (e.ID == "create-zone" || e.ID == "delete-zone") && strings.EqualFold(text("cloudDBZoneName"), "privatedefault") { + add("body.cloudDBZoneName", "privatedefault is a reserved zone name.") + } + if e.ID == "import-object-types" && len(body) > 20<<20 { + add("body.objectTypes", "Each schema import must be at most 20 MiB.") + } + for _, key := range []string{"objectType", "originObjectType"} { + if model, ok := root[key].(map[string]any); ok { + validateSchemaModel(model, "body."+key, add) + } + } + if list, ok := root["objectTypes"].([]any); ok { + for i, v := range list { + if m, ok := v.(map[string]any); ok { + validateSchemaModel(m, fmt.Sprintf("body.objectTypes[%d]", i), add) + } + } + } + if e.ID == "update-object-type" { + before, _ := root["originObjectType"].(map[string]any) + after, _ := root["objectType"].(map[string]any) + if before["objectTypeName"] != after["objectTypeName"] { + add("body.objectType.objectTypeName", "Object type names are immutable; use the exact prior name.") + } + oldFields := map[string]map[string]any{} + oldList, _ := before["fields"].([]any) + for _, v := range oldList { + m, _ := v.(map[string]any) + name, _ := m["fieldName"].(string) + oldFields[strings.ToLower(name)] = m + } + newList, _ := after["fields"].([]any) + for i, v := range newList { + m, _ := v.(map[string]any) + name, _ := m["fieldName"].(string) + if original, ok := oldFields[strings.ToLower(name)]; ok { + for _, flag := range []string{"isNeedEncrypt", "isSensitive"} { + prior, _ := original[flag].(bool) + current, _ := m[flag].(bool) + if prior != current { + add(fmt.Sprintf("body.objectType.fields[%d].%s", i, flag), "Encryption and sensitivity attributes cannot change after a field is created.") + } + } + } + } + oldIndexes := map[string]any{} + oldItems, _ := before["indexes"].([]any) + for _, v := range oldItems { + m, _ := v.(map[string]any) + name, _ := m["indexName"].(string) + oldIndexes[strings.ToLower(name)] = m["indexList"] + } + newItems, _ := after["indexes"].([]any) + for i, v := range newItems { + m, _ := v.(map[string]any) + name, _ := m["indexName"].(string) + if prior, ok := oldIndexes[strings.ToLower(name)]; ok { + a, _ := json.Marshal(prior) + b, _ := json.Marshal(m["indexList"]) + if !bytes.Equal(a, b) { + add(fmt.Sprintf("body.objectType.indexes[%d].indexList", i), "Existing index definitions cannot be modified in place; the documented editor supports adding or deleting indexes.") + } + } + } + } + } + if e.FamilyID == "templates" && (e.ID == "create-application" || e.ID == "create-plan" || e.ID == "deploy") { + components, _ := root["components"].([]any) + seen := map[string]bool{} + for i, v := range components { + m, _ := v.(map[string]any) + name, _ := m["name"].(string) + if seen[name] { + add(fmt.Sprintf("body.components[%d].name", i), "SAM component names must be unique.") + } + seen[name] = true + props, _ := m["properties"].(map[string]any) + if events, ok := props["events"].([]any); ok { + names := map[string]bool{} + for j, item := range events { + event, _ := item.(map[string]any) + name, _ := event["name"].(string) + prefix := fmt.Sprintf("body.components[%d].properties.events[%d]", i, j) + if names[name] { + add(prefix+".name", "SAM event names must be unique within a component.") + } + names[name] = true + if event["type"] == "cron" { + properties, _ := event["properties"].(map[string]any) + schedule, _ := properties["schedule"].(string) + valid := regexp.MustCompile(`^@every [1-9][0-9]*[smh]$`).MatchString(schedule) + if strings.HasPrefix(schedule, "cron(") && strings.HasSuffix(schedule, ")") { + valid = validCron(strings.TrimSuffix(strings.TrimPrefix(schedule, "cron("), ")")) + } + if !valid { + add(prefix+".properties.schedule", "Use the documented @every or five-field cron(...) schedule.") + } + input, _ := properties["input"].(string) + if !json.Valid([]byte(input)) { + add(prefix+".properties.input", "Cron event input must remain a string containing valid JSON.") + } + } + } + } + if description, ok := props["description"].(string); ok { + width := 0 + for _, unit := range utf16.Encode([]rune(description)) { + if unit <= 128 { + width++ + } else { + width += 2 + } + } + if width > 64 { + add(fmt.Sprintf("body.components[%d].properties.description", i), "SAM descriptions have a maximum vendor display width of 64 (non-ASCII UTF-16 units count twice).") + } + } + if env, ok := props["env"].([]any); ok { + for j, item := range env { + entry, _ := item.(map[string]any) + value, _ := entry["value"].(string) + if len(utf16.Encode([]rune(value))) > 2048 { + add(fmt.Sprintf("body.components[%d].properties.env[%d].value", i, j), "SAM environment values have a maximum of 2048 UTF-16 units.") + } + } + } + uri, _ := props["codeUri"].(string) + if e.ID != "deploy" && (strings.Contains(uri, "://") || strings.HasPrefix(uri, "/") || !strings.Contains(uri, "/")) { + add(fmt.Sprintf("body.components[%d].properties.codeUri", i), "Provide an already uploaded bucket/object.zip key, not a local path or URL.") + } + } + } + return issues +} + +func validCron(expression string) bool { + fields := strings.Fields(expression) + if len(fields) != 5 { + return false + } + bounds := [][2]int{{0, 59}, {0, 23}, {1, 31}, {1, 12}, {0, 6}} + for i, field := range fields { + upper := strings.ToUpper(field) + if i == 3 { + for j, n := range []string{"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"} { + upper = strings.ReplaceAll(upper, n, strconv.Itoa(j+1)) + } + } + if i == 4 { + for j, n := range []string{"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"} { + upper = strings.ReplaceAll(upper, n, strconv.Itoa(j)) + } + if strings.Contains(upper, "/") { + return false + } + } + for _, part := range strings.Split(upper, ",") { + steps := strings.Split(part, "/") + if len(steps) > 2 { + return false + } + if len(steps) == 2 { + n, err := strconv.Atoi(steps[1]) + if err != nil || n <= 0 { + return false + } + } + if steps[0] == "*" { + continue + } + r := strings.Split(steps[0], "-") + if len(r) > 2 { + return false + } + prior := -1 + for _, v := range r { + n, err := strconv.Atoi(v) + if err != nil || n < bounds[i][0] || n > bounds[i][1] || prior > n { + return false + } + prior = n + } + } + } + return true +} + +func validateSchemaModel(m map[string]any, path string, add func(string, string)) { + name, _ := m["objectTypeName"].(string) + reserved := " naturalbase_metadata objecttypeinfohelper t_data_upgrade_info t_index_schema t_nstore_config t_schema_negotiate_info t_metadata_schema t_nstore_permission t_system_config " + if strings.HasPrefix(strings.ToLower(name), "sqlite_") || strings.Contains(reserved, " "+strings.ToLower(name)+" ") { + add(path+".objectTypeName", "Use a non-reserved object type name; sqlite_ and system table names are forbidden.") + } + fields, _ := m["fields"].([]any) + primary, encrypted, auto := 0, 0, 0 + seen := map[string]bool{} + types := map[string]string{} + sensitive := map[string]bool{} + for i, v := range fields { + f, _ := v.(map[string]any) + n, _ := f["fieldName"].(string) + typ, _ := f["fieldType"].(string) + fp := fmt.Sprintf("%s.fields[%d]", path, i) + if seen[strings.ToLower(n)] { + add(fp+".fieldName", "Field names are case-insensitively unique.") + } + seen[strings.ToLower(n)] = true + types[n] = typ + reservedFields := " naturalbase_version naturalbase_deleted naturalbase_operationtype naturalbase_creator naturalbase_accesstime naturalbase_operationtime naturalbase_syncstatus naturalbase_changedfieldsbitmap naturalbase_lastmodifier cmin cmax xmin xmax ctid oid tableoid xc_node_id tablebucketid rowid " + if strings.Contains(reservedFields, " "+strings.ToLower(n)+" ") { + add(fp+".fieldName", "System field names are reserved.") + } + pk, _ := f["belongPrimaryKey"].(bool) + enc, _ := f["isNeedEncrypt"].(bool) + sens, _ := f["isSensitive"].(bool) + nn, _ := f["notNull"].(bool) + _, hasDefault := f["defaultValue"] + sensitive[n] = sens + if pk { + primary++ + if strings.Contains(" ByteArray Text Date Double Float Boolean ", " "+typ+" ") { + add(fp+".belongPrimaryKey", "This field type cannot be a primary key.") + } + } + isAuto := typ == "IntAutoIncrement" || typ == "LongAutoIncrement" + if isAuto { + auto++ + } + if enc || sens { + encrypted++ + if pk || nn || hasDefault || enc && sens { + add(fp+".isNeedEncrypt", "Encrypted or sensitive fields cannot be primary, non-null, defaulted, or both encrypted and sensitive.") + } + } + if enc && strings.Contains(" ByteArray Text IntAutoIncrement LongAutoIncrement ", " "+typ+" ") { + add(fp+".isNeedEncrypt", "This field type cannot be encrypted.") + } + if sens && !strings.Contains(" Byte Short Integer Long Float Double String Date ", " "+typ+" ") { + add(fp+".isSensitive", "Unsupported sensitive-field type.") + } + if nn && (typ == "ByteArray" || typ == "Date") { + add(fp+".notNull", "ByteArray and Date cannot be explicitly non-null.") + } + if nn && !pk && !isAuto && !hasDefault { + add(fp+".defaultValue", "Non-null, non-primary fields require a default value.") + } + if hasDefault && (pk || enc || sens || isAuto || typ == "ByteArray" || typ == "Date") { + add(fp+".defaultValue", "This field cannot have a default value.") + } + if def, ok := f["defaultValue"].(string); ok && typ == "Text" && utf8.RuneCountInString(def) > 200 { + add(fp+".defaultValue", "Text defaults have a maximum of 200 characters.") + } + } + if primary < 1 || primary > 5 { + add(path+".fields", "Define one to five primary-key fields.") + } + if encrypted > 5 { + add(path+".fields", "At most five encrypted and sensitive fields combined.") + } + if auto > 1 { + add(path+".fields", "At most one auto-increment field is supported.") + } + indexes, _ := m["indexes"].([]any) + seenIndex := map[string]bool{} + for i, v := range indexes { + index, _ := v.(map[string]any) + name, _ := index["indexName"].(string) + ip := fmt.Sprintf("%s.indexes[%d]", path, i) + if seenIndex[strings.ToLower(name)] { + add(ip+".indexName", "Index names must be case-insensitively unique.") + } + seenIndex[strings.ToLower(name)] = true + list, _ := index["indexList"].([]any) + for j, f := range list { + field, _ := f.(map[string]any) + name, _ := field["fieldName"].(string) + if types[name] == "" || types[name] == "ByteArray" || types[name] == "Text" || sensitive[name] { + add(fmt.Sprintf("%s.indexList[%d].fieldName", ip, j), "Index must reference an existing indexable non-sensitive field.") + } + } + } +} diff --git a/pkg/agcapi/management_validation_test.go b/pkg/agcapi/management_validation_test.go new file mode 100644 index 0000000..f6e9320 --- /dev/null +++ b/pkg/agcapi/management_validation_test.go @@ -0,0 +1,101 @@ +package agcapi + +import ( + "context" + "encoding/json" + "errors" + "github.com/Createitv/agc-cli/pkg/domain" + "strings" + "testing" +) + +func TestSchemaUpdatesPreserveImmutableFieldFlagsAndIndexDefinitions(t *testing.T) { + e, _ := domain.EndpointByID("clouddb", "update-object-type") + original := map[string]any{"objectTypeName": "Book", "fields": []any{map[string]any{"fieldName": "id", "fieldType": "Integer", "belongPrimaryKey": true}, map[string]any{"fieldName": "secret", "fieldType": "String", "isNeedEncrypt": false, "isSensitive": false}}, "indexes": []any{map[string]any{"indexName": "byId", "indexList": []any{map[string]any{"fieldName": "id", "sortType": "ASC"}}}}} + for _, test := range []struct { + name, field string + change func(map[string]any) + }{ + {"encryption", "body.objectType.fields[1].isNeedEncrypt", func(m map[string]any) { m["fields"].([]any)[1].(map[string]any)["isNeedEncrypt"] = true }}, + {"sensitivity", "body.objectType.fields[1].isSensitive", func(m map[string]any) { m["fields"].([]any)[1].(map[string]any)["isSensitive"] = true }}, + {"index", "body.objectType.indexes[0].indexList", func(m map[string]any) { + m["indexes"].([]any)[0].(map[string]any)["indexList"].([]any)[0].(map[string]any)["sortType"] = "DESC" + }}, + } { + t.Run(test.name, func(t *testing.T) { + raw, _ := json.Marshal(original) + var changed map[string]any + json.Unmarshal(raw, &changed) + test.change(changed) + b, _ := json.Marshal(map[string]any{"originObjectType": original, "objectType": changed}) + err := ValidateEndpointRequest(e, nil, nil, b) + var invalid *RequestValidationError + if !errors.As(err, &invalid) { + t.Fatalf("immutable mutation accepted: %v", err) + } + for _, issue := range invalid.Violations { + if issue.Field == test.field { + return + } + } + t.Fatalf("missing precise child path %s", test.field) + }) + } +} + +func TestSAMNestedEnvironmentAndHandlerRulesRejectBeforeAuthorization(t *testing.T) { + e, _ := domain.EndpointByID("templates", "deploy") + for _, test := range []struct { + name string + prop map[string]any + }{ + {"handler", map[string]any{"handler": "missing-dot"}}, + {"environment-key", map[string]any{"env": []any{map[string]any{"name": "bad name", "value": "valid"}}}}, + {"environment-value", map[string]any{"env": []any{map[string]any{"name": "GOOD", "value": strings.Repeat("x", 2049)}}}}, + {"http-event-prerequisites", map[string]any{"events": []any{map[string]any{"name": "test-event", "type": "http", "properties": map[string]any{}}}}}, + {"cron-event-json", map[string]any{"events": []any{map[string]any{"name": "test-event", "type": "cron", "properties": map[string]any{"schedule": "@every 6m", "input": "not-json"}}}}}, + } { + t.Run(test.name, func(t *testing.T) { + properties := map[string]any{"codeUri": "/offline.zip", "runtime": "nodejs14.x", "memorySize": 500, "timeout": 55, "handler": "handler.myHandler", "instanceConcurrency": 100} + for k, v := range test.prop { + properties[k] = v + } + body, _ := json.Marshal(map[string]any{"name": "offline", "storageInstance": "offline-bucket", "components": []any{map[string]any{"name": "test-func", "type": "Huawei::AGC::CloudFunctions", "properties": properties}}}) + if ValidateEndpointRequest(e, nil, nil, body) == nil { + t.Fatal("invalid SAM child field accepted") + } + }) + } +} + +func TestManagementPathViolationPrecedesSessionLookup(t *testing.T) { + e, _ := domain.EndpointByID("functions", "get-alias") + _, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Params: map[string]string{"functionName": "INVALID NAME", "aliasName": "test-alias"}, SessionFile: "/must-not-read"}) + var invalid *RequestValidationError + if !errors.As(err, &invalid) || len(invalid.Violations) == 0 || invalid.Violations[0].Field != "params.functionName" { + t.Fatalf("expected indexed path validation before session lookup: %v", err) + } +} + +func TestReviewedManagementRejectsInvalidContent(t *testing.T) { + cases := []struct{ family, id, body string }{ + {"cache", "execute-command", `{"command":"FLUSHALL"}`}, + {"cache", "execute-command", `{"command":"GET 中文"}`}, + {"cache", "reset-password", `{"password":"alllowercase"}`}, + {"functions", "create-alias", `{"name":"my-alias","functionVersion":"1","routingConfig":{"1":80,"2":80}}`}, + {"functions", "create-layer-version", `{"compatibleRuntimes":["nodejs14.x"],"sharedScope":0,"zipFile":"not-a-zip"}`}, + {"functions", "create-cron-trigger", `{"funcId":"id","triggerType":"Cron","triggerMode":"ASync","triggerSwitch":false,"spec":{"schedule":"@every 0m"}}`}, + {"clouddb", "create-object-type", `{"objectType":{"objectTypeName":"Thing","fields":[{"fieldName":"id","fieldType":"Boolean","belongPrimaryKey":true}]}}`}, + } + for _, c := range cases { + t.Run(c.family+"/"+c.id, func(t *testing.T) { + e, ok := domain.EndpointByID(c.family, c.id) + if !ok { + t.Fatal("operation absent") + } + if err := ValidateEndpointRequest(e, nil, nil, []byte(c.body)); err == nil { + t.Fatal("invalid documented content accepted") + } + }) + } +} diff --git a/pkg/agcapi/multipart_fields_test.go b/pkg/agcapi/multipart_fields_test.go new file mode 100644 index 0000000..ccf30b2 --- /dev/null +++ b/pkg/agcapi/multipart_fields_test.go @@ -0,0 +1,35 @@ +package agcapi + +import ( + "encoding/json" + "github.com/Createitv/agc-cli/pkg/domain" + "testing" +) + +func TestMultipartFieldsEncodeDocumentedNumberedObjects(t *testing.T) { + for _, tc := range []struct{ id, value string }{{"obbfile-uploadurl", `{"length":1,"sha256":"fixture"}`}, {"obbfile-compose", `{"partObjectId":"fixture","etag":"fixture"}`}} { + e, _ := domain.EndpointByID("upload", tc.id) + body, err := MarshalEndpointFields(e, map[string]string{"additionalProp1": tc.value}) + if err != nil { + t.Fatal(err) + } + var fields map[string]any + if json.Unmarshal(body, &fields) != nil { + t.Fatal("invalid JSON") + } + if _, ok := fields["additionalProp1"].(map[string]any); !ok { + t.Fatalf("numbered part was encoded as a string: %s", body) + } + } +} + +func TestMultipartFieldsReturnSpecificMissingPartFields(t *testing.T) { + for _, tc := range []struct{ id, value, field string }{{"obbfile-uploadurl", `{"sha256":"fixture"}`, "body.additionalProp1.length"}, {"obbfile-compose", `{"partObjectId":"fixture"}`, "body.additionalProp1.etag"}} { + e, _ := domain.EndpointByID("upload", tc.id) + _, err := MarshalEndpointFields(e, map[string]string{"additionalProp1": tc.value}) + problem, ok := err.(*RequestValidationError) + if !ok || len(problem.Violations) == 0 || problem.Violations[0].Field != tc.field || problem.Violations[0].SourceURL == "" { + t.Fatalf("missing actionable part feedback: %v", err) + } + } +} diff --git a/pkg/agcapi/multipart_validation_test.go b/pkg/agcapi/multipart_validation_test.go new file mode 100644 index 0000000..57e01bb --- /dev/null +++ b/pkg/agcapi/multipart_validation_test.go @@ -0,0 +1,31 @@ +package agcapi + +import ( + "github.com/Createitv/agc-cli/pkg/domain" + "testing" +) + +func TestMultipartInitEnforcesOfficialOBBBranches(t *testing.T) { + e, _ := domain.EndpointByID("upload", "obbfile-init") + for _, c := range []struct { + name string + query map[string]string + invalid bool + }{ + {"default OBB needs subtype", map[string]string{}, true}, + {"explicit OBB needs subtype", map[string]string{"fileType": "2"}, true}, + {"APP forbids OBB subtype", map[string]string{"fileType": "1", "obbType": "1"}, true}, + {"APK forbids OBB subtype", map[string]string{"fileType": "3", "obbType": "2"}, true}, + {"default OBB with subtype", map[string]string{"obbType": "1"}, false}, + {"APP without subtype", map[string]string{"fileType": "1"}, false}, + } { + t.Run(c.name, func(t *testing.T) { + c.query["appId"] = "fixture" + c.query["fileName"] = "fixture.app" + err := ValidateEndpointRequest(e, c.query, nil, nil) + if (err != nil) != c.invalid { + t.Fatalf("invalid=%v, got %v", c.invalid, err) + } + }) + } +} diff --git a/pkg/agcapi/offline_process_test.go b/pkg/agcapi/offline_process_test.go new file mode 100644 index 0000000..f16df23 --- /dev/null +++ b/pkg/agcapi/offline_process_test.go @@ -0,0 +1,9 @@ +package agcapi + +import ( + "github.com/Createitv/agc-cli/internal/managementtest" + "os" + "testing" +) + +func TestMain(m *testing.M) { managementtest.ExitIfHDCStub(); os.Exit(m.Run()) } diff --git a/pkg/agcapi/pms_resource_upload.go b/pkg/agcapi/pms_resource_upload.go new file mode 100644 index 0000000..bedc6ce --- /dev/null +++ b/pkg/agcapi/pms_resource_upload.go @@ -0,0 +1,78 @@ +package agcapi + +import ( + "encoding/json" + "fmt" + "io" + "mime" + "mime/multipart" + "net/textproto" + "os" + "path/filepath" + "sort" +) + +// Spool multipart data to a temporary file so large uploads do not accumulate +// in memory. The caller owns closing and removing the returned file. +func preparePMSResourceUpload(path string, body []byte) (result *os.File, size int64, contentType string, err error) { + input, err := os.Open(path) + if err != nil { + return nil, 0, "", fmt.Errorf("open upload file: %w", err) + } + defer input.Close() + info, err := input.Stat() + if err != nil { + return nil, 0, "", err + } + if !info.Mode().IsRegular() { + return nil, 0, "", fmt.Errorf("upload file must be a regular file") + } + var fields map[string]string + if err = json.Unmarshal(body, &fields); err != nil || fields == nil { + return nil, 0, "", fmt.Errorf("multipart resource fields must be a JSON object of strings") + } + result, err = os.CreateTemp("", "agc-resource-upload-*") + if err != nil { + return nil, 0, "", err + } + defer func() { + if err != nil { + result.Close() + os.Remove(result.Name()) + } + }() + writer := multipart.NewWriter(result) + keys := make([]string, 0, len(fields)) + for key := range fields { + keys = append(keys, key) + } + sort.Strings(keys) + for _, key := range keys { + if err = writer.WriteField(key, fields[key]); err != nil { + return + } + } + header := textproto.MIMEHeader{} + header.Set("Content-Disposition", mime.FormatMediaType("form-data", map[string]string{"name": "file", "filename": fields["fileName"]})) + fileType := mime.TypeByExtension(filepath.Ext(path)) + if fileType == "" { + fileType = "application/octet-stream" + } + header.Set("Content-Type", fileType) + var part io.Writer + if part, err = writer.CreatePart(header); err != nil { + return + } + if _, err = io.Copy(part, input); err != nil { + return + } + if err = writer.Close(); err != nil { + return + } + contentType = writer.FormDataContentType() + if size, err = result.Seek(0, io.SeekEnd); err != nil { + return + } + _, err = result.Seek(0, io.SeekStart) + return +} diff --git a/pkg/agcapi/pms_resource_upload_test.go b/pkg/agcapi/pms_resource_upload_test.go new file mode 100644 index 0000000..11ac4c3 --- /dev/null +++ b/pkg/agcapi/pms_resource_upload_test.go @@ -0,0 +1,58 @@ +package agcapi + +import ( + "context" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestPMSResourceSendsDocumentedMultipartFile(t *testing.T) { + file := filepath.Join(t.TempDir(), "素材.png") + if err := os.WriteFile(file, []byte("offline-image-bytes"), 0600); err != nil { + t.Fatal(err) + } + called := false + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + if r.Header.Get("appId") != "dedicated" { + t.Error("missing appId header") + } + if err := r.ParseMultipartForm(1024); err != nil { + t.Errorf("not multipart: %v", err) + return + } + defer r.MultipartForm.RemoveAll() + for key, want := range map[string]string{"requestId": "fixture", "fileType": "1", "zoneId": "1", "fileName": "素材.png"} { + if r.FormValue(key) != want { + t.Errorf("wrong %s", key) + } + } + f, h, err := r.FormFile("file") + if err != nil { + t.Error(err) + return + } + defer f.Close() + data, _ := io.ReadAll(f) + if string(data) != "offline-image-bytes" || h.Filename != "素材.png" { + t.Error("file bytes or filename changed") + } + w.Header().Set("Content-Type", "application/json") + io.WriteString(w, `{"error":{"errorCode":0},"resourceId":"fixture"}`) + })) + defer server.Close() + e, _ := domain.EndpointByID("pms", "resourcemanage-harmonyosnext") + _, err := InvokeEndpoint(context.Background(), server.Client(), InvokeRequest{Endpoint: e, BaseURL: server.URL, FilePath: file, Headers: map[string]string{"appId": "dedicated"}, Body: []byte(`{"requestId":"fixture","fileType":"1","zoneId":"1","fileName":"素材.png"}`)}) + if err != nil { + t.Fatal(err) + } + if !called { + t.Fatal("multipart request not sent") + } +} diff --git a/pkg/agcapi/prefetch_device.go b/pkg/agcapi/prefetch_device.go new file mode 100644 index 0000000..3ca5357 --- /dev/null +++ b/pkg/agcapi/prefetch_device.go @@ -0,0 +1,45 @@ +package agcapi + +import ( + "context" + "encoding/json" + "os/exec" + "strings" +) + +func invokePrefetchDevice(ctx context.Context, req InvokeRequest) (InvokeResponse, error) { + out := InvokeResponse{Method: req.Endpoint.Method, URL: req.Endpoint.Path, DryRun: req.DryRun} + var p struct { + BundleName string `json:"bundleName"` + DeviceID string `json:"deviceId"` + HDCPath string `json:"hdcPath"` + } + if json.Unmarshal(req.Body, &p) != nil || p.BundleName == "" || p.DeviceID == "" { + return out, uploadIssue(req.Endpoint, "body.bundleName", "Provide bundleName and an explicitly selected deviceId for cf_prefetch getcache.") + } + if req.DryRun { + return out, nil + } + if p.HDCPath == "" { + p.HDCPath = "hdc" + } + command := exec.CommandContext(ctx, p.HDCPath, "-t", p.DeviceID, "shell", "cf_prefetch", "getcache", "-m", p.BundleName) + data, err := command.CombinedOutput() + if len(data) > 8<<20 { + return out, uploadIssue(req.Endpoint, "response.body", "Device debug output exceeds the 8 MiB local limit.") + } + for code, message := range map[string]string{"1008200005": "Periodic prefetch failed; check device connectivity, prefetch configuration and mainland China function region.", "1008200009": "Device prefetch tool internal error; contact Huawei support.", "1008240000": "Install a debug HAP signed with a debugging certificate.", "1008240007": "Check the application's registered bundle name and HAP information."} { + if strings.Contains(string(data), code) { + b, _ := json.Marshal(map[string]string{"code": code, "message": message}) + return out, ParseAGCError(200, b) + } + } + if err != nil { + return out, uploadIssue(req.Endpoint, "body.hdcPath", "hdc did not complete; verify the executable path, explicit deviceId, device connection and debug-HAP prerequisites.") + } + out.StatusCode = 200 + out.ContentType = "application/json" + out.Body, _ = json.Marshal(map[string]any{"commandCompleted": true, "dataFreshnessVerified": false, "output": string(data), "note": "Compare fetch data timestamp with the current run; an old timestamp means the latest fetch failed."}) + out.RawBody = out.Body + return out, nil +} diff --git a/pkg/agcapi/prefetch_device_test.go b/pkg/agcapi/prefetch_device_test.go new file mode 100644 index 0000000..337c525 --- /dev/null +++ b/pkg/agcapi/prefetch_device_test.go @@ -0,0 +1,41 @@ +package agcapi + +import ( + "context" + "encoding/json" + "github.com/Createitv/agc-cli/internal/managementtest" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestPrefetchDeviceUsesExplicitDeviceWithoutShellInterpolation(t *testing.T) { + e, ok := domain.EndpointByID("prefetch", "device-getcache") + if !ok { + t.Fatal("documented device command missing") + } + p := managementtest.HDCFile(t) + b, _ := json.Marshal(map[string]string{"bundleName": "com.example.offline", "deviceId": "offline-device", "hdcPath": p}) + got, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Body: b}) + if err != nil { + t.Fatal(err) + } + if !strings.Contains(string(got.Body), `-t\noffline-device\nshell\ncf_prefetch\ngetcache\n-m\ncom.example.offline\n`) { + t.Fatalf("wrong hdc argv %s", got.Body) + } + if !strings.Contains(string(got.Body), `"dataFreshnessVerified":false`) { + t.Fatal("command success was misreported as fresh device data") + } +} + +func TestPrefetchDeviceDryRunNeverExecutesHDC(t *testing.T) { + e, ok := domain.EndpointByID("prefetch", "device-getcache") + if !ok { + t.Fatal("device operation missing") + } + _, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Body: []byte(`{"bundleName":"com.example.offline","deviceId":"offline-device","hdcPath":"/must-not-execute"}`), DryRun: true}) + if err != nil { + t.Fatal(err) + } +} diff --git a/pkg/agcapi/prefetch_transport_test.go b/pkg/agcapi/prefetch_transport_test.go new file mode 100644 index 0000000..829b6da --- /dev/null +++ b/pkg/agcapi/prefetch_transport_test.go @@ -0,0 +1,32 @@ +package agcapi + +import ( + "context" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestPrefetchJSONIsApplicationDataAndNeverReceivesDeveloperAuthorization(t *testing.T){ + data:=`{"code":17,"ret":{"code":23},"resources":["image.png"]}` + srv:=httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter,r *http.Request){ + if r.Method!="GET"||r.URL.Query().Get("appId")!="offline-app"||r.URL.Query().Get("params")!="{\"hello\":\"world\"}"{t.Error("prefetch request changed")} + if r.Header.Get("Authorization")!=""||r.Header.Get("Cookie")!=""{t.Error("developer credentials reached callback")} + io.WriteString(w,data) + }));defer srv.Close() + e,_:=domain.EndpointByID("prefetch","fetch-periodic") + result,err:=InvokeEndpoint(context.Background(),nil,InvokeRequest{Endpoint:e,Params:map[string]string{"callbackUrl":srv.URL},Query:map[string]string{"appId":"offline-app","params":`{"hello":"world"}`,"token":"private-user-token"},AccessToken:"must-not-forward"}) + if err!=nil||string(result.RawBody)!=data{t.Fatalf("application data changed: %v %s",err,result.RawBody)} + if strings.Contains(result.URL,"private-user-token"){t.Fatal("prefetch user token exposed in feedback URL")} +} + +func TestPrefetchInstallRejectsResponseBeyondTwoMiB(t *testing.T){ + srv:=httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter,r *http.Request){io.WriteString(w,strings.Repeat("x",(2<<20)+1))}));defer srv.Close() + e,_:=domain.EndpointByID("prefetch","fetch-install") + _,err:=InvokeEndpoint(context.Background(),nil,InvokeRequest{Endpoint:e,Params:map[string]string{"callbackUrl":srv.URL},Query:map[string]string{"appId":"offline-app"}}) + if err==nil{t.Fatal("oversized install prefetch accepted")} +} diff --git a/pkg/agcapi/publishing_agreement_validation_test.go b/pkg/agcapi/publishing_agreement_validation_test.go new file mode 100644 index 0000000..ff29401 --- /dev/null +++ b/pkg/agcapi/publishing_agreement_validation_test.go @@ -0,0 +1,51 @@ +package agcapi + +import ( + "errors" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +// Independent expectations from the AgreementInfo and AgreementBaseInfo +// official pages, rather than fixtures generated from the endpoint registry. +func TestPublishingAgreementNestedRequirements(t *testing.T) { + for _, id := range []string{"user-agreement-create", "user-agreement-update", "privacy-agreement-update"} { + for _, tc := range []struct{ name, item, field string }{ + {"language-required", `{}`, "body.agreementInfos[0].lang"}, + {"language-enum", `{"lang":"zh-CN"}`, "body.agreementInfos[0].lang"}, + {"base-name-required", `{"lang":"zh","baseInfo":{}}`, "body.agreementInfos[0].baseInfo.name"}, + {"base-name-length", `{"lang":"zh","baseInfo":{"name":"` + strings.Repeat("界", 101) + `"}}`, "body.agreementInfos[0].baseInfo.name"}, + } { + t.Run(id+"/"+tc.name, func(t *testing.T) { + e, _ := domain.EndpointByID("publishing", id) + err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(`{"id":"fixture","type":2,"agreementInfos":[`+tc.item+`]}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("expected nested violation, got %v", err) + } + for _, v := range detail.Violations { + if v.Field == tc.field && v.SourceURL != "" && v.Suggestion != "" { + return + } + } + t.Fatalf("missing sourced violation for %s: %+v", tc.field, detail.Violations) + }) + } + } +} + +func TestPublishingAgreementOptionalBaseInfo(t *testing.T) { + for _, id := range []string{"user-agreement-create", "user-agreement-update", "privacy-agreement-update"} { + e, _ := domain.EndpointByID("publishing", id) + for _, body := range []string{ + `{"id":"fixture","type":2,"agreementInfos":[{"lang":"zh"}]}`, + `{"id":"fixture","type":2,"agreementInfos":[{"lang":"zh-Hant-TW","baseInfo":{"name":"测试协议"}}]}`, + } { + if err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(body)); err != nil { + t.Fatalf("%s: %v", id, err) + } + } + } +} diff --git a/pkg/agcapi/publishing_legacy_enum_validation_test.go b/pkg/agcapi/publishing_legacy_enum_validation_test.go new file mode 100644 index 0000000..b14f93f --- /dev/null +++ b/pkg/agcapi/publishing_legacy_enum_validation_test.go @@ -0,0 +1,64 @@ +package agcapi + +import ( + "encoding/json" + "github.com/Createitv/agc-cli/pkg/domain" + "testing" +) + +func TestLegacyAppInfoRejectsValuesOutsideOfficialEnums(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "app-info-update") + for _, body := range []string{`{"privacyPolicy":"https://example.com/privacy","registeredDclType":-1}`, `{"privacyPolicy":"https://example.com/privacy","registeredIdType":-1}`, `{"privacyPolicy":"https://example.com/privacy","isFree":1}`} { + if err := ValidateEndpointRequest(e, map[string]string{"appId": "dedicated"}, nil, []byte(body)); err != nil { + t.Fatalf("documented value rejected: %v", err) + } + } + for _, name := range []string{"releaseType", "appNetType", "isFree", "isAppForcedUpdate", "hispaceAutoDown", "familyShareTag", "webGameFlag", "registeredDclType", "registeredIdType", "registeredEntity", "encrypted"} { + t.Run(name, func(t *testing.T) { + query := map[string]string{"appId": "dedicated"} + body := map[string]any{"privacyPolicy": "https://example.com/privacy"} + field := "body." + name + if name == "releaseType" { + query[name] = "999" + field = "query." + name + } else { + body[name] = 999 + } + data, _ := json.Marshal(body) + err := ValidateEndpointRequest(e, query, nil, data) + invalid, ok := err.(*RequestValidationError) + if !ok { + t.Fatalf("undocumented value accepted: %v", err) + } + for _, v := range invalid.Violations { + if v.Field == field && v.Code == "enum" && v.SourceURL != "" { + return + } + } + t.Fatalf("missing sourced enum violation for %s: %v", field, invalid.Violations) + }) + } +} + +func TestLegacyAppInfoRequiresDocumentedConditionalFields(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "app-info-update") + for _, tc := range []struct{ body, field string }{ + {`{"privacyPolicy":"https://example.com/privacy","isFree":0}`, "body.price"}, + {`{"privacyPolicy":"https://example.com/privacy","isFree":0,"price":"{}"}`, "body.priceDetail"}, + {`{"privacyPolicy":"https://example.com/privacy","registeredDclType":0}`, "body.registeredEntity"}, + {`{"privacyPolicy":"https://example.com/privacy","registeredDclType":0,"registeredEntity":1}`, "body.registeredEntityName"}, + } { + err := ValidateEndpointRequest(e, map[string]string{"appId": "dedicated"}, nil, []byte(tc.body)) + invalid, ok := err.(*RequestValidationError) + if !ok { + t.Fatalf("missing conditional field %s accepted: %v", tc.field, err) + } + found := false + for _, v := range invalid.Violations { + found = found || v.Field == tc.field && v.SourceURL != "" + } + if !found { + t.Errorf("missing sourced correction for %s: %v", tc.field, invalid.Violations) + } + } +} diff --git a/pkg/agcapi/publishing_metadata_validation_test.go b/pkg/agcapi/publishing_metadata_validation_test.go new file mode 100644 index 0000000..f1b745f --- /dev/null +++ b/pkg/agcapi/publishing_metadata_validation_test.go @@ -0,0 +1,44 @@ +package agcapi + +import ( + "errors" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +// These failures follow CustInfo, DeviceTypeInfo and AppReviewContact, +// independently of the top-level Publishing registry. +func TestPublishingMetadataNestedModels(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "app-info-update-v3") + for _, tc := range []struct{ name, fields, path string }{ + {"device-required", `"deviceTypes":[{}]`, "body.deviceTypes[0].deviceType"}, + {"device-enum", `"deviceTypes":[{"deviceType":1}]`, "body.deviceTypes[0].deviceType"}, + {"device-integer", `"deviceTypes":[{"deviceType":"4"}]`, "body.deviceTypes[0].deviceType"}, + {"customer-phone", `"customInfo":{"phone":"` + strings.Repeat("1", 51) + `"}`, "body.customInfo.phone"}, + {"review-contact", `"appReviewEmailInfo":{"account":"` + strings.Repeat("a", 501) + `"}`, "body.appReviewEmailInfo.account"}, + } { + t.Run(tc.name, func(t *testing.T) { + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"publishCountry":"CN","encrypted":0,`+tc.fields+`}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("expected nested violation, got %v", err) + } + for _, v := range detail.Violations { + if v.Field == tc.path && v.SourceURL != "" { + return + } + } + t.Fatalf("missing source-based violation %s: %+v", tc.path, detail.Violations) + }) + } +} + +func TestPublishingMetadataDocumentedDeviceValues(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "app-info-update-v3") + body := []byte(`{"publishCountry":"CN","encrypted":0,"deviceTypes":[{"deviceType":4,"appAdapters":"5"},{"deviceType":8,"remoteControl":"1"},{"deviceType":19}],"customInfo":{},"appReviewEmailInfo":{}}`) + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, body); err != nil { + t.Fatal(err) + } +} diff --git a/pkg/agcapi/publishing_privacy_models_test.go b/pkg/agcapi/publishing_privacy_models_test.go new file mode 100644 index 0000000..d65f7a3 --- /dev/null +++ b/pkg/agcapi/publishing_privacy_models_test.go @@ -0,0 +1,120 @@ +package agcapi + +import ( + "encoding/json" + "errors" + "fmt" + "os" + "strconv" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +// Body shapes are captured from the official HarmonyOS/atomic-service request +// examples. IDs/contact values are replaced with offline fixtures; the model +// nesting, explicit empty optional arrays/objects and boolean types are kept. +func TestPublishingPrivacyOfficialRequestExamples(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "privacy-agreement-update") + for _, kind := range []string{"harmonyos", "atomic"} { + t.Run(kind, func(t *testing.T) { + body, err := os.ReadFile("testdata/privacy-" + kind + "-request.json") + if err != nil { + t.Fatal(err) + } + if err = ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, body); err != nil { + t.Fatal(err) + } + }) + } +} + +// Expectations are independent of the registry and come from the reviewed +// SceneItem, DataItem, ThirdSdkInfo, DevicePermission and ExtendInfo pages. +func TestPublishingPrivacyDeepViolations(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "privacy-agreement-update") + tooManySDKs, _ := json.Marshal(make([]map[string]any, 51)) + tooManyChapters, _ := json.Marshal(make([]map[string]any, 6)) + for _, tc := range []struct{ name, fields, field, source string }{ + {"personal-object", `"personalInfo":"invalid"`, "personalInfo", "agreementinfo-privacy"}, + {"sensitive-enum", `"personalInfo":{"requiredInfo":{"sceneItems":[{"dataItems":[{"sensitiveData":2}]}]}}`, "personalInfo.requiredInfo.sceneItems[0].dataItems[0].sensitiveData", "dataitem"}, + {"data-id-bound", `"personalInfo":{"adsInfo":{"sceneItems":[{"dataItems":[{"itemId":"` + strings.Repeat("x", 65) + `"}]}]}}`, "personalInfo.adsInfo.sceneItems[0].dataItems[0].itemId", "dataitem"}, + {"sdk-array-limit", `"thirdSdkInfo":{"sdkInfos":` + string(tooManySDKs) + `}`, "thirdSdkInfo.sdkInfos", "thirdsdkinfo"}, + {"sdk-label-shape", `"thirdSdkInfo":{"sdkInfos":[{"privacyLabels":["invalid"]}]}`, "thirdSdkInfo.sdkInfos[0].privacyLabels[0]", "sdkinfo"}, + {"sdk-purpose-bound", `"thirdSdkInfo":{"sdkInfos":[{"purpose":"` + strings.Repeat("x", 501) + `"}]}`, "thirdSdkInfo.sdkInfos[0].purpose", "sdkinfo"}, + {"permission-minimum", `"devicePermissions":[{"permissions":[]}]`, "devicePermissions[0].permissions", "devicepermission"}, + {"permission-desc-bound", `"devicePermissions":[{"permissions":[{"permissionDesc":"` + strings.Repeat("x", 501) + `"}]}]`, "devicePermissions[0].permissions[0].permissionDesc", "data-permission"}, + {"shared-url-bound", `"thirdSharedInfos":[{"officialPrivacyUrl":"` + strings.Repeat("x", 1025) + `"}]`, "thirdSharedInfos[0].officialPrivacyUrl", "thirdsharedinfo"}, + {"cross-border-boolean", `"extInfo":{"storageInfo":{"isCrossBorder":"true"}}`, "extInfo.storageInfo.isCrossBorder", "storageinfo"}, + {"contact-phone-bound", `"extInfo":{"contactInfo":{"phoneNum":["` + strings.Repeat("x", 32) + `"]}}`, "extInfo.contactInfo.phoneNum[0]", "contactinfo"}, + {"custom-chapter-limit", `"extInfo":{"customInfo":{"customInfos":` + string(tooManyChapters) + `}}`, "extInfo.customInfo.customInfos", "data-custominfo"}, + } { + t.Run(tc.name, func(t *testing.T) { + err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(`{"id":"fixture","agreementInfos":[{"lang":"zh",`+tc.fields+`}]}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("expected deep input violation, got %v", err) + } + want := "body.agreementInfos[0]." + tc.field + for _, v := range detail.Violations { + if v.Field == want && strings.Contains(v.SourceURL, tc.source) && v.Suggestion != "" { + return + } + } + t.Fatalf("missing source-based violation %s: %+v", want, detail.Violations) + }) + } +} + +func TestPublishingPrivacyDeepValidInputs(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "privacy-agreement-update") + for _, fields := range []string{ + `"personalInfo":{},"thirdSdkInfo":{},"extInfo":{}`, + `"personalInfo":{"requiredInfo":{"sceneItems":[{"dataItems":[{"itemId":"device-id","sensitiveData":1}]}]}},"devicePermissions":[{"permissions":[{"permissionName":"ohos.permission.CAMERA"}]}]`, + `"thirdSdkInfo":{"sdkInfos":[{"name":"fixture-sdk","privacyLabels":[{"sceneReason":"同步数据","dataItems":[{"sensitiveData":0}]}]}]},"thirdSharedInfos":[{"name":"fixture-provider","dataItems":[{}]}]`, + `"extInfo":{"storageInfo":{"isCrossBorder":false,"storagePeriod":"-1"},"contactInfo":{"phoneNum":["0086-13700000000"]},"customInfo":{"customInfos":[{"title":"补充条款"}]}}`, + } { + body := []byte(`{"id":"fixture","agreementInfos":[{"lang":"zh",` + fields + `}]}`) + if err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, body); err != nil { + t.Fatal(err) + } + } +} + +func TestPublishingPrivacySceneArrayBoundaries(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "privacy-agreement-update") + for _, tc := range []struct{ name, pattern, path string }{ + {"request-scenes", `"personalInfo":{"requiredInfo":{"sceneItems":%s}}`, "personalInfo.requiredInfo.sceneItems"}, + {"sdk-scenes", `"thirdSdkInfo":{"sdkInfos":[{"privacyLabels":%s}]}`, "thirdSdkInfo.sdkInfos[0].privacyLabels"}, + {"shared-data", `"thirdSharedInfos":[{"dataItems":%s}]`, "thirdSharedInfos[0].dataItems"}, + } { + for _, size := range []int{200, 201} { + t.Run(tc.name+"/"+strconv.Itoa(size), func(t *testing.T) { + items := make([]map[string]any, size) + for i := range items { + items[i] = map[string]any{} + } + array, _ := json.Marshal(items) + body := []byte(`{"id":"fixture","agreementInfos":[{"lang":"zh",` + fmt.Sprintf(tc.pattern, array) + `}]}`) + err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, body) + if size == 200 { + if err != nil { + t.Fatal(err) + } + return + } + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("201 entries must fail: %v", err) + } + for _, v := range detail.Violations { + if v.Field == "body.agreementInfos[0]."+tc.path && v.Code == "array_length" { + return + } + } + t.Fatalf("array bound not reported: %+v", detail.Violations) + }) + } + } +} diff --git a/pkg/agcapi/publishing_qualification_test.go b/pkg/agcapi/publishing_qualification_test.go new file mode 100644 index 0000000..8a410df --- /dev/null +++ b/pkg/agcapi/publishing_qualification_test.go @@ -0,0 +1,79 @@ +package agcapi + +import ( + "errors" + "fmt" + "strings" + "testing" + "time" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestPublishingQualificationModels(t *testing.T) { + for _, tc := range []struct{ id, body, path string }{ + {"qualification-review-create", `{"tagQualInfos":[{}]}`, "body.tagQualInfos[0].tagId"}, + {"qualification-review-update", `{"tagQualInfos":[{"tagId":"fixture"}]}`, "body.tagQualInfos[0].taskId"}, + {"qualification-review-create", `{"tagQualInfos":[{"tagId":"fixture","qualificationInfos":[{"validityType":1}]}]}`, "body.tagQualInfos[0].qualificationInfos[0].qualificationCode"}, + {"qualification-review-create", `{"tagQualInfos":[{"tagId":"fixture","qualificationInfos":[{"qualificationCode":"10023","validityType":1}]}]}`, "body.tagQualInfos[0].qualificationInfos[0].qualificationFileInfos"}, + {"qualification-review-create", `{"tagQualInfos":[{"tagId":"fixture","qualificationInfos":[{"qualificationCode":"10023","validityType":1,"qualificationFileInfos":[{}]}]}]}`, "body.tagQualInfos[0].qualificationInfos[0].qualificationFileInfos[0].objectId"}, + {"qualification-review-create", `{"tagQualInfos":[{"tagId":"fixture","qualificationInfos":[{"qualificationCode":"10023","validityType":2,"qualificationFileInfos":[]}]}]}`, "body.tagQualInfos[0].qualificationInfos[0].validityType"}, + {"app-info-update-v3", `{"publishCountry":"CN","encrypted":0,"versionVocs":[{"versionId":"fixture","packageId":"fixture"}]}`, "body.versionVocs[0].vocId"}, + } { + t.Run(tc.id+"/"+tc.path, func(t *testing.T) { + e, _ := domain.EndpointByID("publishing", tc.id) + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, map[string]string{"appId": "fixture"}, []byte(tc.body)) + var feedback *RequestValidationError + if !errors.As(err, &feedback) { + t.Fatalf("expected documented nested error, got %v", err) + } + for _, v := range feedback.Violations { + if v.Field == tc.path && v.SourceURL != "" && v.Suggestion != "" { + return + } + } + t.Fatalf("missing field %s: %+v", tc.path, feedback.Violations) + }) + } +} + +func TestPublishingQualificationDateRules(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "qualification-review-create") + today := time.Now().UTC().Truncate(24 * time.Hour) + for _, tc := range []struct { + name, date string + valid bool + }{ + {"empty-date", "", false}, + {"calendar-date", "2026-02-30", false}, + {"wrong-format", "20260510", false}, + {"thirty-days", today.AddDate(0, 0, 30).Format("2006-01-02"), false}, + {"thirty-one-days", today.AddDate(0, 0, 31).Format("2006-01-02"), true}, + } { + t.Run(tc.name, func(t *testing.T) { + body := fmt.Sprintf(`{"tagQualInfos":[{"tagId":"fixture","qualificationInfos":[{"qualificationCode":"10023","validityType":0,"expireTime":"%s","qualificationFileInfos":[{"objectId":"fixture","fileName":"fixture.pdf","fileSize":10,"sha256":"fixture"}]}]}]}`, tc.date) + err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(body)) + if tc.valid { + if err != nil { + t.Fatal(err) + } + return + } + var feedback *RequestValidationError + if !errors.As(err, &feedback) { + t.Fatalf("date should fail: %v", err) + } + for _, v := range feedback.Violations { + if strings.HasSuffix(v.Field, ".expireTime") && strings.Contains(v.SourceURL, "data-qualificationinfo") { + return + } + } + t.Fatalf("missing expiry violation: %+v", feedback.Violations) + }) + } + // Dates are optional in the model table; do not turn a permanent validity + // branch into an unconditional request for startTime/expireTime. + if err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(`{"tagQualInfos":[{"tagId":"fixture","qualificationInfos":[{"qualificationCode":"10023","validityType":1,"qualificationFileInfos":[{"objectId":"fixture","fileName":"fixture.pdf","fileSize":10,"sha256":"fixture"}]}]}]}`)); err != nil { + t.Fatal(err) + } +} diff --git a/pkg/agcapi/request_validation.go b/pkg/agcapi/request_validation.go new file mode 100644 index 0000000..e163652 --- /dev/null +++ b/pkg/agcapi/request_validation.go @@ -0,0 +1,491 @@ +package agcapi + +import ( + "encoding/json" + "fmt" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +type RequestValidationError struct{ Violations []domain.InputViolation } + +// ValidateEndpointPathInput shares the source parameter constraints with the +// JSON/query validator, preserving path field names in Agent feedback. +func ValidateEndpointPathInput(e domain.Endpoint, params map[string]string) error { + var fields []domain.Parameter + for _, p := range e.Parameters { + if p.In == "path" { + p.In = "query" + fields = append(fields, p) + } + } + if len(fields) == 0 { + return nil + } + err := ValidateEndpointRequest(domain.Endpoint{Parameters: fields, SourceURL: e.SourceURL}, params, nil, nil) + if invalid, ok := err.(*RequestValidationError); ok { + for i := range invalid.Violations { + invalid.Violations[i].Field = strings.Replace(invalid.Violations[i].Field, "query.", "params.", 1) + invalid.Violations[i].Message = strings.ReplaceAll(invalid.Violations[i].Message, "query.", "params.") + } + } + return err +} + +func (e *RequestValidationError) Error() string { + if len(e.Violations) == 0 { + return "invalid request" + } + return e.Violations[0].Message +} + +func ValidateEndpointRequest(e domain.Endpoint, query, headers map[string]string, body []byte, repeated ...map[string][]string) error { + var object map[string]any + if len(body) > 0 { + decoder := json.NewDecoder(strings.NewReader(string(body))) + decoder.UseNumber() + if err := decoder.Decode(&object); err != nil { + return err + } + } + queryLists := map[string][]string{} + if len(repeated) > 0 { + queryLists = repeated[0] + } + arrayQuery := map[string]bool{} + for _, p := range e.Parameters { + if p.In == "query" && p.Type == "array" { + arrayQuery[p.Name] = true + } + } + value := func(path string) (any, bool) { + pieces := strings.SplitN(path, ".", 2) + if len(pieces) != 2 { + return nil, false + } + switch pieces[0] { + case "body": + var current any = object + for _, name := range strings.Split(pieces[1], ".") { + parent, ok := current.(map[string]any) + if !ok { + return nil, false + } + current, ok = parent[name] + if !ok { + return nil, false + } + } + return current, true + case "query": + name := pieces[1] + if arrayQuery[name] { + entries, ok := queryLists[name] + if !ok { + if text, present := query[name]; present { + entries = []string{text} + ok = true + } + } + if !ok { + return nil, false + } + values := make([]any, len(entries)) + for i, text := range entries { + values[i] = text + } + return values, true + } + v, ok := query[name] + return v, ok + case "header": + for name, v := range headers { + if strings.EqualFold(name, pieces[1]) { + return v, true + } + } + } + return nil, false + } + present := func(path string) bool { + v, ok := value(path) + if !ok || v == nil { + return false + } + switch x := v.(type) { + case string: + return strings.TrimSpace(x) != "" + case []any: + return len(x) > 0 + } + return true + } + var issues []domain.InputViolation + if domain.IsServerlessFamily(e.FamilyID) { + issues = append(issues, serverlessViolations(e, object)...) + issues = append(issues, resumableViolations(e, headers)...) + } + add := func(code, field, message, source, suggestion string) { + if source == "" { + source = e.SourceURL + } + issues = append(issues, domain.InputViolation{Code: code, Field: field, Message: message, SourceURL: source, Suggestion: suggestion}) + } + if e.DynamicBody != nil { + if e.DynamicBody.Required && len(object) == 0 { + add("required", "body", "A numbered part object is required", e.DynamicBody.SourceURL, "Supply additionalProp1 containing the documented part fields.") + } + for name, item := range object { + field := "body." + name + matched, err := regexp.MatchString(e.DynamicBodyKeyPattern, name) + if err != nil || !matched { + add("part_key", field, "Invalid numbered part key", e.DynamicBody.SourceURL, "Use additionalProp1, additionalProp2 and subsequent numbered part keys.") + continue + } + child, ok := item.(map[string]any) + if !ok { + add("object_required", field, field+" must be an object", e.DynamicBody.SourceURL, "Supply a JSON object containing the documented part fields.") + continue + } + encoded, _ := json.Marshal(child) + if err := ValidateEndpointRequest(domain.Endpoint{Parameters: e.DynamicBody.Properties, SourceURL: e.DynamicBody.SourceURL}, nil, nil, encoded); err != nil { + if nested, ok := err.(*RequestValidationError); ok { + for _, issue := range nested.Violations { + issue.Field = field + "." + strings.TrimPrefix(issue.Field, "body.") + issues = append(issues, issue) + } + } + } + } + } + for _, rule := range e.Rules { + if rule.UnlessPresent != "" && present(rule.UnlessPresent) { + continue + } + active := true + if rule.When != nil { + v, ok := value(rule.When.Field) + if !ok && rule.When.Default != "" { + v, ok = rule.When.Default, true + } + active = ok && fmt.Sprint(v) == rule.When.Equals + } + if !active { + continue + } + switch rule.Kind { + case "csv_count": + if !present(rule.Field) { + continue + } + v, _ := value(rule.Field) + entries := strings.Split(fmt.Sprint(v), ",") + invalid := rule.MinItems > 0 && len(entries) < rule.MinItems || rule.MaxItems > 0 && len(entries) > rule.MaxItems + for _, entry := range entries { + invalid = invalid || strings.TrimSpace(entry) == "" + } + if invalid { + add(rule.ID, rule.Field, rule.Message, rule.SourceURL, rule.Suggestion) + } + case "minimum_remaining_days": + if !present(rule.Field) { + continue + } + v, _ := value(rule.Field) + date, err := time.Parse("2006-01-02", fmt.Sprint(v)) + if err != nil { + continue + } // The field's date-format check reports this. + today := time.Now().UTC().Truncate(24 * time.Hour) + if !date.After(today.AddDate(0, 0, rule.MinDays)) { + add(rule.ID, rule.Field, rule.Message, rule.SourceURL, rule.Suggestion) + } + case "forbidden_if": + if present(rule.Field) { + add(rule.ID, rule.Field, rule.Message, rule.SourceURL, rule.Suggestion) + } + case "date_window": + if len(rule.Fields) != 2 { + continue + } + dates := make([]time.Time, 2) + valid := true + for i, field := range rule.Fields { + raw, exists := value(field) + if !exists { + valid = false + continue + } + date, err := time.Parse("20060102", fmt.Sprint(raw)) + if err != nil { + add(rule.ID, field, rule.Message, rule.SourceURL, rule.Suggestion) + valid = false + } else { + dates[i] = date + } + } + if valid && (dates[1].Before(dates[0]) || dates[1].Sub(dates[0]) > time.Duration(rule.MaxDays)*24*time.Hour) { + add(rule.ID, rule.Fields[1], rule.Message, rule.SourceURL, rule.Suggestion) + } + case "equal_length": + if len(rule.Fields) != 2 { + continue + } + length := func(field string) int { + v, ok := value(field) + if !ok { + return 0 + } + if items, ok := v.([]any); ok { + return len(items) + } + return 1 + } + if length(rule.Fields[0]) != length(rule.Fields[1]) { + add(rule.ID, rule.Fields[1], rule.Message, rule.SourceURL, rule.Suggestion) + } + case "required_with": + active := false + for _, field := range rule.Fields { + active = active || present(field) + } + if active && !present(rule.Field) { + add(rule.ID, rule.Field, rule.Message, rule.SourceURL, rule.Suggestion) + } + case "required_if": + if !present(rule.Field) { + add(rule.ID, rule.Field, rule.Message, rule.SourceURL, rule.Suggestion) + } + case "at_most_one": + count := 0 + for _, field := range rule.Fields { + if present(field) { + count++ + } + } + if count > 1 { + add(rule.ID, strings.Join(rule.Fields, "|"), rule.Message, rule.SourceURL, rule.Suggestion) + } + case "at_least_one": + found := false + for _, field := range rule.Fields { + found = found || present(field) + } + if !found { + add(rule.ID, strings.Join(rule.Fields, "|"), rule.Message, rule.SourceURL, rule.Suggestion) + } + } + } + for _, p := range e.Parameters { + if p.In != "body" && p.In != "query" && p.In != "header" { + continue + } + path := p.In + "." + p.Name + if p.In == "query" && p.Type != "array" && len(queryLists[p.Name]) > 1 { + add("scalar_query", path, path+" accepts one query value", p.SourceURL, "Provide this scalar query key once; repeat only documented array parameters.") + } + v, ok := value(path) + if !ok || v == nil { + if p.Required { + add("required", path, path+" is required", p.SourceURL, "Supply this required field in the documented location.") + } + continue + } + if p.In == "body" { + valid := true + switch p.Type { + case "string": + text, ok := v.(string) + valid = ok && (!p.Required || p.AllowEmpty || strings.TrimSpace(text) != "") + case "array": + _, valid = v.([]any) + case "object": + _, valid = v.(map[string]any) + case "integer", "number": + _, valid = v.(json.Number) + case "boolean": + _, valid = v.(bool) + } + if !valid { + add("type", path, path+" must be "+p.Type, p.SourceURL, "Use the documented JSON type for this field.") + continue + } + } + if p.EncodedJSON != nil { + text, ok := v.(string) + var decoded any + decoder := json.NewDecoder(strings.NewReader(text)) + decoder.UseNumber() + if !ok || decoder.Decode(&decoded) != nil || !json.Valid([]byte(text)) { + add("encoded_json", path, path+" must contain valid JSON", p.SourceURL, "Supply the documented JSON array as a string.") + } else { + model := *p.EncodedJSON + model.Name = "value" + model.In = "body" + encoded, _ := json.Marshal(map[string]any{"value": decoded}) + if err := ValidateEndpointRequest(domain.Endpoint{Parameters: []domain.Parameter{model}, SourceURL: p.SourceURL}, nil, nil, encoded); err != nil { + if nested, ok := err.(*RequestValidationError); ok { + for _, issue := range nested.Violations { + issue.Field = path + strings.TrimPrefix(issue.Field, "body.value") + issues = append(issues, issue) + } + } + } + } + } + if child, ok := v.(map[string]any); ok { + if (p.MinProperties > 0 && len(child) < p.MinProperties) || (p.MaxProperties > 0 && len(child) > p.MaxProperties) { + add("object_length", path, path+" violates documented map entry bounds", p.SourceURL, "Supply the documented number of dynamic map entries.") + } + for key, value := range child { + fieldPath := path + "[" + strconv.Quote(key) + "]" + if p.PropertyNamesPattern != "" { + matched, err := regexp.MatchString(p.PropertyNamesPattern, key) + if err != nil || !matched { + add("property_name", fieldPath, "Dynamic map key violates the documented format", p.SourceURL, "Use a documented version or identifier as the map key.") + } + } + if p.AdditionalProperties != nil { + model := *p.AdditionalProperties + model.In = "body" + model.Name = "value" + data, _ := json.Marshal(map[string]any{"value": value}) + if err := ValidateEndpointRequest(domain.Endpoint{Parameters: []domain.Parameter{model}}, nil, nil, data); err != nil { + if invalid, ok := err.(*RequestValidationError); ok { + for _, issue := range invalid.Violations { + issue.Field = fieldPath + strings.TrimPrefix(issue.Field, "body.value") + issues = append(issues, issue) + } + } + } + } + } + } + if child, ok := v.(map[string]any); ok && len(p.Properties) > 0 { + encoded, _ := json.Marshal(child) + if err := ValidateEndpointRequest(domain.Endpoint{Parameters: p.Properties, SourceURL: p.SourceURL}, nil, nil, encoded); err != nil { + if nested, ok := err.(*RequestValidationError); ok { + for _, issue := range nested.Violations { + issue.Field = path + "." + strings.TrimPrefix(issue.Field, "body.") + issues = append(issues, issue) + } + } + } + } + if text, ok := v.(string); ok { + if p.Format == "date" { + if _, err := time.Parse("2006-01-02", text); err != nil { + add("date_format", path, path+" must be a valid yyyy-MM-dd date", p.SourceURL, "Use the documented yyyy-MM-dd format with a real calendar date.") + } + } + if p.Pattern != "" { + matched, err := regexp.MatchString(p.Pattern, text) + if err != nil || !matched { + add("pattern", path, path+" violates the documented field format", p.SourceURL, "Use a value matching the documented pattern: "+p.Pattern) + } + } + length := utf8.RuneCountInString(text) + if p.MaxLength > 0 && length > p.MaxLength { + add("max_length", path, fmt.Sprintf("%s must contain at most %d characters", path, p.MaxLength), p.SourceURL, "Shorten this field to the documented maximum.") + } + if p.MinLength > 0 && length < p.MinLength && !(p.AllowEmpty && length == 0) { + add("min_length", path, fmt.Sprintf("%s must contain at least %d characters when supplied", path, p.MinLength), p.SourceURL, "Provide the documented minimum length or omit the optional field.") + } + } + if items, ok := v.([]any); ok { + for index, item := range items { + valid := true + switch p.ItemsType { + case "string": + _, valid = item.(string) + case "object": + _, valid = item.(map[string]any) + case "integer": + number, ok := item.(json.Number) + valid = ok + if ok { + _, err := number.Int64() + valid = err == nil + } + case "number": + _, valid = item.(json.Number) + case "boolean": + _, valid = item.(bool) + } + itemPath := fmt.Sprintf("%s[%d]", path, index) + if valid && len(p.ItemsEnum) > 0 { + allowed := false + for _, candidate := range p.ItemsEnum { + allowed = allowed || fmt.Sprint(item) == candidate + } + if !allowed { + add("item_enum", itemPath, itemPath+" must be one of "+strings.Join(p.ItemsEnum, ", "), p.SourceURL, "Use a documented array item value: "+strings.Join(p.ItemsEnum, ", ")) + } + } + if !valid { + add("item_type", itemPath, itemPath+" must be "+p.ItemsType, p.SourceURL, "Use the documented JSON type for every array item.") + } + if text, ok := item.(string); ok && p.ItemsPattern != "" { + matched, err := regexp.MatchString(p.ItemsPattern, text) + if err != nil || !matched { + add("item_pattern", itemPath, itemPath+" violates the documented identifier format", p.SourceURL, "Use an identifier matching the documented pattern: "+p.ItemsPattern) + } + } + if text, ok := item.(string); ok && p.ItemsMaxLength > 0 && utf8.RuneCountInString(text) > p.ItemsMaxLength { + add("item_max_length", itemPath, itemPath+" exceeds the documented character limit", p.SourceURL, fmt.Sprintf("Use at most %d characters for this array item.", p.ItemsMaxLength)) + } + } + if len(p.ItemsProperties) > 0 { + for index, item := range items { + child, ok := item.(map[string]any) + if !ok { + add("object_required", fmt.Sprintf("%s[%d]", path, index), path+" entries must be objects", p.SourceURL, "Supply a JSON object for each array entry.") + continue + } + encoded, _ := json.Marshal(child) + childEndpoint := domain.Endpoint{Parameters: p.ItemsProperties, Rules: p.ItemsRules, SourceURL: p.SourceURL} + if err := ValidateEndpointRequest(childEndpoint, nil, nil, encoded); err != nil { + if nested, ok := err.(*RequestValidationError); ok { + for _, issue := range nested.Violations { + issue.Field = fmt.Sprintf("%s[%d].%s", path, index, strings.TrimPrefix(issue.Field, "body.")) + issues = append(issues, issue) + } + } + } + } + } + if (p.MaxItems > 0 && len(items) > p.MaxItems) || (p.MinItems > 0 && len(items) < p.MinItems) { + add("array_length", path, fmt.Sprintf("%s violates documented array length (%d..%d)", path, p.MinItems, p.MaxItems), p.SourceURL, "Adjust the number of array entries to the documented bounds.") + } + } + if p.Type == "integer" { + number, err := strconv.ParseInt(fmt.Sprint(v), 10, 64) + if err != nil { + add("integer_required", path, path+" must be an integer", p.SourceURL, "Use a base-10 integer.") + continue + } + if (p.Minimum != nil && number < *p.Minimum) || (p.Maximum != nil && number > *p.Maximum) { + add("numeric_range", path, path+" is outside the documented range", p.SourceURL, "Use a value within the minimum and maximum listed by --docs.") + } + } + if len(p.Enum) > 0 { + valid := false + for _, allowed := range p.Enum { + valid = valid || fmt.Sprint(v) == allowed + } + if !valid { + add("enum", path, path+" must be one of "+strings.Join(p.Enum, ", "), p.SourceURL, "Use a documented value: "+strings.Join(p.Enum, ", ")) + } + } + } + issues = append(issues, validateManagementContent(e, query, body, object)...) + if len(issues) > 0 { + return &RequestValidationError{Violations: issues} + } + return nil +} diff --git a/pkg/agcapi/request_validation_test.go b/pkg/agcapi/request_validation_test.go new file mode 100644 index 0000000..43bc955 --- /dev/null +++ b/pkg/agcapi/request_validation_test.go @@ -0,0 +1,588 @@ +package agcapi + +import ( + "encoding/json" + "errors" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestProductImportFeedbackIdentifiesNestedInvalidInputs(t *testing.T) { + endpoint, _ := domain.EndpointByID("pms", "batchaddproduct-harmonyosnext") + base := `{"productNo":"fixture","productName":"fixture","productDesc":"fixture","purchaseType":"consumable","defaultLocale":"zh_CN",` + cases := []struct{ name, extra, field string }{ + {"language-length", `"languages":[{"locale":"en_US","productName":"` + strings.Repeat("a", 56) + `","productDesc":"fixture"}]}`, "body.products[0].languages[0].productName"}, + {"price-required", `"defaultPriceInfo":{"country":"CN"}}`, "body.products[0].defaultPriceInfo.currency"}, + {"price-object", `"defaultPriceInfo":"invalid"}`, "body.products[0].defaultPriceInfo"}, + {"language-array", `"languages":"invalid"}`, "body.products[0].languages"}, + {"language-item", `"languages":["invalid"]}`, "body.products[0].languages[0]"}, + {"integer", `"autoAddSaleCountry":"1"}`, "body.products[0].autoAddSaleCountry"}, + {"integer-enum", `"autoAddSaleCountry":2}`, "body.products[0].autoAddSaleCountry"}, + {"required-text", `"reviewNote":"fixture","productName":""}`, "body.products[0].productName"}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + err := ValidateEndpointRequest(endpoint, nil, map[string]string{"appId": "fixture"}, []byte(`{"requestId":"fixture","products":[`+base+tc.extra+`]}`)) + var feedback *RequestValidationError + if !errors.As(err, &feedback) { + t.Fatalf("expected structured invalid-input error, got %v", err) + } + for _, issue := range feedback.Violations { + if issue.Field == tc.field { + if issue.SourceURL == "" || issue.Suggestion == "" { + t.Fatal("missing actionable source guidance") + } + return + } + } + t.Fatalf("missing field %s: %+v", tc.field, feedback.Violations) + }) + } +} + +func TestProductImportValidNestedModelsAreAccepted(t *testing.T) { + endpoint, _ := domain.EndpointByID("pms", "batchaddproduct-harmonyosnext") + body := []byte(`{"requestId":"fixture","products":[{"productNo":"fixture","productName":"fixture","productDesc":"fixture","purchaseType":"auto_subscription","subGroupId":"fixture-group","subPeriod":"1","subPeriodUnit":"M","defaultLocale":"zh_CN","defaultPriceInfo":{"country":"CN","currency":"CNY","price":"199"},"languages":[{"locale":"en_US","productName":"fixture","productDesc":"fixture"}],"autoAddSaleCountry":0}]}`) + if err := ValidateEndpointRequest(endpoint, nil, map[string]string{"appId": "fixture"}, body); err != nil { + t.Fatal(err) + } +} + +func TestReportDateAndFilterRulesUseAllQueryValues(t *testing.T) { + endpoint, _ := domain.EndpointByID("reports", "appdownloadexport") + for _, tc := range []struct { + name, start, end string + conditions, values []string + valid bool + }{ + {"valid", "20260901", "20261001", []string{"countryId", "businessType"}, []string{"CN", "AppGallery"}, true}, + {"invalid-calendar-date", "20260230", "20261001", nil, nil, false}, + {"reversed-date", "20261001", "20260901", nil, nil, false}, + {"too-long", "20260101", "20261001", nil, nil, false}, + {"misaligned-filters", "20260901", "20261001", []string{"countryId", "businessType"}, []string{"CN"}, false}, + } { + t.Run(tc.name, func(t *testing.T) { + q := map[string]string{"language": "en-US", "startTime": tc.start, "endTime": tc.end} + lists := map[string][]string{} + if tc.conditions != nil { + lists["filterCondition"] = tc.conditions + } + if tc.values != nil { + lists["filterConditionValue"] = tc.values + } + err := ValidateEndpointRequest(endpoint, q, nil, nil, lists) + if tc.valid { + if err != nil { + t.Fatal(err) + } + return + } + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("expected documented feedback, got %v", err) + } + for _, issue := range detail.Violations { + if issue.SourceURL == "" || issue.Suggestion == "" { + t.Fatal("missing correction guidance") + } + } + }) + } +} + +func TestDomainNestedInputsFollowOfficialModels(t *testing.T) { + for _, tc := range []struct{ id, body, field string }{ + {"domain-api-precheck", `{"domain":{"type":"httpRequest","value":"https://example.com"}}`, "body.domain.type"}, + {"domain-api-post-domain", `{"domains":[{"type":"unknown","value":"https://example.com"}]}`, "body.domains[0].type"}, + {"domain-api-post-domain", `{"domains":[{"type":"httpRequest"}]}`, "body.domains[0].value"}, + } { + t.Run(tc.id+tc.field, func(t *testing.T) { + e, _ := domain.EndpointByID("domains", tc.id) + err := ValidateEndpointRequest(e, map[string]string{"category": "server"}, map[string]string{"appId": "fixture"}, []byte(tc.body)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("expected model feedback, got %v", err) + } + for _, v := range detail.Violations { + if v.Field == tc.field && v.SourceURL != "" { + return + } + } + t.Fatalf("missing nested source guidance: %+v", detail.Violations) + }) + } +} + +func TestProjectApplicationSelectionAndOAuthTeamRules(t *testing.T) { + app, _ := domain.EndpointByID("projects", "appbriefinfo") + if err := ValidateEndpointRequest(app, nil, map[string]string{"userID": "1", "oauth2Token": "offline-fixture"}, nil); err == nil { + t.Fatal("application query accepted without either documented identity") + } + if err := ValidateEndpointRequest(app, map[string]string{"packageNames": "app.example.fixture"}, map[string]string{"userID": "1", "oauth2Token": "offline-fixture"}, nil); err != nil { + t.Fatal(err) + } + listing, _ := domain.EndpointByID("projects", "queryprojectlist") + if err := ValidateEndpointRequest(listing, nil, nil, nil); err != nil { + t.Fatalf("Service Account branch incorrectly requires OAuth team: %v", err) + } + err := ValidateEndpointRequest(listing, nil, map[string]string{"oauth2Token": "offline-fixture"}, nil) + var feedback *RequestValidationError + if !errors.As(err, &feedback) || feedback.Violations[0].Field != "header.teamId" { + t.Fatalf("missing OAuth team guidance: %v", err) + } + if err := ValidateEndpointRequest(listing, nil, map[string]string{"oauth2Token": "offline-fixture", "teamId": "1"}, nil); err != nil { + t.Fatal(err) + } +} + +func TestProjectFingerprintRejectsDocumentedForbiddenColon(t *testing.T) { + e, _ := domain.EndpointByID("projects", "addappfingerprint") + err := ValidateEndpointRequest(e, nil, map[string]string{"oauth2Token": "offline-fixture", "uid": "1", "teamId": "1"}, []byte(`{"addCertFingerprints":["AA:BB"]}`)) + var feedback *RequestValidationError + if !errors.As(err, &feedback) || feedback.Violations[0].Field != "body.addCertFingerprints[0]" { + t.Fatalf("missing fingerprint correction: %v", err) + } +} + +func TestProvisioningNestedModelsReturnActionableFeedback(t *testing.T) { + for _, tc := range []struct{ id, body, field string }{ + {"provision-api-add-device", `{"deviceList":[{"deviceName":"offline","udid":"offline","deviceType":99}]}`, "body.deviceList[0].deviceType"}, + {"provision-api-applyacl", `{"aclPermissionList":[{"name":"ohos.permission.fixture"}]}`, "body.aclPermissionList[0].reason"}, + {"provision-api-applyacl", `{"aclPermissionList":{"name":"ohos.permission.fixture","reason":"offline"}}`, "body.aclPermissionList"}, + } { + t.Run(tc.id+tc.field, func(t *testing.T) { + e, _ := domain.EndpointByID("provisioning", tc.id) + err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(tc.body)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("expected structured model error, got %v", err) + } + for _, v := range detail.Violations { + if v.Field == tc.field && v.SourceURL != "" && v.Suggestion != "" { + return + } + } + t.Fatalf("missing model field guidance: %+v", detail.Violations) + }) + } +} + +func TestFeedbackDeletionRequiresActualFeedbackIdentifiers(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-delete-feedback") + err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(`{"delFeedBackInfos":[{"problemId":"fixture"}],"deleteMode":1}`)) + var feedback *RequestValidationError + if !errors.As(err, &feedback) { + t.Fatalf("missing feedback model validation: %v", err) + } + if feedback.Violations[0].Field != "body.delFeedBackInfos[0].testerId" || feedback.Violations[0].SourceURL == "" { + t.Fatalf("missing indexed model guidance: %+v", feedback.Violations) + } + if err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(`{"delFeedBackInfos":[{"problemId":"fixture","testerId":"fixture"}],"deleteMode":1}`)); err != nil { + t.Fatal(err) + } +} + +func TestResourceVersionFieldsRemainNested(t *testing.T) { + e, _ := domain.EndpointByID("resources", "respackapi-addversion") + err := ValidateEndpointRequest(e, nil, map[string]string{"requestId": "offline-fixture"}, []byte(`{"resourceVersion":{"appId":"fixture","startTime":1,"endTime":2}}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("missing nested version validation: %v", err) + } + for _, v := range detail.Violations { + if v.Field == "body.resourceVersion.version" && v.SourceURL != "" { + return + } + } + t.Fatalf("missing root-model guidance: %+v", detail.Violations) +} + +func TestCommentReplyTargetsAreMutuallyExclusive(t *testing.T) { + e, _ := domain.EndpointByID("comments", "com-reviewreply") + err := ValidateEndpointRequest(e, nil, map[string]string{"requestId": "offline-fixture"}, []byte(`{"lang":"zh_CN","appId":"fixture","reviewId":"fixture","devReplyContent":"offline","countryCode":"CN","toReplyId":"user-reply","updateReplyId":"developer-reply"}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("conflicting reply targets accepted: %v", err) + } + for _, v := range detail.Violations { + if v.Code == "reply-target-exclusive" && v.SourceURL != "" && v.Suggestion != "" { + return + } + } + t.Fatalf("missing documented target feedback: %+v", detail.Violations) +} + +func TestGameResourceJSONStringValidatesItsInnerModel(t *testing.T) { + e, _ := domain.EndpointByID("gameplay", "resources") + for _, tc := range []struct{ name, resources, field string }{ + {"invalid-json", "not-json", "body.resources"}, + {"missing-upload-url", `[{"index":"offline","name":"offline","type":1,"operType":0,"updateTime":1}]`, "body.resources[0].url"}, + {"invalid-resource-type", `[{"index":"offline","name":"offline","type":99,"operType":1}]`, "body.resources[0].type"}, + } { + t.Run(tc.name, func(t *testing.T) { + body, _ := json.Marshal(map[string]any{"method": "external.hms.gs.syncGameResources", "appId": "fixture", "resources": tc.resources, "ts": 1, "sign": "offline-sign"}) + err := ValidateEndpointRequest(e, nil, nil, body) + var feedback *RequestValidationError + if !errors.As(err, &feedback) { + t.Fatalf("invalid encoded resource accepted: %v", err) + } + for _, v := range feedback.Violations { + if v.Field == tc.field && v.SourceURL != "" { + return + } + } + t.Fatalf("missing resource model field guidance: %+v", feedback.Violations) + }) + } +} + +func TestLegacySubmitPhaseFieldsAreConditional(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "app-submit") + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, nil); err != nil { + t.Fatalf("commercial submit incorrectly requires phase Body: %v", err) + } + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture", "releaseType": "3"}, nil, nil) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatal("phased submit accepted without its required fields") + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == "body.phasedReleaseStartTime" + } + if !found { + t.Fatal("missing phase start correction") + } +} + +func TestPermissionVideoRequiresReviewedObjectIdentifier(t *testing.T) { + e, _ := domain.EndpointByID("publishing", "app-file-info-v3") + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"packagePermissionIntroVideoList":[{"lang":"zh_CN","permissionName":"ohos.permission.fixture","deviceType":4}]}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("permission video accepted without objectId: %v", err) + } + for _, v := range detail.Violations { + if v.Field == "body.packagePermissionIntroVideoList[0].objectId" && v.SourceURL != "" { + return + } + } + t.Fatalf("missing documented model field: %+v", detail.Violations) +} + +func TestTestingLanguageRequiresDescriptionAndTestFeatures(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","languages":[{"language":"zh_CN"}]}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("incomplete test language accepted: %v", err) + } + for _, field := range []string{"body.languages[0].appDesc", "body.languages[0].newFeatures"} { + found := false + for _, v := range detail.Violations { + found = found || v.Field == field + } + if !found { + t.Errorf("missing documented field %s", field) + } + } +} + +func TestTestingDeviceMaterialReportsDocumentedNestedViolations(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","languages":[{"language":"zh_CN","appDesc":"fixture","newFeatures":"fixture","deviceMaterials":[{"deviceType":19,"screenShots":["one","two"],"showType":2}]}]}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("invalid device material accepted: %v", err) + } + for _, field := range []string{"body.languages[0].deviceMaterials[0].deviceType", "body.languages[0].deviceMaterials[0].screenShots", "body.languages[0].deviceMaterials[0].showType"} { + found := false + for _, v := range detail.Violations { + found = found || v.Field == field && strings.Contains(v.SourceURL, "devicematerial") + } + if !found { + t.Errorf("missing source-backed violation for %s: %+v", field, detail.Violations) + } + } +} + +func TestTestingVersionRequiresReviewedDeviceAndTimeFields(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + for _, tc := range []struct{ body, field string }{ + {`{"versionId":"fixture","deviceTypes":[{}]}`, "body.deviceTypes[0].deviceType"}, + {`{"versionId":"fixture","deviceTypes":[{"deviceType":19}]}`, "body.deviceTypes[0].deviceType"}, + {`{"versionId":"fixture","openTestInfo":{"startTime":1704211200000}}`, "body.openTestInfo.endTime"}, + {`{"versionId":"fixture","openTestInfo":{"startTime":"1704211200000","endTime":1704211200000}}`, "body.openTestInfo.startTime"}, + } { + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(tc.body)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("missing nested validation for %s: %v", tc.field, err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == tc.field && v.SourceURL != "" + } + if !found { + t.Errorf("missing field correction %s: %+v", tc.field, detail.Violations) + } + } +} + +func TestTestingPermissionVideoUsesTestingSpecificDeviceEnums(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + for _, tc := range []struct{ video, field string }{ + {`{"lang":"zh_CN","permissionName":"fixture","deviceType":4}`, "objectId"}, + {`{"lang":"zh_CN","permissionName":"fixture","deviceType":19,"objectId":"fixture"}`, "deviceType"}, + } { + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","packagePermissionIntroVideoList":[`+tc.video+`]}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("invalid testing video accepted: %v", err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == "body.packagePermissionIntroVideoList[0]."+tc.field && strings.Contains(v.SourceURL, "test-api-data-packagepermission") + } + if !found { + t.Errorf("missing testing-specific violation: %+v", detail.Violations) + } + } + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","packagePermissionIntroVideoList":[{"lang":"zh_CN","permissionName":"fixture","deviceType":14,"objectId":"fixture"}]}`)); err != nil { + t.Fatal(err) + } +} + +func TestTestingVersionExtensionValidatesReviewedFields(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","extInfo":{"isAiGenerate":1,"aiTypes":[-1,1,2,3,4,5]}}`)); err != nil { + t.Fatalf("documented AI service types rejected: %v", err) + } + for _, tc := range []struct{ ext, field string }{ + {`{"isAiGenerate":1,"aiTypes":[99]}`, "body.extInfo.aiTypes[0]"}, + {`{"encrypted":2}`, "body.extInfo.encrypted"}, + {`{"registeredIdType":0}`, "body.extInfo.registeredIdType"}, + {`{"isAiGenerate":1}`, "body.extInfo.aiTypes"}, + {`{"userAgreementIds":["1","2","3","4","5","6"]}`, "body.extInfo.userAgreementIds"}, + {`{"appReviewPhoneInfo":{"account":1}}`, "body.extInfo.appReviewPhoneInfo.account"}, + } { + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","extInfo":`+tc.ext+`}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("invalid extension accepted for %s: %v", tc.field, err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == tc.field && v.SourceURL != "" + } + if !found { + t.Errorf("missing correction for %s: %+v", tc.field, detail.Violations) + } + } +} + +func TestTestingResolvedIssueRequiresOfficialIdentifiers(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + for _, field := range []string{"versionId", "packageId", "vocId"} { + issue := map[string]any{"versionId": "fixture", "packageId": "fixture", "vocId": "fixture"} + delete(issue, field) + body, _ := json.Marshal(map[string]any{"versionId": "fixture", "versionVocReq": []any{issue}}) + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, body) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("issue without %s accepted: %v", field, err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == "body.versionVocReq[0]."+field && strings.Contains(v.SourceURL, "versionvocreq") + } + if !found { + t.Errorf("missing documented identifier correction: %+v", detail.Violations) + } + } +} + +func TestTestingTaskNestedGroupBindingUsesDocumentedEnum(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","openTestInfo":{"startTime":1704211200000,"endTime":1704211200000,"testTaskInfo":{"groupInfos":[{"bind":0},{"bind":1}],"needShareLink":1,"needNotify":0}}}`)); err != nil { + t.Fatalf("documented task values rejected or optional group identifiers made mandatory: %v", err) + } + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","openTestInfo":{"startTime":1704211200000,"endTime":1704211200000,"testTaskInfo":{"groupInfos":[{"groupId":"fixture","bind":2}],"needShareLink":2}}}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("invalid nested testing task accepted: %v", err) + } + for _, field := range []string{"body.openTestInfo.testTaskInfo.groupInfos[0].bind", "body.openTestInfo.testTaskInfo.needShareLink"} { + found := false + for _, v := range detail.Violations { + found = found || v.Field == field && v.SourceURL != "" + } + if !found { + t.Errorf("missing documented correction for %s: %+v", field, detail.Violations) + } + } +} + +func TestOpenTestLinkOAuthRequiresSelectedTeam(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-create-open-test-link") + for _, headers := range []map[string]string{ + {"Authorization": "Bearer offline-test-token"}, + {"oauth2Token": "offline-test-token", "teamId": "selected-team"}, + } { + if err := ValidateEndpointRequest(e, nil, headers, []byte(`{"groupId":"fixture","limit":1}`)); err != nil { + t.Fatalf("documented authentication branch rejected: %v", err) + } + } + err := ValidateEndpointRequest(e, nil, map[string]string{"oauth2Token": "offline-test-token"}, []byte(`{"groupId":"fixture","limit":1}`)) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("OAuth public link accepted without team: %v", err) + } + for _, v := range detail.Violations { + if v.Field == "header.teamId" && v.SourceURL != "" { + return + } + } + t.Fatalf("missing selected-team correction: %+v", detail.Violations) +} + +func TestTestingOptionalNameRejectsExplicitlyEmptyText(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-modify-test-version") + for _, name := range []string{"", "a"} { + body, _ := json.Marshal(map[string]any{"versionId": "fixture", "languages": []any{map[string]any{"language": "zh_CN", "appName": name, "appDesc": "fixture", "newFeatures": "fixture"}}}) + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, body) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("name below official minimum accepted: %v", err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Code == "min_length" && v.Field == "body.languages[0].appName" && v.SourceURL != "" + } + if !found { + t.Errorf("missing minimum-length correction: %+v", detail.Violations) + } + } + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture"}, nil, []byte(`{"versionId":"fixture","languages":[{"language":"zh_CN","appDesc":"fixture","newFeatures":"fixture"}]}`)); err != nil { + t.Fatalf("omitted optional name rejected: %v", err) + } +} + +func TestResourceUploadRejectsOfficiallyForbiddenFileNameCharacters(t *testing.T) { + e, _ := domain.EndpointByID("resources", "respackapi-uploadapplyfor") + for _, name := range []string{"资源包.apk", "resource-name_1.apk"} { + body, _ := json.Marshal(map[string]any{"appId": "fixture", "versionId": 1, "fileName": name, "fileSHA256": "fixture", "fileLength": 6000000, "fileType": 0}) + if err := ValidateEndpointRequest(e, nil, map[string]string{"requestId": "fixture"}, body); err != nil { + t.Fatalf("valid resource name rejected: %v", err) + } + } + for _, character := range []string{"|", ":", "/", "\\", "*", "?", "\"", "<", ">"} { + body, _ := json.Marshal(map[string]any{"appId": "fixture", "versionId": 1, "fileName": "resource" + character + "file", "fileSHA256": "fixture", "fileLength": 6000000, "fileType": 0}) + err := ValidateEndpointRequest(e, nil, map[string]string{"requestId": "fixture"}, body) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("forbidden filename character %q accepted: %v", character, err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == "body.fileName" && v.SourceURL != "" + } + if !found { + t.Errorf("missing filename correction: %+v", detail.Violations) + } + } +} + +func TestResourceFileQueryEnforcesOfficialCSVLimit(t *testing.T) { + e, _ := domain.EndpointByID("resources", "respackapi-queryfile") + for _, ids := range []string{strings.TrimSuffix(strings.Repeat("fixture,", 501), ","), "fixture,,other"} { + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture", "fileIds": ids}, nil, nil) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("invalid file ID list accepted: %v", err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == "query.fileIds" && v.SourceURL != "" + } + if !found { + t.Errorf("missing CSV guidance: %+v", detail.Violations) + } + } + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture", "fileIds": strings.TrimSuffix(strings.Repeat("fixture,", 500), ",")}, nil, nil); err != nil { + t.Fatalf("documented 500-ID boundary rejected: %v", err) + } +} + +func TestResourceFileQuerySelectsOneDocumentedIdentity(t *testing.T) { + e, _ := domain.EndpointByID("resources", "respackapi-queryfile") + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture", "versionId": "1", "fileIds": "fixture"}, nil, nil) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("both file identities accepted: %v", err) + } + for _, v := range detail.Violations { + if v.Code == "resource-file-identity-exclusive" && v.SourceURL != "" { + return + } + } + t.Fatalf("missing identity selection guidance: %+v", detail.Violations) +} + +func TestProjectApplicationQueryBoundsPackageListWithAppIDPrecedence(t *testing.T) { + e, _ := domain.EndpointByID("projects", "appbriefinfo") + headers := map[string]string{"oauth2Token": "offline-token", "userID": "1"} + list := strings.TrimSuffix(strings.Repeat("com.example.fixture,", 101), ",") + err := ValidateEndpointRequest(e, map[string]string{"packageNames": list}, headers, nil) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("overlong package list accepted: %v", err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == "query.packageNames" && v.SourceURL != "" + } + if !found { + t.Fatalf("missing package-list guidance: %+v", detail.Violations) + } + for _, query := range []map[string]string{{"packageNames": strings.TrimSuffix(strings.Repeat("com.example.fixture,", 100), ",")}, {"appId": "fixture", "packageNames": list}} { + if err := ValidateEndpointRequest(e, query, headers, nil); err != nil { + t.Fatalf("documented boundary or appId precedence rejected: %v", err) + } + } +} + +func TestProjectApplicationQueryUsesOfficialAppTypes(t *testing.T) { + e, _ := domain.EndpointByID("projects", "appbriefinfo") + headers := map[string]string{"oauth2Token": "offline-token", "userID": "1"} + err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture", "appType": "999"}, headers, nil) + var detail *RequestValidationError + if !errors.As(err, &detail) { + t.Fatalf("undefined app type accepted: %v", err) + } + found := false + for _, v := range detail.Violations { + found = found || v.Field == "query.appType" && v.Code == "enum" && v.SourceURL != "" + } + if !found { + t.Fatalf("missing official enum correction: %+v", detail.Violations) + } + for _, typ := range []string{"1", "2", "4", "8", "9", "19", "23", "27", "28", "29", "30", "9998", "9999"} { + if err := ValidateEndpointRequest(e, map[string]string{"appId": "fixture", "appType": typ}, headers, nil); err != nil { + t.Fatalf("official appType %s rejected: %v", typ, err) + } + } +} + +func TestProjectApplicationQueryValidatesEachDistributionStatus(t *testing.T) { + e,_:=domain.EndpointByID("projects","appbriefinfo") + headers:=map[string]string{"oauth2Token":"offline-token","userID":"1"} + err:=ValidateEndpointRequest(e,map[string]string{"appId":"fixture","appDistStatus":"101,999"},headers,nil) + var detail *RequestValidationError + if !errors.As(err,&detail) {t.Fatalf("undefined distribution status accepted: %v",err)} + found:=false;for _,v:=range detail.Violations {found=found || v.Field=="query.appDistStatus" && v.SourceURL!=""} + if !found {t.Fatalf("missing distribution-list correction: %+v",detail.Violations)} + if err:=ValidateEndpointRequest(e,map[string]string{"appId":"fixture","appDistStatus":"-999,-995,0,1,62,101,99999,9998,9997"},headers,nil);err!=nil {t.Fatalf("official status list rejected: %v",err)} +} diff --git a/pkg/agcapi/response.go b/pkg/agcapi/response.go index 10f06c1..489535e 100644 --- a/pkg/agcapi/response.go +++ b/pkg/agcapi/response.go @@ -6,10 +6,12 @@ import ( ) type AGCError struct { - StatusCode int `json:"statusCode"` - Code string `json:"code,omitempty"` - Message string `json:"message"` - RawBody json.RawMessage `json:"rawBody,omitempty"` + CodeField string `json:"codeField,omitempty"` + ResultCodes map[string]string `json:"resultCodes,omitempty"` + StatusCode int `json:"statusCode"` + Code string `json:"code,omitempty"` + Message string `json:"message"` + RawBody json.RawMessage `json:"rawBody,omitempty"` } func (e AGCError) Error() string { @@ -33,7 +35,7 @@ func responseResults(data []byte) []responseResult { return nil } var results []responseResult - add := func(obj map[string]json.RawMessage, codeKey string, messageKeys ...string) { + add := func(obj map[string]json.RawMessage, prefix, codeKey string, messageKeys ...string) { var code string raw := obj[codeKey] if json.Unmarshal(raw, &code) != nil { @@ -48,24 +50,31 @@ func responseResults(data []byte) []responseResult { break } } - results = append(results, responseResult{code: code, message: message}) + results = append(results, responseResult{code: code, message: message, field: prefix + codeKey}) } nested := func(key string) map[string]json.RawMessage { var obj map[string]json.RawMessage - _ = json.Unmarshal(root[key], &obj) + if json.Unmarshal(root[key], &obj) != nil { + // 部分项目接口的 ret 是 JSON 字符串,而非 JSON 对象。 + var encoded string + if json.Unmarshal(root[key], &encoded) == nil { + _ = json.Unmarshal([]byte(encoded), &obj) + } + } return obj } - add(nested("ret"), "code", "msg", "message") - add(root, "rtnCode", "rtnDesc", "rtnMsg", "message", "msg") + add(nested("ret"), "ret.", "code", "msg", "message") + add(nested("resInfo"), "resInfo.", "resCode", "resInfo", "message") + add(root, "", "rtnCode", "rtnDesc", "rtnMsg", "message", "msg") // 某些测试接口同时返回 rtnCode 和 businessCode;子业务失败也必须报错。 - add(root, "businessCode", "rtnDesc", "rtnMsg", "message", "msg") - add(nested("error"), "errorCode", "errorMsg", "errorMessage", "message", "msg") - add(root, "code", "message", "msg", "error") - add(nested("errorDetail"), "code", "message", "msg") + add(root, "", "businessCode", "rtnDesc", "rtnMsg", "message", "msg") + add(nested("error"), "error.", "errorCode", "errorMsg", "errorMessage", "message", "msg") + add(root, "", "code", "message", "msg", "error") + add(nested("errorDetail"), "errorDetail.", "code", "message", "msg") return results } -type responseResult struct{ code, message string } +type responseResult struct{ code, message, field string } func businessFailure(data []byte) bool { for _, result := range responseResults(data) { @@ -84,12 +93,24 @@ func ParseAGCError(statusCode int, data []byte) AGCError { } if json.Valid(data) { errResp.RawBody = append(json.RawMessage(nil), data...) + // 缺少描述时不将整份 JSON 当作消息,避免邀请码等字段被错误反馈回显。 + errResp.Message = "upstream error response; no description provided" } results := responseResults(data) + // 仅保留已知结果码字段,供调用方区分返回码与业务子码;不暴露原始响应。 + for _, result := range results { + if result.code != "" { + if errResp.ResultCodes == nil { + errResp.ResultCodes = map[string]string{} + } + errResp.ResultCodes[result.field] = result.code + } + } // Prefer the failing result when multiple envelopes occur in one response. for _, result := range results { if result.code != "" && result.code != "0" { errResp.Code = result.code + errResp.CodeField = result.field if result.message != "" { errResp.Message = result.message } @@ -99,6 +120,7 @@ func ParseAGCError(statusCode int, data []byte) AGCError { for _, result := range results { if result.code != "" || result.message != "" { errResp.Code = result.code + errResp.CodeField = result.field if result.message != "" { errResp.Message = result.message } diff --git a/pkg/agcapi/serverless_auth.go b/pkg/agcapi/serverless_auth.go new file mode 100644 index 0000000..1a40ae6 --- /dev/null +++ b/pkg/agcapi/serverless_auth.go @@ -0,0 +1,76 @@ +package agcapi + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" +) + +func ServerlessTokenBaseURL(base string) (string, error) { + u, err := url.Parse(base) + if err != nil || u.Host == "" { + return "", fmt.Errorf("invalid serverless base URL") + } + if u.Hostname() == "127.0.0.1" || u.Hostname() == "localhost" { + return u.Scheme + "://" + u.Host, nil + } + if u.Scheme != "https" { + return "", fmt.Errorf("serverless authentication requires HTTPS") + } + region := map[string]string{"ops-server-drcn.agcstorage.link": "", "ops-server-dre.agcstorage.link": "-dre", "ops-server-dra.agcstorage.link": "-dra", "ops-server-drru.agcstorage.link": "-drru"} + if suffix, ok := region[u.Hostname()]; ok { + return "https://connect-api" + suffix + ".cloud.huawei.com", nil + } + switch u.Hostname() { + case "connect-api.cloud.huawei.com", "connect-api-dre.cloud.huawei.com", "connect-api-dra.cloud.huawei.com", "connect-api-drru.cloud.huawei.com": + return u.Scheme + "://" + u.Host, nil + } + return "", fmt.Errorf("automatic serverless authorization only supports reviewed Huawei service hosts; use an explicit token for an explicitly selected custom host") +} +func ServerlessClientToken(ctx context.Context, client *http.Client, base string, credential Credential) (string, error) { + if credential.Mode != "api-client" { + return "", fmt.Errorf("client REST requires an API client profile") + } + u, err := url.Parse(base) + if err != nil || u.Host == "" { + return "", fmt.Errorf("invalid client token base URL") + } + if u.Hostname() != "connect-drcn.dbankcloud.cn" && u.Hostname() != "localhost" && u.Hostname() != "127.0.0.1" { + return "", fmt.Errorf("client token region is not documented in this reference; use an explicitly acquired token") + } + if u.Hostname() == "connect-drcn.dbankcloud.cn" && u.Scheme != "https" { + return "", fmt.Errorf("client token requires HTTPS") + } + b, _ := json.Marshal(map[string]any{"useJwt": 1, "grant_type": "client_credentials", "client_id": credential.ClientID, "client_secret": credential.ClientKey}) + req, err := http.NewRequestWithContext(ctx, "POST", strings.TrimRight(base, "/")+"/agc/apigw/oauth2/v1/token", bytes.NewReader(b)) + if err != nil { + return "", err + } + req.Header.Set("Content-Type", "application/json") + if client == nil { + client = http.DefaultClient + } + clone := *client + clone.CheckRedirect = func(*http.Request, []*http.Request) error { return fmt.Errorf("token redirects refused") } + resp, err := clone.Do(req) + if err != nil { + return "", fmt.Errorf("client token transport failed") + } + defer resp.Body.Close() + data, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if err != nil { + return "", err + } + var token struct { + AccessToken string `json:"access_token"` + } + if resp.StatusCode != 200 || json.Unmarshal(data, &token) != nil || token.AccessToken == "" { + return "", fmt.Errorf("client token authorization failed (HTTP %d); verify the API client, project region and enabled service", resp.StatusCode) + } + return token.AccessToken, nil +} diff --git a/pkg/agcapi/serverless_test.go b/pkg/agcapi/serverless_test.go new file mode 100644 index 0000000..ce8b81b --- /dev/null +++ b/pkg/agcapi/serverless_test.go @@ -0,0 +1,296 @@ +package agcapi + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func slEndpoint(t *testing.T, f, id string) domain.Endpoint { + t.Helper() + e, ok := domain.EndpointByID(f, id) + if !ok { + t.Fatalf("missing %s/%s", f, id) + } + return e +} +func TestServerlessBinaryUploads(t *testing.T) { + data := []byte{0, 255, 7, 10, 13} + file := filepath.Join(t.TempDir(), "file.zip") + os.WriteFile(file, data, 0600) + for _, f := range []string{"storage", "hosting"} { + t.Run(f, func(t *testing.T) { + id := "upload-file" + if f == "hosting" { + id = "upload-version" + } + e := slEndpoint(t, f, id) + sum := sha256.Sum256(data) + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + b, _ := io.ReadAll(r.Body) + if string(b) != string(data) || r.ContentLength != int64(len(data)) { + t.Errorf("binary body corrupted %v", b) + } + if f == "hosting" && r.Header.Get("Authorization") != "AWS4-HMAC-SHA256 signed" { + t.Error("signed auth replaced") + } + if f == "storage" && r.Header.Get("Authorization") != "Bearer offline" { + t.Error("storage authorization missing") + } + w.Write([]byte(`{"uploadStatus":"finalize"}`)) + })) + defer srv.Close() + params := map[string]string{"bucket_name": "test", "object_name": "nested/a b.zip", "uploadUrl": srv.URL + "/signed"} + heads := map[string]string{"productId": "test", "client_id": "test"} + if f == "hosting" { + heads["Authorization"] = "AWS4-HMAC-SHA256 signed" + heads["x-amz-content-sha256"] = hex.EncodeToString(sum[:]) + heads["x-amz-client-request-id"] = "offline" + heads["x-amz-date"] = "20261026T000000Z" + heads["Host"] = strings.TrimPrefix(srv.URL, "http://") + heads["Content-Type"] = "application/zip" + } + _, err := InvokeEndpoint(context.Background(), srv.Client(), InvokeRequest{Endpoint: e, BaseURL: srv.URL, Params: params, Headers: heads, FilePath: file, AccessToken: "offline"}) + if err != nil { + t.Fatal(err) + } + }) + } +} +func TestServerlessCallbackNeverForwardsAGCToken(t *testing.T) { + e := slEndpoint(t, "templates", "player-id") + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Header.Get("Authorization") != "" { + t.Error("AGC token leaked to developer callback") + } + w.Write([]byte(`{"ret":{"code":0},"data":{"playerId":"test"}}`)) + })) + defer s.Close() + _, err := InvokeEndpoint(context.Background(), s.Client(), InvokeRequest{Endpoint: e, BaseURL: s.URL, Params: map[string]string{"callbackUrl": s.URL}, Body: []byte(`{"appId":"test","accessToken":"user-token"}`), AccessToken: "must-not-forward"}) + if err != nil { + t.Fatal(err) + } +} +func TestServerlessNestedValidation(t *testing.T) { + tests := []struct{ family, id, body, path string }{ + {"hosting", "upload-url", `{"siteId":"s","version":"v","materialInfos":[{"sceneId":"p","fileName":"x.zip","fileSha256":"abc","fileSize":1,"contentType":1}]}`, "body.materialInfos[0].contentType"}, + {"cloud-auth", "import-users", `{"users":[{"importUid":"u","createTime":"0","providers":[{}]}]}`, "body.users[0].providers[0].provider"}, + {"clouddb", "query-data", `{"msgInfo":{"type":5,"opStore":{"storeName":"z"}},"clientInfo":{"appVer":1},"queryReqMsg":{"queryType":0,"queryTable":"Student","queryCond":"{\"queryConditions\":[{}]}"}}`, "body.queryReqMsg.queryCond.queryConditions[0].conditionType"}, + } + for _, tt := range tests { + t.Run(tt.family+tt.id, func(t *testing.T) { + e := slEndpoint(t, tt.family, tt.id) + err := ValidateEndpointRequest(e, map[string]string{"_v": "4"}, map[string]string{"productId": "p", "requestid": "test", "service": "hosting"}, []byte(tt.body)) + v, ok := err.(*RequestValidationError) + if !ok { + t.Fatalf("expected nested violation, got %v", err) + } + found := false + for _, i := range v.Violations { + found = found || i.Field == tt.path + } + if !found { + t.Fatalf("missing indexed field %s: %+v", tt.path, v.Violations) + } + }) + } +} +func TestServerlessCloudDBBusinessFailure(t *testing.T) { + data := []byte(`{"resInfo":{"resCode":1001,"resInfo":"permission denied"}}`) + if !businessFailure(data) { + t.Fatal("CloudDB error treated as success") + } + e := ParseAGCError(200, data) + if e.Code != "1001" { + t.Fatalf("lost code: %+v", e) + } +} +func TestServerlessPathsAreEncodedOnce(t *testing.T) { + u, err := BuildEndpointURL("https://example.test/v0", "/{bucket_name}/{object_name}", map[string]string{"bucket_name": "test", "object_name": "folder/a b?#.txt"}, nil) + if err != nil { + t.Fatal(err) + } + if u != "https://example.test/v0/test/folder/a%20b%3F%23.txt" { + t.Fatalf("unescaped path: %s", u) + } +} +func TestServerlessEncodedQueryCondRetainsString(t *testing.T) { + e := slEndpoint(t, "clouddb", "query-data") + wire, err := MarshalEndpointFields(e, map[string]string{"msgInfo": `{"type":5,"opStore":{"storeName":"z"}}`, "clientInfo": `{"appVer":1}`, "queryReqMsg": `{"queryType":0,"queryTable":"Student","queryCond":"{\"queryConditions\":[]}"}`}) + if err != nil { + t.Fatal(err) + } + var obj map[string]map[string]json.RawMessage + json.Unmarshal(wire, &obj) + if string(obj["queryReqMsg"]["queryCond"])[0] != '"' { + t.Fatal("encoded JSON became object") + } +} + +func TestServerlessDocumentedConditionalRules(t *testing.T) { + tests := []struct{ family, id, body, field string }{ + {"cloud-auth", "register", `{}`, "body.phone|body.email"}, + {"cloud-auth", "register", `{"phone":"+86-12345678"}`, "body.verifyCode"}, + {"cloud-auth", "request-code", `{"email":"test@example.test","sendInterval":29}`, "body.sendInterval"}, + {"cloud-auth", "import-users", `{"users":[{"importUid":"u","createTime":"0","providers":[{"provider":"12","providerUid":"u"}]}]}`, "body.users[0].email"}, + {"clouddb", "query-data", `{"msgInfo":{"type":5,"opStore":{"storeName":"z"}},"clientInfo":{"appVer":1},"queryReqMsg":{"queryType":2,"queryTable":"Student","queryCond":"{\"queryConditions\":[{\"conditionType\":\"Average\",\"fieldName\":\"age\"}]}"}}`, "body.queryReqMsg.queryCond"}, + } + for _, tt := range tests { + t.Run(tt.id+tt.field, func(t *testing.T) { + e := slEndpoint(t, tt.family, tt.id) + err := ValidateEndpointRequest(e, map[string]string{"productId": "p", "_v": "4"}, map[string]string{"productId": "p"}, []byte(tt.body)) + v, ok := err.(*RequestValidationError) + if !ok { + t.Fatalf("missing documented rule: %v", err) + } + found := false + for _, i := range v.Violations { + found = found || i.Field == tt.field + } + if !found { + t.Fatalf("missing %s: %+v", tt.field, v.Violations) + } + }) + } +} +func TestServerlessMissingFileFailsLocally(t *testing.T) { + e := slEndpoint(t, "storage", "upload-file") + if ValidateEndpointFileInput(e, "/nonexistent") == nil { + t.Fatal("missing local file accepted") + } +} + +func TestStorageDownloadPreservesBinaryInJSON(t *testing.T) { + data := []byte{0, 255, 128, 10} + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/octet-stream") + w.Write(data) + })) + defer s.Close() + result, err := InvokeEndpoint(context.Background(), s.Client(), InvokeRequest{Endpoint: slEndpoint(t, "storage", "download-file"), BaseURL: s.URL, Params: map[string]string{"bucket_name": "b", "object_name": "x.bin"}, AccessToken: "offline", Headers: map[string]string{"productId": "p", "client_id": "c"}}) + if err != nil { + t.Fatal(err) + } + raw, _ := json.Marshal(result) + var obj map[string]any + json.Unmarshal(raw, &obj) + if obj["bodyBase64"] != "AP+ACg==" { + t.Fatalf("binary response not lossless in JSON: %s", raw) + } +} + +func TestServerlessRegionalTokenRouting(t *testing.T) { + for base, want := range map[string]string{"https://ops-server-drcn.agcstorage.link/v0": "https://connect-api.cloud.huawei.com", "https://ops-server-dre.agcstorage.link/v0": "https://connect-api-dre.cloud.huawei.com", "https://ops-server-dra.agcstorage.link/v0": "https://connect-api-dra.cloud.huawei.com", "https://ops-server-drru.agcstorage.link/v0": "https://connect-api-drru.cloud.huawei.com"} { + got, err := ServerlessTokenBaseURL(base) + if err != nil || got != want { + t.Fatalf("wrong regional token host %s %v", got, err) + } + } + for _, base := range []string{"http://ops-server-dre.agcstorage.link", "https://unreviewed.example.test", "bad"} { + if _, err := ServerlessTokenBaseURL(base); err == nil { + t.Fatalf("unreviewed token destination accepted %s", base) + } + } +} +func TestClientTokenUsesClientGatewayContract(t *testing.T) { + seen := false + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + seen = true + if r.URL.Path != "/agc/apigw/oauth2/v1/token" || r.Header.Get("Authorization") != "" { + t.Error("wrong token transport") + } + var b map[string]any + json.NewDecoder(r.Body).Decode(&b) + if b["useJwt"] != float64(1) || b["grant_type"] != "client_credentials" || b["client_secret"] != "offline-secret" { + t.Error("wrong client token body") + } + w.Write([]byte(`{"access_token":"offline-token"}`)) + })) + defer s.Close() + token, err := ServerlessClientToken(context.Background(), s.Client(), s.URL, Credential{Mode: "api-client", ClientID: "offline", ClientKey: "offline-secret"}) + if err != nil || token != "offline-token" || !seen { + t.Fatalf("client authorization failed %v", err) + } +} +func TestClientTokenFailureDoesNotEchoCredentialResponse(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(401) + w.Write([]byte(`{"secret":"must-not-echo"}`)) + })) + defer s.Close() + _, err := ServerlessClientToken(context.Background(), s.Client(), s.URL, Credential{Mode: "api-client", ClientID: "offline", ClientKey: "offline-secret"}) + if err == nil || strings.Contains(err.Error(), "must-not-echo") { + t.Fatalf("unsafe token error %v", err) + } +} + +func TestStorageJSONFilesAreNotBusinessEnvelopes(t *testing.T) { + data := []byte("{\n \"code\": 17, \"file\": true\n}\n") + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write(data) + })) + defer s.Close() + r, err := InvokeEndpoint(context.Background(), s.Client(), InvokeRequest{Endpoint: slEndpoint(t, "storage", "download-file"), BaseURL: s.URL, Params: map[string]string{"bucket_name": "b", "object_name": "data.json"}, AccessToken: "offline", Headers: map[string]string{"productId": "p", "client_id": "c"}}) + if err != nil { + t.Fatalf("file content interpreted as business failure: %v", err) + } + encoded, _ := json.Marshal(r) + var obj map[string]any + json.Unmarshal(encoded, &obj) + b64, _ := obj["bodyBase64"].(string) + if b64 == "" { + t.Fatal("JSON file needs lossless Base64 representation too") + } +} + +func TestStorageResumableHeadersAreCheckedLocally(t *testing.T) { + e := slEndpoint(t, "storage", "upload-file") + err := ValidateEndpointRequest(e, nil, map[string]string{"productId": "p", "client_id": "c", "X-Agc-File-Offset": "1"}, nil) + v, ok := err.(*RequestValidationError) + if !ok { + t.Fatalf("resumable prerequisites accepted: %v", err) + } + seen := map[string]bool{} + for _, issue := range v.Violations { + seen[issue.Field] = true + } + if !seen["header.X-Agc-File-Size"] || !seen["header.X-Agc-Sha256"] { + t.Fatalf("missing size/digest corrections: %+v", v.Violations) + } +} + +func TestSignedHostingDigestMismatchFailsBeforeNetwork(t *testing.T) { + path := filepath.Join(t.TempDir(), "test.zip") + os.WriteFile(path, []byte("ZIP bytes"), 0600) + e := slEndpoint(t, "hosting", "upload-version") + _, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Params: map[string]string{"uploadUrl": "https://example.test/signed"}, FilePath: path, DryRun: true, Headers: map[string]string{"Authorization": "AWS4-HMAC-SHA256 offline", "x-amz-content-sha256": strings.Repeat("0", 64), "x-amz-client-request-id": "offline", "x-amz-date": "20261026T000000Z", "Host": "example.test", "Content-Type": "application/zip"}}) + if err == nil { + t.Fatal("signed SHA256 mismatch accepted") + } +} + +type serverlessRoundTrip func(*http.Request) (*http.Response, error) + +func (f serverlessRoundTrip) RoundTrip(r *http.Request) (*http.Response, error) { return f(r) } +func TestTemplateCallbackRequiresHTTPSOutsideLoopback(t *testing.T) { + called := false + client := &http.Client{Transport: serverlessRoundTrip(func(r *http.Request) (*http.Response, error) { + called = true + return &http.Response{StatusCode: 200, Header: http.Header{}, Body: io.NopCloser(strings.NewReader(`{"ret":{"code":0}}`))}, nil + })} + _, err := InvokeEndpoint(context.Background(), client, InvokeRequest{Endpoint: slEndpoint(t, "templates", "user-id"), Params: map[string]string{"callbackUrl": "http://developer.example.test/auth"}, Body: []byte(`{"accessToken":"offline-user-credential"}`)}) + if err == nil || called { + t.Fatalf("non-HTTPS callback accepted: called=%v err=%v", called, err) + } +} diff --git a/pkg/agcapi/serverless_upload.go b/pkg/agcapi/serverless_upload.go new file mode 100644 index 0000000..5478e59 --- /dev/null +++ b/pkg/agcapi/serverless_upload.go @@ -0,0 +1,110 @@ +package agcapi + +import ( + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "os" + "regexp" + "strconv" + "strings" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func uploadHeader(headers map[string]string, name string) string { + for k, v := range headers { + if strings.EqualFold(k, name) { + return v + } + } + return "" +} +func uploadIssue(e domain.Endpoint, field, message string) error { + return &RequestValidationError{Violations: []domain.InputViolation{{Code: "upload_prerequisite", Field: field, Message: message, SourceURL: e.SourceURL, Suggestion: "Use the returned signed headers or documented resumable size, offset and SHA256; regenerate upload authorization if file bytes changed. Read " + e.Command + " --docs --pretty."}}} +} +func validateServerlessUploadFile(e domain.Endpoint, path string, headers map[string]string) error { + info, err := os.Stat(path) + if err != nil || !info.Mode().IsRegular() { + return uploadIssue(e, "filePath", "A readable regular local file is required.") + } + f, err := os.Open(path) + if err != nil { + return uploadIssue(e, "filePath", "Cannot read the selected local file.") + } + defer f.Close() + if e.FamilyID == "hosting" { + digest := uploadHeader(headers, "x-amz-content-sha256") + if headers == nil { + return nil + } // Legacy caller only checks file readability; invoke always supplies headers. + if !regexp.MustCompile(`^[0-9a-fA-F]{64}$`).MatchString(digest) { + return uploadIssue(e, "header.x-amz-content-sha256", "Supply the signed file's 64-character SHA256.") + } + h := sha256.New() + if _, err := io.Copy(h, f); err != nil { + return uploadIssue(e, "filePath", "Cannot hash the complete upload file.") + } + if !strings.EqualFold(digest, hex.EncodeToString(h.Sum(nil))) { + return uploadIssue(e, "header.x-amz-content-sha256", "Signed SHA256 does not match the selected file; do not send mismatching signed bytes.") + } + if length := uploadHeader(headers, "Content-Length"); length != "" && length != strconv.FormatInt(info.Size(), 10) { + return uploadIssue(e, "header.Content-Length", "Signed content length differs from local file length.") + } + return nil + } + offsetText, totalText := uploadHeader(headers, "X-Agc-File-Offset"), uploadHeader(headers, "X-Agc-File-Size") + var offset int64 + if offsetText != "" { + offset, err = strconv.ParseInt(offsetText, 10, 64) + if err != nil || offset < 0 { + return uploadIssue(e, "header.X-Agc-File-Offset", "Use a nonnegative integer byte offset.") + } + } + total := info.Size() + if totalText != "" { + total, err = strconv.ParseInt(totalText, 10, 64) + if err != nil || total < 0 { + return uploadIssue(e, "header.X-Agc-File-Size", "Use a nonnegative integer total file size.") + } + if offset > total || info.Size() > total-offset { + return uploadIssue(e, "header.X-Agc-File-Size", "Offset and uploaded chunk exceed the documented total file length.") + } + } + if digest := uploadHeader(headers, "X-Agc-Sha256"); digest != "" { + if !regexp.MustCompile(`^[0-9a-fA-F]{64}$`).MatchString(digest) { + return uploadIssue(e, "header.X-Agc-Sha256", "Use the complete source file's SHA256 in hexadecimal.") + } + if offset == 0 && total == info.Size() { + h := sha256.New() + if _, err = io.Copy(h, f); err != nil { + return uploadIssue(e, "filePath", "Cannot hash the selected file.") + } + if !strings.EqualFold(digest, hex.EncodeToString(h.Sum(nil))) { + return uploadIssue(e, "header.X-Agc-Sha256", "SHA256 differs from the selected complete file.") + } + } + } + return nil +} +func resumableViolations(e domain.Endpoint, headers map[string]string) []domain.InputViolation { + var issues []domain.InputViolation + if e.FamilyID != "storage" { + return issues + } + add := func(field, msg string) { + issues = append(issues, domain.InputViolation{Code: "resumable_prerequisite", Field: "header." + field, Message: msg, SourceURL: e.SourceURL, Suggestion: "Provide the complete file size and SHA256 when supplying a resumable file offset; see " + e.Command + " --docs --pretty."}) + } + if len(headers) > 40 { + add("headers", fmt.Sprintf("Explicit header count %d exceeds the documented limit of 40.", len(headers))) + } + if e.ID == "upload-file" && uploadHeader(headers, "X-Agc-File-Offset") != "" { + for _, n := range []string{"X-Agc-File-Size", "X-Agc-Sha256"} { + if uploadHeader(headers, n) == "" { + add(n, n+" is required for resumable uploads.") + } + } + } + return issues +} diff --git a/pkg/agcapi/serverless_validation.go b/pkg/agcapi/serverless_validation.go new file mode 100644 index 0000000..03878cd --- /dev/null +++ b/pkg/agcapi/serverless_validation.go @@ -0,0 +1,111 @@ +package agcapi + +import ( + "encoding/json" + "fmt" + "strings" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func serverlessViolations(e domain.Endpoint, object map[string]any) []domain.InputViolation { + var issues []domain.InputViolation + add := func(field, msg string) { + issues = append(issues, domain.InputViolation{Code: "serverless_contract", Field: field, Message: msg, SourceURL: e.SourceURL, Suggestion: "Correct this field using " + e.Command + " --docs --pretty before authorization or network calls."}) + } + if e.FamilyID == "cloud-auth" && e.ID == "import-users" { + users, _ := object["users"].([]any) + for i, u := range users { + user, _ := u.(map[string]any) + providers, _ := user["providers"].([]any) + for _, v := range providers { + provider, _ := v.(map[string]any) + p, _ := provider["provider"].(string) + prefix := fmt.Sprintf("body.users[%d].", i) + if p == "12" { + if user["email"] == nil || user["email"] == "" { + add(prefix+"email", "Email provider 12 requires email.") + } + if _, ok := user["emailVerified"].(bool); !ok { + add(prefix+"emailVerified", "Email provider 12 requires boolean emailVerified.") + } + } + if p == "11" && (user["phone"] == nil || user["phone"] == "") { + add(prefix+"phone", "Phone provider 11 requires phone.") + } + } + } + } + if e.FamilyID == "clouddb" && e.ID == "query-data" { + query, _ := object["queryReqMsg"].(map[string]any) + kind := fmt.Sprint(query["queryType"]) + if allowed, ok := map[string][]string{"1": {"AVG", "Average"}, "2": {"SUM"}, "3": {"MAX"}, "4": {"MIN"}, "5": {"COUNT"}}[kind]; ok { + var cond struct { + Conditions []struct { + Type string `json:"conditionType"` + } `json:"queryConditions"` + } + encoded, _ := query["queryCond"].(string) + if json.Unmarshal([]byte(encoded), &cond) == nil { + found := false + for _, c := range cond.Conditions { + for _, a := range allowed { + found = found || strings.EqualFold(c.Type, a) + } + } + if !found { + add("body.queryReqMsg.queryCond", "Aggregate queryType requires a matching conditionType.") + } + } + } + } + if e.FamilyID == "clouddb" && (e.ID == "update-data" || e.ID == "delete-data") { + schemas, _ := object["schemas"].([]any) + ops, _ := object["opData"].([]any) + if len(schemas) != len(ops) { + add("body.opData", "schemas and opData must align by object type.") + } + for i, s := range schemas { + schema, _ := s.(map[string]any) + fields, _ := schema["fs"].([]any) + version, deleted := -1, -1 + for j, f := range fields { + field, _ := f.(map[string]any) + switch field["n"] { + case "naturalbase_version": + version = j + case "naturalbase_deleted": + deleted = j + } + } + if version < 0 { + add(fmt.Sprintf("body.schemas[%d].fs", i), "Write schemas require naturalbase_version (TYPE_LONG).") + } + if deleted < 0 { + add(fmt.Sprintf("body.schemas[%d].fs", i), "Write schemas require naturalbase_deleted (TYPE_BOOLEAN).") + } + if i >= len(ops) { + continue + } + op, _ := ops[i].(map[string]any) + rows, _ := op["os"].([]any) + for j, row := range rows { + r, _ := row.(map[string]any) + values, _ := r["fs"].([]any) + prefix := fmt.Sprintf("body.opData[%d].os[%d].fs", i, j) + if len(values) != len(fields) { + add(prefix, "Field values must match schema field order and count.") + continue + } + if deleted >= 0 { + v, _ := values[deleted].(map[string]any) + want := e.ID == "delete-data" + if flag, ok := v["bl"].(bool); !ok || flag != want { + add(fmt.Sprintf("%s[%d].bl", prefix, deleted), fmt.Sprintf("naturalbase_deleted must be %t for this operation.", want)) + } + } + } + } + } + return issues +} diff --git a/pkg/agcapi/template_deploy.go b/pkg/agcapi/template_deploy.go new file mode 100644 index 0000000..8eab9ef --- /dev/null +++ b/pkg/agcapi/template_deploy.go @@ -0,0 +1,214 @@ +package agcapi + +import ( + "archive/zip" + "context" + "crypto/rand" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "regexp" + "strings" + "time" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func invokeTemplateDeploy(ctx context.Context, client *http.Client, req InvokeRequest) (InvokeResponse, error) { + out := InvokeResponse{Method: "POST", URL: "native:templates/deploy", DryRun: req.DryRun} + var body map[string]any + dec := json.NewDecoder(strings.NewReader(string(req.Body))) + dec.UseNumber() + if dec.Decode(&body) != nil { + return out, uploadIssue(req.Endpoint, "body", "Provide a valid SAM JSON manifest.") + } + name, _ := body["name"].(string) + bucket, _ := body["storageInstance"].(string) + components, _ := body["components"].([]any) + if name == "" || bucket == "" || len(components) == 0 { + return out, uploadIssue(req.Endpoint, "body", "Provide name, storageInstance and one or more CloudFunctions components.") + } + type artifact struct { + Path string + SHA256 string + Bytes int64 + ObjectID string + } + artifacts := make([]artifact, len(components)) + // Every artifact is validated before loading authorization or starting uploads. + for i, v := range components { + c, ok := v.(map[string]any) + if !ok { + return out, uploadIssue(req.Endpoint, fmt.Sprintf("body.components[%d]", i), "Component must be a CloudFunctions object.") + } + props, _ := c["properties"].(map[string]any) + path, _ := props["codeUri"].(string) + file, err := os.Open(path) + if err != nil { + return out, uploadIssue(req.Endpoint, fmt.Sprintf("body.components[%d].properties.codeUri", i), "Use a readable local ZIP codeUri, smaller than the source SAM limit of 300 MiB.") + } + stat, err := file.Stat() + if err != nil || !stat.Mode().IsRegular() || stat.Size() >= 300<<20 || !strings.EqualFold(filepath.Ext(path), ".zip") { + file.Close() + return out, uploadIssue(req.Endpoint, fmt.Sprintf("body.components[%d].properties.codeUri", i), "Use a regular local ZIP smaller than 300 MiB.") + } + z, err := zip.NewReader(file, stat.Size()) + if err != nil || len(z.File) == 0 { + file.Close() + return out, uploadIssue(req.Endpoint, fmt.Sprintf("body.components[%d].properties.codeUri", i), "Code ZIP must contain at least one entry.") + } + for _, entry := range z.File { + reader, openErr := entry.Open() + if openErr != nil { + file.Close() + return out, uploadIssue(req.Endpoint, fmt.Sprintf("body.components[%d].properties.codeUri", i), "Code ZIP entry cannot be opened.") + } + _, readErr := io.Copy(io.Discard, contextZIPReader{ctx: ctx, reader: reader}) + reader.Close() + if readErr != nil { + file.Close() + return out, uploadIssue(req.Endpoint, fmt.Sprintf("body.components[%d].properties.codeUri", i), "Code ZIP payload failed integrity verification or the request context expired.") + } + } + sum := sha256.New() + if _, err = io.Copy(sum, file); err != nil { + file.Close() + return out, uploadIssue(req.Endpoint, "body.components", "Cannot hash code ZIP.") + } + file.Close() + artifacts[i] = artifact{Path: path, SHA256: hex.EncodeToString(sum.Sum(nil)), Bytes: stat.Size()} + componentName, _ := c["name"].(string) + combined := name + "-" + componentName + if len(componentName) > 16 || !regexp.MustCompile(`^[a-z][a-z0-9-]{0,30}[a-z0-9]$`).MatchString(combined) { + return out, uploadIssue(req.Endpoint, fmt.Sprintf("body.components[%d].name", i), "The SAM application prefix plus component name must fit the reviewed 32-character function name limit.") + } + c["name"] = combined + } + if req.DryRun { + return out, nil + } + type uploadedArtifact struct { + ObjectID string `json:"objectId"` + SHA256 string `json:"sha256"` + Bytes int64 `json:"bytes"` + } + uploaded := []uploadedArtifact{} + fail := func(stage string, err error) (InvokeResponse, error) { + return out, fmt.Errorf("SAM deployment stopped at %s; %d uploaded artifacts may be retained, no cleanup or retry was performed: %w", stage, len(uploaded), err) + } + call := func(id string, b map[string]any, q map[string]string) (InvokeResponse, error) { + e, ok := domain.EndpointByID("templates", id) + if !ok { + return InvokeResponse{}, fmt.Errorf("missing SAM transport contract") + } + var data []byte + if b != nil { + data, _ = json.Marshal(b) + } + return InvokeEndpoint(ctx, client, InvokeRequest{Endpoint: e, Body: data, Query: q, SessionFile: req.SessionFile, ProjectID: req.ProjectID, BaseURL: req.BaseURL}) + } + search := func() (map[string]any, error) { + response, err := call("search-applications", nil, map[string]string{"appName": name}) + if err != nil { + return nil, err + } + var matches []map[string]any + if json.Unmarshal(response.Body, &matches) != nil { + return nil, fmt.Errorf("SAM search omitted its source-defined array response") + } + var found map[string]any + for _, m := range matches { + if m["name"] == name { + if found != nil { + return nil, fmt.Errorf("multiple exact SAM application matches; refusing ambiguous target") + } + found = m + } + } + return found, nil + } + prior, err := search() + if err != nil { + return fail("application preflight", err) + } + if prior != nil { + return fail("application preflight", fmt.Errorf("application already exists; use explicit create-plan/get-plan/apply-plan instead of overwriting it")) + } + for i, a := range artifacts { + random := make([]byte, 16) + if _, err = rand.Read(random); err != nil { + return fail("object naming", err) + } + object := "agc-cli-" + hex.EncodeToString(random) + ".zip" + e := domain.TemplateCodeUploadEndpoint() + _, err := InvokeEndpoint(ctx, client, InvokeRequest{Endpoint: e, SessionFile: req.SessionFile, ProjectID: req.ProjectID, Params: map[string]string{"bucket": bucket, "object_name": object}, FilePath: a.Path, Headers: map[string]string{"X-Agc-Trace-Id": strings.TrimSuffix(object, ".zip")}}) + if err != nil { + return fail("artifact upload", err) + } + key := bucket + "/" + object + uploaded = append(uploaded, uploadedArtifact{ObjectID: key, SHA256: a.SHA256, Bytes: a.Bytes}) + components[i].(map[string]any)["properties"].(map[string]any)["codeUri"] = key + } + wait, _ := body["waitForReady"].(bool) + delete(body, "storageInstance") + delete(body, "waitForReady") + accepted, err := call("create-application", body, nil) + if err != nil { + return fail("application creation", err) + } + var created map[string]any + if json.Unmarshal(accepted.Body, &created) != nil || created["id"] == nil { + return fail("application creation readback", fmt.Errorf("creation response omitted application id; creation may have succeeded")) + } + ready := false + for i := 0; i < 15; i++ { + current, err := search() + if err != nil { + return fail("readiness readback", err) + } + if current != nil { + if current["id"] != created["id"] { + return fail("readiness readback", fmt.Errorf("application id differs from created resource")) + } + status, _ := current["status"].(map[string]any) + ready, _ = status["ready"].(bool) + } + if ready || !wait { + break + } + if i == 14 { + break + } + timer := time.NewTimer(2400 * time.Millisecond) + select { + case <-ctx.Done(): + timer.Stop() + return fail("readiness wait", ctx.Err()) + case <-timer.C: + } + } + out.StatusCode = accepted.StatusCode + out.ContentType = "application/json" + out.Body, _ = json.Marshal(map[string]any{"applicationAccepted": true, "applicationId": created["id"], "ready": ready, "uploadedArtifacts": uploaded, "retention": "Uploaded code objects retained; no automatic cleanup. Existing applications were not modified."}) + out.RawBody = out.Body + return out, nil +} + +type contextZIPReader struct { + ctx context.Context + reader io.Reader +} + +func (r contextZIPReader) Read(p []byte) (int, error) { + select { + case <-r.ctx.Done(): + return 0, r.ctx.Err() + default: + return r.reader.Read(p) + } +} diff --git a/pkg/agcapi/template_deploy_test.go b/pkg/agcapi/template_deploy_test.go new file mode 100644 index 0000000..32d2527 --- /dev/null +++ b/pkg/agcapi/template_deploy_test.go @@ -0,0 +1,149 @@ +package agcapi + +import ( + "archive/zip" + "bytes" + "context" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/Createitv/agc-cli/internal/managementtest" + "github.com/Createitv/agc-cli/pkg/domain" +) + +func TestTemplateDeployRejectsDuplicateComponentsDuringDryRun(t *testing.T) { + e, _ := domain.EndpointByID("templates", "deploy") + server, body := managementtest.Deployment(t) + defer server.Close() + components := body["components"].([]any) + body["components"] = append(components, components[0]) + b, _ := json.Marshal(body) + _, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Body: b, DryRun: true, SessionFile: "/must-not-read"}) + if err == nil || !strings.Contains(err.Error(), "unique") { + t.Fatalf("duplicate component accepted in local preflight: %v", err) + } +} + +func TestTemplateDeployRejectsCorruptZIPPayloadDuringDryRun(t *testing.T) { + e, _ := domain.EndpointByID("templates", "deploy") + server, body := managementtest.Deployment(t) + defer server.Close() + path := body["components"].([]any)[0].(map[string]any)["properties"].(map[string]any)["codeUri"].(string) + // A valid central directory does not establish that the entry bytes match CRC. + f, _ := os.Create(path) + w := zip.NewWriter(f) + entry, _ := w.CreateHeader(&zip.FileHeader{Name: "handler.js", Method: zip.Store}) + entry.Write([]byte("offline-payload")) + w.Close() + f.Close() + data, _ := os.ReadFile(path) + offset := bytes.Index(data, []byte("offline-payload")) + if offset < 0 { + t.Fatal("fixture payload missing") + } + data[offset] ^= 1 + os.WriteFile(path, data, 0600) + b, _ := json.Marshal(body) + _, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Body: b, DryRun: true, SessionFile: "/must-not-read"}) + if err == nil || !strings.Contains(err.Error(), "ZIP") { + t.Fatalf("corrupt ZIP accepted: %v", err) + } +} + +func TestTemplateDeployUploadsZIPAndReadsIndependentReadiness(t *testing.T) { + e, ok := domain.EndpointByID("templates", "deploy") + if !ok { + t.Fatal("SAM deployment workflow absent") + } + file := filepath.Join(t.TempDir(), "function.zip") + f, _ := os.Create(file) + z := zip.NewWriter(f) + entry, _ := z.Create("handler.js") + entry.Write([]byte("exports.myHandler=()=>1")) + z.Close() + f.Close() + want, _ := os.ReadFile(file) + fixture := managementtest.Fixtures()["templates/create-application"].Body + fixture["storageInstance"] = "offline-bucket" + fixture["waitForReady"] = true + fixture["components"].([]any)[0].(map[string]any)["properties"].(map[string]any)["codeUri"] = file + created, uploaded := false, false + calls := 0 + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + calls++ + w.Header().Set("Content-Type", "application/json") + if r.Header.Get("oauth2Token") != "offline-oauth" || r.Header.Get("Authorization") != "" { + t.Error("wrong deployment auth") + } + switch { + case r.Method == "GET" && r.URL.Path == "/api/adm/v1/applications/search": + if r.URL.Query().Get("appName") != "offline-app" { + t.Error("wrong app selection") + } + if created { + io.WriteString(w, `[{"id":"application:offline","name":"offline-app","status":{"ready":true}}]`) + } else { + io.WriteString(w, `[]`) + } + case r.Method == "PUT" && strings.HasPrefix(r.URL.Path, "/v0/offline-bucket/"): + b, _ := io.ReadAll(r.Body) + if string(b) != string(want) || r.ContentLength != int64(len(want)) || r.Header.Get("Content-Type") != "application/x-www-form-urlencoded" { + t.Error("ZIP transport changed") + } + uploaded = true + io.WriteString(w, `{}`) + case r.Method == "POST" && r.URL.Path == "/api/adm/v1/applications": + if !uploaded { + t.Error("application created before upload") + } + var b map[string]any + json.NewDecoder(r.Body).Decode(&b) + if _, ok := b["storageInstance"]; ok { + t.Error("local-only input leaked upstream") + } + c := b["components"].([]any)[0].(map[string]any) + if c["name"] != "offline-app-test-func" || !strings.HasPrefix(c["properties"].(map[string]any)["codeUri"].(string), "offline-bucket/") { + t.Error("SAM component prefix/codeUri changed") + } + created = true + io.WriteString(w, `{"id":"application:offline"}`) + default: + t.Errorf("unexpected %s %s", r.Method, r.URL) + http.Error(w, "unexpected", 500) + } + })) + defer srv.Close() + session := managementtest.SessionFile(t, srv.URL) + var s map[string]any + b, _ := os.ReadFile(session) + json.Unmarshal(b, &s) + s["projectStorageBaseUrl"] = srv.URL + b, _ = json.Marshal(s) + os.WriteFile(session, b, 0600) + b, _ = json.Marshal(fixture) + result, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Body: b, SessionFile: session}) + if err != nil || calls != 4 || !strings.Contains(string(result.Body), `"ready":true`) { + t.Fatalf("calls=%d error=%v body=%s", calls, err, result.Body) + } +} + +func TestTemplateDeployValidatesAllArtifactsBeforeReadingSession(t *testing.T) { + e, ok := domain.EndpointByID("templates", "deploy") + if !ok { + t.Fatal("deploy absent") + } + fixture := managementtest.Fixtures()["templates/create-application"].Body + fixture["storageInstance"] = "offline-bucket" + fixture["components"].([]any)[0].(map[string]any)["properties"].(map[string]any)["codeUri"] = "/missing.zip" + b, _ := json.Marshal(fixture) + _, err := InvokeEndpoint(context.Background(), nil, InvokeRequest{Endpoint: e, Body: b, SessionFile: "/must-not-read"}) + if err == nil || !strings.Contains(err.Error(), "ZIP") { + t.Fatalf("expected artifact error before auth: %v", err) + } +} diff --git a/pkg/agcapi/testdata/privacy-atomic-request.json b/pkg/agcapi/testdata/privacy-atomic-request.json new file mode 100644 index 0000000..3ef4375 --- /dev/null +++ b/pkg/agcapi/testdata/privacy-atomic-request.json @@ -0,0 +1,86 @@ +{ + "id": "fixture-privacy-policy", + "defaultLang": "zh", + "agreementInfos": [ + { + "lang": "zh", + "baseInfo": { + "name": "元服务的隐私政策协议示例", + "appName": "应用名称", + "companyName": "公司名称", + "briefDesc": "产品说明", + "effectiveTime": 1743392449000 + }, + "personalInfo": { + "requiredInfo": { + "sceneItems": [ + { + "dataItems": [ + { + "itemId": "D0***07", + "itemDesc": "地址", + "sensitiveData": 0 + } + ], + "sceneId": "1001", + "sceneReason": "实现应用功能", + "collectModeId": "1201", + "collectMode": "在后台运行时", + "legalBasisId": "1101", + "legalBasis": "在获取您的同意后", + "remark": "修改" + } + ] + }, + "adsInfo": { + "sceneItems": [ + { + "dataItems": [ + { + "itemId": "D001007", + "itemDesc": "地址", + "sensitiveData": 0 + } + ] + } + ], + "pushContent": "活动和中奖", + "closeSetting": "设置-广告营销" + } + }, + "extInfo": { + "contactInfo": { + "phoneNum": [ + "0086-13700000000" + ] + }, + "storageInfo": { + "storagePeriod": "-1", + "country": "中国境内", + "isCrossBorder": false + }, + "childPrivacyUrl": "", + "versionChangeDescs": [], + "abstracts": "", + "managePersonalInfo": { + "infoAccess": {}, + "infoModify": {}, + "infoDelete": {}, + "infoCancel": {}, + "serviceStop": {} + }, + "customInfo": { + "customInfos": [] + }, + "extFieldCustomInfo": { + "childPrivacyTitle": "", + "childPrivacyCustomInfoDesc": "" + } + }, + "thirdSdkInfo": { + "sdkInfos": [] + }, + "thirdSharedInfos": [] + } + ] +} diff --git a/pkg/agcapi/testdata/privacy-harmonyos-request.json b/pkg/agcapi/testdata/privacy-harmonyos-request.json new file mode 100644 index 0000000..cf87a73 --- /dev/null +++ b/pkg/agcapi/testdata/privacy-harmonyos-request.json @@ -0,0 +1,58 @@ +{ + "id": "fixture-privacy-policy", + "defaultLang": "zh", + "agreementInfos": [ + { + "lang": "zh", + "baseInfo": { + "name": "应用的隐私政策协议示例", + "appName": "应用名称", + "companyName": "公司名称", + "briefDesc": "产品说明", + "effectiveTime": 1719216501000 + }, + "personalInfo": { + "fullServiceMode": { + "selectPath": "我的-设置", + "personalCollectType": "1", + "basicServiceType": "设置", + "extraServiceType": "支付" + } + }, + "extInfo": { + "contactInfo": { + "phoneNum": [ + "0086-13700000000" + ] + }, + "storageInfo": { + "storagePeriod": "-1", + "country": "中国境内", + "isCrossBorder": false + }, + "childPrivacyUrl": "", + "versionChangeDescs": [], + "abstracts": "", + "managePersonalInfo": { + "infoAccess": {}, + "infoModify": {}, + "infoDelete": {}, + "infoCancel": {}, + "serviceStop": {}, + "selectedKeys": [] + }, + "customInfo": { + "customInfos": [] + }, + "extFieldCustomInfo": { + "childPrivacyTitle": "", + "childPrivacyCustomInfoDesc": "" + } + }, + "thirdSdkInfo": { + "sdkInfos": [] + }, + "thirdSharedInfos": [] + } + ] +} diff --git a/pkg/agcapi/testing_members_validation_test.go b/pkg/agcapi/testing_members_validation_test.go new file mode 100644 index 0000000..48372cf --- /dev/null +++ b/pkg/agcapi/testing_members_validation_test.go @@ -0,0 +1,34 @@ +package agcapi + +import ( + "encoding/json" + "github.com/Createitv/agc-cli/pkg/domain" + "strings" + "testing" +) + +func TestTestingMemberDeletionRejectsWrongOrOversizedIDArrays(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-delete-test-group-user") + ids := make([]string, 101) + for i := range ids { + ids[i] = "owned-fixture" + } + oversized, _ := json.Marshal(map[string]any{"groupId": "owned-group", "deleteTesterIds": ids}) + for _, body := range [][]byte{[]byte(`{"groupId":"owned-group","deleteTesterIds":"member"}`), []byte(`{"groupId":"owned-group","deleteTesterIds":[1]}`), oversized, []byte(`{"groupId":"owned-group","deleteTesterIds":["` + strings.Repeat("x", 101) + `"]}`), []byte(`{"deleteTesterIds":["member"]}`)} { + if err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, body); err == nil { + t.Errorf("invalid official request accepted: %s", body) + } + } + if err := ValidateEndpointRequest(e, nil, map[string]string{"appId": "fixture"}, []byte(`{"groupId":"owned-group","deleteTesterIds":["member"]}`)); err != nil { + t.Fatal(err) + } +} + +func TestMemberFieldsReturnStructuredArrayIndex(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-delete-test-group-user") + _, err := MarshalEndpointFields(e, map[string]string{"groupId": "fixture", "deleteTesterIds": "[1]"}) + problem, ok := err.(*RequestValidationError) + if !ok || len(problem.Violations) == 0 || problem.Violations[0].Field != "body.deleteTesterIds[0]" { + t.Fatalf("missing structured array index: %v", err) + } +} diff --git a/pkg/agcapi/testing_package_file_validation_test.go b/pkg/agcapi/testing_package_file_validation_test.go new file mode 100644 index 0000000..4174c67 --- /dev/null +++ b/pkg/agcapi/testing_package_file_validation_test.go @@ -0,0 +1,23 @@ +package agcapi + +import ( + "github.com/Createitv/agc-cli/pkg/domain" + "strings" + "testing" +) + +func TestTestingPackageFileRequiresOfficialModelFields(t *testing.T) { + e, _ := domain.EndpointByID("testing", "test-api-add-test-package") + for _, body := range []string{`{"file":{}}`, `{"file":{"fileName":"owned.app"}}`, `{"file":{"objectId":"owned-object"}}`, `{"file":{"fileName":123,"objectId":"owned-object"}}`, `{"file":{"fileName":"` + strings.Repeat("x", 256) + `","objectId":"owned-object"}}`, `{"file":{"fileName":"owned.app","objectId":"` + strings.Repeat("x", 1025) + `"}}`} { + if err := ValidateEndpointRequest(e, map[string]string{"appId": "dedicated"}, nil, []byte(body)); err == nil { + t.Error("invalid nested FileInfo accepted") + } + } + if err := ValidateEndpointRequest(e, map[string]string{"appId": "dedicated"}, nil, []byte(`{"file":{"fileName":"owned.app","objectId":"owned-object"}}`)); err != nil { + t.Fatal(err) + } + doc, _ := domain.EndpointReference("testing", "test-api-add-test-package") + if !strings.Contains(string(doc), "agc-help-test-api-data-fileinfo-0000002272575549") || !strings.Contains(string(doc), "relatedDocuments") { + t.Fatal("linked FileInfo source not exposed") + } +} diff --git a/pkg/agcapi/upload_file_test.go b/pkg/agcapi/upload_file_test.go index bb9eda4..5e3dcf3 100644 --- a/pkg/agcapi/upload_file_test.go +++ b/pkg/agcapi/upload_file_test.go @@ -2,6 +2,7 @@ package agcapi import ( "context" + "encoding/json" "io" "net/http" "net/http/httptest" @@ -22,6 +23,7 @@ func TestInvokeEndpointStreamsUploadFile(t *testing.T) { for _, contentType := range []string{"", "application/vnd.android.package-archive"} { t.Run(id+contentType, func(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("ETag", `"server-content-hash"`) data, err := io.ReadAll(r.Body) if err != nil { t.Error(err) @@ -44,10 +46,16 @@ func TestInvokeEndpointStreamsUploadFile(t *testing.T) { } })) defer server.Close() - _, err := InvokeEndpoint(context.Background(), server.Client(), InvokeRequest{Endpoint: domain.Endpoint{ID: id, Method: "PUT", Path: "{uploadUrl}"}, Params: map[string]string{"uploadUrl": server.URL}, FilePath: file, AccessToken: "test-token", Headers: map[string]string{"Content-Type": contentType}}) + result, err := InvokeEndpoint(context.Background(), server.Client(), InvokeRequest{Endpoint: domain.Endpoint{ID: id, Method: "PUT", Path: "{uploadUrl}"}, Params: map[string]string{"uploadUrl": server.URL}, FilePath: file, AccessToken: "test-token", Headers: map[string]string{"Content-Type": contentType}}) if err != nil { t.Fatal(err) } + encoded, _ := json.Marshal(result) + var decoded map[string]any + _ = json.Unmarshal(encoded, &decoded) + if decoded["etag"] != `"server-content-hash"` { + t.Fatal("服务端 ETag 校验值未透传给 CLI") + } }) } } diff --git a/pkg/cloudfunctions/client.go b/pkg/cloudfunctions/client.go new file mode 100644 index 0000000..f416cda --- /dev/null +++ b/pkg/cloudfunctions/client.go @@ -0,0 +1,557 @@ +// Package cloudfunctions implements the native Go workflows from the Huawei +// AGCLI source. OAuth session files are explicit; publishing credentials are never read. +package cloudfunctions + +import ( + "archive/zip" + "bytes" + "context" + "crypto/rand" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf16" + + "github.com/Createitv/agc-cli/pkg/agcapi" + "github.com/Createitv/agc-cli/pkg/domain" +) + +type Session struct { + UID string `json:"uid"` + TeamID string `json:"teamId"` + ProductID string `json:"productId"` + AccessToken string `json:"accessToken"` + ExpiresAt time.Time `json:"expiresAt"` + ProjectBaseURL string `json:"projectBaseUrl"` +} +type Client struct { + HTTP *http.Client + Session Session +} +type Response struct { + Operation string `json:"operation"` + DryRun bool `json:"dryRun"` + StatusCode int `json:"statusCode,omitempty"` + ExecutionStatus string `json:"executionStatus,omitempty"` + ExecutedVersion string `json:"executedVersion,omitempty"` + TraceID string `json:"traceId,omitempty"` + Updated bool `json:"updated,omitempty"` + Published bool `json:"published,omitempty"` + Body json.RawMessage `json:"body,omitempty"` +} + +func violation(field, msg string) error { + return &agcapi.RequestValidationError{Violations: []domain.InputViolation{{Code: "function_input", Field: field, Message: msg, SourceURL: "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", Suggestion: "Read agc functions --docs --pretty; correct this field before invoking."}}} +} +func Validate(operation string, r domain.FunctionRequest) error { + known := false + for _, op := range domain.FunctionOperations { + known = known || operation == op + } + if !known { + return violation("operation", "Unknown native function operation") + } + if operation != "list-functions" && !regexp.MustCompile(`^[a-z][a-z0-9-]{0,30}[a-z0-9]$`).MatchString(r.Name) { + return violation("name", "Function name must have 2-32 lowercase letters, digits or hyphens, starting with a letter and ending with a letter or digit.") + } + if r.Version != "" && r.Version != "$latest" { + n, err := strconv.Atoi(r.Version) + if err != nil || n < 1 || n > 1000 { + return violation("version", "Use $latest or a version integer from 1 to 1000 (AGCLI option contract).") + } + } + if r.Version != "" && r.AliasName != "" { + return violation("aliasName", "version and aliasName are mutually exclusive.") + } + if r.AliasName != "" && !regexp.MustCompile(`^[a-z][a-z0-9-]{0,14}[a-z0-9]$`).MatchString(r.AliasName) { + return violation("aliasName", "Alias must contain 2-16 lowercase letters, digits or hyphens.") + } + if len(r.Payload) > 0 && (!json.Valid(r.Payload) || len(r.Payload) >= 4<<20) { + return violation("payload", "Supply valid JSON smaller than 4 MiB.") + } + if r.Memory != nil { + switch *r.Memory { + case 500, 1000, 2000, 4000: + default: + return violation("memory", "Use 500, 1000, 2000 or 4000 MiB.") + } + } + if r.Timeout != nil && (*r.Timeout < 1 || *r.Timeout > 1800) { + return violation("timeout", "Use an integer from 1 to 1800 seconds.") + } + if r.InstanceConcurrency != nil && (*r.InstanceConcurrency < 1 || *r.InstanceConcurrency > 1000) { + return violation("instanceConcurrency", "Use an integer from 1 to 1000.") + } + if r.Runtime != "" && r.Runtime != "nodejs14.x" && r.Runtime != "python3" && r.Runtime != "java1.8" && r.Runtime != "custom-runtime" { + return violation("runtime", "Use a runtime supported by the reviewed AGCLI contract.") + } + if agcliWidth(r.Description) > 64 || agcliWidth(r.VersionDescription) > 64 { + return violation("versionDescription", "Descriptions must contain at most 64 characters.") + } + if strings.Contains(operation, "publish") && r.VersionDescription == "" { + return violation("versionDescription", "A version description is required for publish operations.") + } + if r.Handler != nil && (*r.Handler == "" || len(*r.Handler) > 64) { + return violation("handler", "Supply a nonempty handler of at most 64 characters.") + } + if r.Environment != nil { + raw, _ := json.Marshal(*r.Environment) + if len(raw) >= 3<<20 { + return violation("environment", "Environment must be smaller than 3 MiB.") + } + for k, v := range *r.Environment { + if len(k) > 64 || !regexp.MustCompile(`^[-._a-zA-Z][-._a-zA-Z0-9]*$`).MatchString(k) || len(utf16.Encode([]rune(v))) > 2048 { + return violation("environment", "Environment keys must match the AGCLI name format (max 64); values have max length 2048.") + } + } + } + if r.Layers != nil { + if len(*r.Layers) > 5 { + return violation("layers", "At most five layers may be attached.") + } + for _, l := range *r.Layers { + if !strings.Contains(l, ":") { + return violation("layers", "Use layerName:version or layerUrn:version.") + } + } + } + if r.PageSize < 0 || r.PageSize > 1000 || r.PageIndex < 0 { + return violation("pageSize", "Use pageSize 1-1000 and pageIndex >=1, or omit defaults.") + } + if len(r.FuzzyName) > 32 || r.FuzzyName != "" && !regexp.MustCompile(`^[a-z0-9-]+$`).MatchString(r.FuzzyName) { + return violation("fuzzyName", "Use at most 32 lowercase letters, digits or hyphens.") + } + if (operation == "create-function" || operation == "update-function-code") && r.CodePath == "" { + return violation("codePath", "A ZIP deployment package is required.") + } + if r.CodePath != "" { + info, err := os.Stat(r.CodePath) + if err != nil || !info.Mode().IsRegular() || info.Size() >= 50<<20 || strings.ToLower(filepath.Ext(r.CodePath)) != ".zip" { + return violation("codePath", "Use a readable regular ZIP file smaller than 50 MiB.") + } + z, err := zip.OpenReader(r.CodePath) + if err != nil { + return violation("codePath", "Deployment package must be a valid ZIP archive.") + } + z.Close() + } + if operation == "update-function-config" && !hasUpdate(r) && r.VersionDescription == "" { + return violation("body", "Supply at least one configuration change.") + } + return nil +} +func hasUpdate(r domain.FunctionRequest) bool { + return r.CodePath != "" || r.Handler != nil || r.Memory != nil || r.Timeout != nil || r.InstanceConcurrency != nil || r.Environment != nil || r.Layers != nil +} +func (c *Client) Execute(ctx context.Context, op string, r domain.FunctionRequest) (Response, error) { + out := Response{Operation: op, DryRun: r.DryRun} + if err := Validate(op, r); err != nil { + return out, err + } + if r.DryRun { + return out, nil + } + session := c.Session + if r.SessionFile != "" { + b, err := os.ReadFile(r.SessionFile) + if err != nil { + return out, violation("sessionFile", "Cannot read the explicitly selected OAuth session file.") + } + if json.Unmarshal(b, &session) != nil { + return out, violation("sessionFile", "Invalid OAuth session file.") + } + } + if session.UID == "" || session.TeamID == "" || session.ProductID == "" || session.AccessToken == "" || !session.ExpiresAt.After(time.Now()) { + return out, violation("sessionFile", "An explicit, unexpired user OAuth session with uid, teamId, productId, accessToken and expiresAt is required.") + } + if r.ProjectID != "" && r.ProjectID != session.ProductID { + return out, violation("projectId", "Selected project does not match the OAuth session productId.") + } + base := r.BaseURL + if base == "" { + base = session.ProjectBaseURL + } + u, err := url.Parse(base) + if err != nil || u.Host == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || (u.Scheme != "https" && !(u.Scheme == "http" && (u.Hostname() == "127.0.0.1" || u.Hostname() == "localhost"))) { + return out, violation("baseUrl", "Supply the project's HTTPS base URL; only loopback HTTP is allowed for isolated tests.") + } + client := c.HTTP + if client == nil { + client = &http.Client{Timeout: 60 * time.Second} + } + clone := *client + clone.CheckRedirect = func(next *http.Request, via []*http.Request) error { + if len(via) > 0 && (next.URL.Host != via[0].URL.Host || next.URL.Scheme != via[0].URL.Scheme) { + return fmt.Errorf("cross-origin OAuth redirect refused") + } + if len(via) >= 10 { + return fmt.Errorf("too many redirects") + } + return nil + } + client = &clone + prefix := strings.TrimRight(base, "/") + "/api/wisefunction/serverless/v1/functions" + named := prefix + "/" + url.PathEscape(r.Name) + request := func(method, target, ctype string, body io.Reader, headers map[string]string) (json.RawMessage, error) { + h, err := http.NewRequestWithContext(ctx, method, target, body) + if err != nil { + return nil, err + } + if file, ok := body.(*os.File); ok { + if info, statErr := file.Stat(); statErr == nil { + h.ContentLength = info.Size() + } + } + h.Header.Set("uid", session.UID) + h.Header.Set("teamId", session.TeamID) + h.Header.Set("productId", session.ProductID) + h.Header.Set("oauth2Token", session.AccessToken) + h.Header.Set("X-HD-DATE", time.Now().UTC().Format("20060102T150405Z")) + h.Header.Set("Accept", "application/json") + h.Header.Set("User-Agent", "agc-cli/native-functions") + trace := make([]byte, 16) + if _, err = rand.Read(trace); err != nil { + return nil, err + } + h.Header.Set("x-trace-id", hex.EncodeToString(trace)) + if ctype != "" { + h.Header.Set("Content-Type", ctype) + } + for k, v := range headers { + h.Header.Set(k, v) + } + resp, err := client.Do(h) + if err != nil { + return nil, fmt.Errorf("native function transport failed: %w", err) + } + defer resp.Body.Close() + out.StatusCode = resp.StatusCode + out.TraceID = h.Header.Get("x-trace-id") + out.ExecutionStatus = resp.Header.Get("x-function-execution-status") + out.ExecutedVersion = resp.Header.Get("x-executed-version") + data, err := io.ReadAll(io.LimitReader(resp.Body, (16<<20)+1)) + if err != nil { + return nil, err + } + if len(data) > 16<<20 { + return nil, fmt.Errorf("native function response exceeds the 16 MiB local implementation limit; refusing truncated success") + } + if resp.StatusCode >= 400 { + return nil, agcapi.ParseAGCError(resp.StatusCode, data) + } + var obj map[string]json.RawMessage + if op != "invoke" && json.Unmarshal(data, &obj) == nil { + for _, key := range []string{"code", "error_code"} { + var code any + if json.Unmarshal(obj[key], &code) == nil && fmt.Sprint(code) != "0" && fmt.Sprint(code) != "" { + return nil, agcapi.ParseAGCError(resp.StatusCode, data) + } + } + } + if out.ExecutionStatus != "" && !strings.EqualFold(out.ExecutionStatus, "success") && out.ExecutionStatus != "0" { + return nil, fmt.Errorf("function execution failed (HTTP %d, execution status %s)", resp.StatusCode, out.ExecutionStatus) + } + return data, nil + } + getLatest := func() (map[string]json.RawMessage, error) { + data, err := request("GET", named+"?qualifier=%24latest", "", nil, nil) + if err != nil { + return nil, err + } + var root struct { + Function map[string]json.RawMessage `json:"function"` + } + if json.Unmarshal(data, &root) != nil || root.Function == nil { + return nil, fmt.Errorf("function query omitted function model") + } + var rev string + if json.Unmarshal(root.Function["revisionId"], &rev) != nil || rev == "" { + return nil, fmt.Errorf("function query omitted revisionId; refusing write") + } + return root.Function, nil + } + publish := func(revision json.RawMessage) (json.RawMessage, error) { + var rev string + if json.Unmarshal(revision, &rev) != nil || rev == "" { + return nil, fmt.Errorf("missing revisionId; refusing publish") + } + b, _ := json.Marshal(map[string]string{"revisionId": rev, "versionDesc": r.VersionDescription}) + return request("POST", named+"/versions", "application/json", bytes.NewReader(b), nil) + } + update := func(prior map[string]json.RawMessage, create bool) (json.RawMessage, error) { + // A temporary multipart file bounds memory even for deployment ZIPs. + f, err := os.CreateTemp("", "agc-function-*.multipart") + if err != nil { + return nil, err + } + defer os.Remove(f.Name()) + defer f.Close() + w := multipart.NewWriter(f) + fields := map[string]string{} + headers := map[string]string{} + if create { + fields["name"] = r.Name + runtime := r.Runtime + if runtime == "" { + runtime = "nodejs14.x" + } + fields["runtime"] = runtime + fields["memory"] = "500" + fields["cpu"] = "500" + fields["timeout"] = "55" + fields["instanceConcurrency"] = "100" + fields["handler"] = "handler.myHandler" + if runtime == "java1.8" { + fields["handler"] = "faas.HelloPojo::handleRequest" + } + if runtime == "custom-runtime" { + fields["handler"] = "/invoke" + } + if r.Description != "" { + fields["description"] = r.Description + } + } else { + for _, k := range []string{"revisionId", "environment", "layers", "handler"} { + raw := prior[k] + if len(raw) == 0 { + continue + } + if k == "handler" || k == "revisionId" { + var text string + if json.Unmarshal(raw, &text) != nil { + return nil, fmt.Errorf("invalid prior %s model", k) + } + fields[k] = text + } else { + fields[k] = string(raw) + } + } + } + if r.Handler != nil { + fields["handler"] = *r.Handler + } + if r.Memory != nil { + fields["memory"] = strconv.Itoa(*r.Memory) + fields["cpu"] = strconv.Itoa(map[int]int{500: 500, 1000: 500, 2000: 1000, 4000: 2000}[*r.Memory]) + } + if r.Timeout != nil { + fields["timeout"] = strconv.Itoa(*r.Timeout) + } + if r.InstanceConcurrency != nil { + fields["instanceConcurrency"] = strconv.Itoa(*r.InstanceConcurrency) + } + if r.VersionDescription != "" { + fields["versionDesc"] = r.VersionDescription + } + if r.Environment != nil { + b, _ := json.Marshal(*r.Environment) + fields["environment"] = string(b) + } + if r.Layers != nil { + layers := []string{} + for _, l := range *r.Layers { + + pieces := strings.Split(l, ":") + if len(pieces) != 2 && len(pieces) != 7 { + return nil, violation("layers", "Use layerName:version or a complete layer URN.") + } + target := strings.TrimRight(base, "/") + "/api/wisefunction/serverless/v1/layers/" + url.PathEscape(strings.Join(pieces[:len(pieces)-1], ":")) + "/versions/" + url.PathEscape(pieces[len(pieces)-1]) + raw, err := request("GET", target, "", nil, nil) + if err != nil { + return nil, err + } + var response struct { + Result struct { + LayerVersionUrn string `json:"layerVersionUrn"` + DeletedFlag bool `json:"deletedFlag"` + } `json:"result"` + } + if json.Unmarshal(raw, &response) != nil || response.Result.DeletedFlag { + return nil, fmt.Errorf("layer unavailable or deleted") + } + urn := response.Result.LayerVersionUrn + if urn == "" { + return nil, fmt.Errorf("layer query omitted layerVersionUrn") + } + layers = append(layers, urn) + } + b, _ := json.Marshal(layers) + fields["layers"] = string(b) + } + for k, v := range fields { + if err = w.WriteField(k, v); err != nil { + return nil, err + } + } + if r.CodePath != "" { + source, err := os.Open(r.CodePath) + if err != nil { + return nil, err + } + defer source.Close() + part, err := w.CreateFormFile("file", filepath.Base(r.CodePath)) + if err != nil { + return nil, err + } + hash := sha256.New() + n, err := io.Copy(io.MultiWriter(part, hash), source) + if err != nil { + return nil, err + } + headers["x-file-digest"] = strconv.FormatInt(n, 10) + headers["x-file-digest-sha256"] = hex.EncodeToString(hash.Sum(nil)) + } + if err = w.Close(); err != nil { + return nil, err + } + if _, err = f.Seek(0, 0); err != nil { + return nil, err + } + method, target := "PUT", named + if create { + method, target = "POST", prefix + } + return request(method, target, w.FormDataContentType(), f, headers) + } + var data json.RawMessage + switch op { + case "create-function": + data, err = update(nil, true) + case "invoke": + qualifier := r.Version + if qualifier == "" { + qualifier = "$latest" + } + if r.AliasName != "" { + qualifier = r.AliasName + } + payload := r.Payload + if len(payload) == 0 { + payload = json.RawMessage(`{}`) + } + data, err = request("POST", named+"/invocations?qualifier="+url.QueryEscape(qualifier), "application/json", bytes.NewReader(payload), nil) + case "list-functions", "list-function-versions": + size, index := r.PageSize, r.PageIndex + if size == 0 { + size = 10 + } + if index == 0 { + index = 1 + } + query := url.Values{"pageSize": {strconv.Itoa(size)}, "pageIndex": {strconv.Itoa(index)}} + target := named + "/versions" + if op == "list-functions" { + target = prefix + query.Set("qualifier", "$latest") + query.Set("status", "1") + if r.FuzzyName != "" { + query.Set("name", r.FuzzyName) + } + } + data, err = request("GET", target+"?"+query.Encode(), "", nil, nil) + case "query-function-version": + v := r.Version + if v == "" { + v = "$latest" + } + data, err = request("GET", named+"?qualifier="+url.QueryEscape(v), "", nil, nil) + default: + var prior map[string]json.RawMessage + prior, err = getLatest() + if err != nil { + break + } + if op == "publish-function" { + data, err = publish(prior["revisionId"]) + out.Published = err == nil + break + } + if op == "update-and-publish-function" && !hasUpdate(r) { + data, err = publish(prior["revisionId"]) + out.Published = err == nil + break + } + data, err = update(prior, false) + if err != nil { + break + } + out.Updated = true + if op == "update-and-publish-function" { + var changed struct { + Function map[string]json.RawMessage `json:"function"` + } + json.Unmarshal(data, &changed) + data, err = publish(changed.Function["revisionId"]) + out.Published = err == nil + if err != nil { + err = fmt.Errorf("update succeeded; publish failed; do not blindly repeat update: %w", err) + } + } + } + if err != nil { + return out, err + } + if op == "invoke" { + if json.Valid(data) { + out.Body = append(json.RawMessage(nil), data...) + } else { + out.Body, _ = json.Marshal(string(data)) + } + } else { + out.Body = redacted(data) + } + return out, nil +} +func redacted(data []byte) json.RawMessage { + var obj any + dec := json.NewDecoder(bytes.NewReader(data)) + dec.UseNumber() + if dec.Decode(&obj) != nil { + b, _ := json.Marshal(string(data)) + return b + } + var clean func(any) + clean = func(x any) { + switch v := x.(type) { + case map[string]any: + for k, c := range v { + switch strings.ToLower(k) { + case "environment", "accesstoken", "oauth2token", "uid", "teamid": + delete(v, k) + default: + clean(c) + } + } + case []any: + for _, c := range v { + clean(c) + } + } + } + clean(obj) + b, _ := json.Marshal(obj) + return b +} + +func agcliWidth(s string) int { + width := 0 + for _, unit := range utf16.Encode([]rune(s)) { + if unit <= 128 { + width++ + } else { + width += 2 + } + } + return width +} diff --git a/pkg/cloudfunctions/client_test.go b/pkg/cloudfunctions/client_test.go new file mode 100644 index 0000000..1ba445b --- /dev/null +++ b/pkg/cloudfunctions/client_test.go @@ -0,0 +1,330 @@ +package cloudfunctions + +import ( + "archive/zip" + "bytes" + "context" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strconv" + "strings" + "testing" + "time" + + "github.com/Createitv/agc-cli/pkg/domain" +) + +func testZIP(t *testing.T) string { + t.Helper() + p := filepath.Join(t.TempDir(), "func.zip") + f, _ := os.Create(p) + w := zip.NewWriter(f) + e, _ := w.Create("handler.js") + e.Write([]byte("exports.myHandler = () => 1")) + w.Close() + f.Close() + return p +} +func offlineSession() Session { + return Session{UID: "offline-user", TeamID: "offline-team", ProductID: "offline-project", AccessToken: "offline-oauth", ExpiresAt: time.Now().Add(time.Hour)} +} +func TestNativeFunctionEveryWorkflow(t *testing.T) { + for _, op := range domain.FunctionOperations { + t.Run(op, func(t *testing.T) { + calls := []string{} + file := testZIP(t) + fileData, _ := os.ReadFile(file) + sum := sha256.Sum256(fileData) + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + calls = append(calls, r.Method+" "+r.URL.Path) + if r.Header.Get("oauth2Token") != "offline-oauth" || r.Header.Get("Authorization") != "" || r.Header.Get("productId") != "offline-project" { + t.Error("wrong OAuth headers") + } + w.Header().Set("Content-Type", "application/json") + if r.Method == "PUT" || r.Method == "POST" && strings.HasSuffix(r.URL.Path, "/functions") { + if err := r.ParseMultipartForm(2 << 20); err != nil { + t.Fatal(err) + } + if r.Method == "PUT" { + if r.FormValue("revisionId") != "r1" || r.FormValue("handler") != "handler.original" || r.FormValue("environment") != `{"KEEP":"private"}` || r.FormValue("layers") != `["urn:keep:1"]` { + t.Error("lost prior revision/config") + } + } + if op == "create-function" || op == "update-function-code" || op == "update-and-publish-function" { + f, _, err := r.FormFile("file") + if err != nil { + t.Fatal(err) + } + b, _ := io.ReadAll(f) + if !bytes.Equal(b, fileData) || r.Header.Get("x-file-digest-sha256") != hex.EncodeToString(sum[:]) { + t.Error("ZIP/digest mismatch") + } + } + w.Write([]byte(`{"function":{"revisionId":"r2","environment":{"SECRET":"private"}}}`)) + return + } + if strings.HasSuffix(r.URL.Path, "/invocations") { + b, _ := io.ReadAll(r.Body) + if string(b) != `[9007199254740993,"hello"]` { + t.Errorf("payload corrupted %s", b) + } + w.Header().Set("x-function-execution-status", "success") + w.Write([]byte(`{"result":1}`)) + return + } + if r.Method == "POST" && strings.HasSuffix(r.URL.Path, "/versions") { + var b map[string]string + json.NewDecoder(r.Body).Decode(&b) + want := "r1" + if op == "update-and-publish-function" { + want = "r2" + } + if b["revisionId"] != want { + t.Errorf("publish revision=%s", b["revisionId"]) + } + w.Write([]byte(`{"function":{"version":"1"}}`)) + return + } + w.Write([]byte(`{"function":{"revisionId":"r1","handler":"handler.original","environment":{"KEEP":"private"},"layers":["urn:keep:1"]}}`)) + })) + defer srv.Close() + c := Client{HTTP: srv.Client(), Session: offlineSession()} + req := domain.FunctionRequest{Name: "test-func", BaseURL: srv.URL, ProjectID: "offline-project", VersionDescription: "test", Payload: json.RawMessage(`[9007199254740993,"hello"]`)} + if op == "create-function" || op == "update-function-code" || op == "update-and-publish-function" { + req.CodePath = file + } + m := 1000 + if op == "update-function-config" { + req.Memory = &m + } + resp, err := c.Execute(context.Background(), op, req) + if err != nil { + t.Fatal(err) + } + b, _ := json.Marshal(resp) + if strings.Contains(string(b), "private") || strings.Contains(string(b), "offline-oauth") { + t.Error("response leaked authorization/environment") + } + if len(calls) == 0 { + t.Fatal("no actual HTTP exchange") + } + if (op == "publish-function" || op == "update-function-code" || op == "update-function-config") && len(calls) != 2 { + t.Fatalf("expected revision read before write: %v", calls) + } + if op == "update-and-publish-function" && len(calls) != 3 { + t.Fatalf("expected read/update/publish: %v", calls) + } + }) + } +} +func TestUpdateFailureNeverPublishes(t *testing.T) { + calls := 0 + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + calls++ + if r.Method == "GET" { + w.Write([]byte(`{"function":{"revisionId":"r1"}}`)) + return + } + w.WriteHeader(409) + w.Write([]byte(`{"code":"CONFLICT","message":"revision conflict"}`)) + })) + defer s.Close() + n := 1000 + _, err := (&Client{HTTP: s.Client(), Session: offlineSession()}).Execute(context.Background(), "update-and-publish-function", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL, VersionDescription: "test", Memory: &n}) + if err == nil || calls != 2 { + t.Fatalf("conflict must stop, calls=%d err=%v", calls, err) + } +} +func TestNativeFunctionDryRunNeverLoadsSession(t *testing.T) { + _, err := (&Client{}).Execute(context.Background(), "invoke", domain.FunctionRequest{Name: "test-func", SessionFile: "/must/not/read", DryRun: true}) + if err != nil { + t.Fatal(err) + } +} +func TestFunctionInvalidBeforeAuthentication(t *testing.T) { + for _, r := range []domain.FunctionRequest{{Name: "BAD"}, {Name: "test-func", Payload: json.RawMessage(`{`)}, {Name: "test-func", Version: "bad"}, {Name: "test-func", ProjectID: "wrong"}} { + _, err := (&Client{Session: offlineSession()}).Execute(context.Background(), "invoke", r) + if err == nil { + t.Fatal("invalid input accepted") + } + } +} + +func TestPublishFailureReportsAppliedUpdate(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case "GET": + w.Write([]byte(`{"function":{"revisionId":"r1","handler":"handler.myHandler"}}`)) + case "PUT": + w.Write([]byte(`{"function":{"revisionId":"r2"}}`)) + case "POST": + w.WriteHeader(409) + w.Write([]byte(`{"code":"CONFLICT"}`)) + } + })) + defer s.Close() + m := 1000 + result, err := (&Client{HTTP: s.Client(), Session: offlineSession()}).Execute(context.Background(), "update-and-publish-function", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL, VersionDescription: "test", Memory: &m}) + if err == nil || !result.Updated || result.Published || !strings.Contains(err.Error(), "update succeeded") { + t.Fatalf("partial state lost: %+v %v", result, err) + } +} +func TestLayerReferencesResolveThroughDocumentedResultWrapper(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if strings.Contains(r.URL.Path, "/layers/") { + w.Write([]byte(`{"code":0,"result":{"layerVersionUrn":"urn:resolved:1","deletedFlag":false}}`)) + return + } + if r.Method == "GET" { + w.Write([]byte(`{"function":{"revisionId":"r1","handler":"handler.myHandler"}}`)) + return + } + r.ParseMultipartForm(1 << 20) + if r.FormValue("layers") != `["urn:resolved:1"]` { + t.Error("resolved layer lost") + } + w.Write([]byte(`{"function":{"revisionId":"r2"}}`)) + })) + defer s.Close() + layers := []string{"test-layer:1"} + _, err := (&Client{HTTP: s.Client(), Session: offlineSession()}).Execute(context.Background(), "update-function-config", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL, Layers: &layers}) + if err != nil { + t.Fatal(err) + } +} +func TestInvokeFailureHeaderIsIndependentOfHTTP200(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("x-function-execution-status", "failed") + w.Write([]byte(`{"message":"failed"}`)) + })) + defer s.Close() + r, err := (&Client{HTTP: s.Client(), Session: offlineSession()}).Execute(context.Background(), "invoke", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL}) + if err == nil || r.StatusCode != 200 || r.ExecutionStatus != "failed" { + t.Fatalf("execution failed unnoticed: %+v %v", r, err) + } +} +func TestNativeOAuthRedirectCannotReachOtherOrigin(t *testing.T) { + leaked := false + target := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { leaked = true })) + defer target.Close() + source := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, target.URL, 307) })) + defer source.Close() + _, err := (&Client{Session: offlineSession()}).Execute(context.Background(), "invoke", domain.FunctionRequest{Name: "test-func", BaseURL: source.URL}) + if err == nil || leaked { + t.Fatal("cross-origin OAuth redirect allowed") + } +} + +func TestSourceDocumentedFunctionInputBounds(t *testing.T) { + n := func(v int) *int { return &v } + text := func(v string) *string { return &v } + env := map[string]string{"INVALID KEY": "value"} + layers := []string{"bad"} + tooMany := []string{"a:1", "b:1", "c:1", "d:1", "e:1", "f:1"} + tests := []struct { + name, op string + r domain.FunctionRequest + }{ + {"memory", "invoke", domain.FunctionRequest{Name: "test-func", Memory: n(512)}}, {"timeout-low", "invoke", domain.FunctionRequest{Name: "test-func", Timeout: n(0)}}, {"timeout-high", "invoke", domain.FunctionRequest{Name: "test-func", Timeout: n(1801)}}, {"concurrency", "invoke", domain.FunctionRequest{Name: "test-func", InstanceConcurrency: n(1001)}}, {"runtime", "create-function", domain.FunctionRequest{Name: "test-func", Runtime: "unknown"}}, {"description", "invoke", domain.FunctionRequest{Name: "test-func", Description: strings.Repeat("中", 33)}}, {"alias-version", "invoke", domain.FunctionRequest{Name: "test-func", Version: "1", AliasName: "live"}}, {"alias", "invoke", domain.FunctionRequest{Name: "test-func", AliasName: "BAD"}}, {"version", "invoke", domain.FunctionRequest{Name: "test-func", Version: "1001"}}, {"handler", "invoke", domain.FunctionRequest{Name: "test-func", Handler: text("")}}, {"environment", "invoke", domain.FunctionRequest{Name: "test-func", Environment: &env}}, {"layer-format", "invoke", domain.FunctionRequest{Name: "test-func", Layers: &layers}}, {"layer-limit", "invoke", domain.FunctionRequest{Name: "test-func", Layers: &tooMany}}, {"page-size", "list-functions", domain.FunctionRequest{PageSize: 1001}}, {"page-index", "list-functions", domain.FunctionRequest{PageIndex: -1}}, {"filter", "list-functions", domain.FunctionRequest{FuzzyName: "BAD"}}, {"missing-code", "create-function", domain.FunctionRequest{Name: "test-func"}}, {"missing-description", "publish-function", domain.FunctionRequest{Name: "test-func"}}, {"no-update", "update-function-config", domain.FunctionRequest{Name: "test-func"}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.r.DryRun = true + if _, err := (&Client{}).Execute(context.Background(), tt.op, tt.r); err == nil { + t.Fatal("invalid documented input accepted") + } + }) + } +} +func TestExplicitSessionFileExpiryAndProjectIsolation(t *testing.T) { + for _, kind := range []string{"expired", "project-mismatch", "invalid-json", "missing"} { + t.Run(kind, func(t *testing.T) { + p := filepath.Join(t.TempDir(), "session.json") + s := offlineSession() + if kind == "expired" { + s.ExpiresAt = time.Now().Add(-time.Hour) + } + b, _ := json.Marshal(s) + if kind == "invalid-json" { + b = []byte(`{"accessToken":`) + } + if kind != "missing" { + os.WriteFile(p, b, 0600) + } + r := domain.FunctionRequest{Name: "test-func", SessionFile: p} + if kind == "project-mismatch" { + r.ProjectID = "wrong" + } + _, err := (&Client{}).Execute(context.Background(), "invoke", r) + if err == nil || strings.Contains(err.Error(), "offline-oauth") { + t.Fatalf("session boundary failed %v", err) + } + }) + } +} + +func TestConfigUpdateAllowsOnlyVersionDescription(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method == "GET" { + w.Write([]byte(`{"function":{"revisionId":"r1","handler":"handler.myHandler"}}`)) + return + } + r.ParseMultipartForm(1 << 20) + if r.FormValue("versionDesc") != "new description" { + t.Error("description omitted") + } + w.Write([]byte(`{"function":{"revisionId":"r2"}}`)) + })) + defer s.Close() + _, err := (&Client{HTTP: s.Client(), Session: offlineSession()}).Execute(context.Background(), "update-function-config", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL, VersionDescription: "new description"}) + if err != nil { + t.Fatal(err) + } +} + +func TestInvocationPreservesArbitraryApplicationJSON(t *testing.T) { + want := `{"code":17,"uid":"application-user","environment":{"label":"business-result"}}` + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(want)) })) + defer s.Close() + result, err := (&Client{Session: offlineSession()}).Execute(context.Background(), "invoke", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL}) + if err != nil || string(result.Body) != want { + t.Fatalf("application result was misinterpreted/redacted: %s %v", result.Body, err) + } +} +func TestMemoryCPUAllocationMatchesVendorParser(t *testing.T) { + for memory, cpu := range map[int]string{500: "500", 1000: "500", 2000: "1000", 4000: "2000"} { + t.Run(cpu+"-"+strconv.Itoa(memory), func(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method == "GET" { + w.Write([]byte(`{"function":{"revisionId":"r1"}}`)) + return + } + r.ParseMultipartForm(1 << 20) + if r.FormValue("cpu") != cpu { + t.Errorf("memory %d requires cpu %s, got %q", memory, cpu, r.FormValue("cpu")) + } + w.Write([]byte(`{"function":{"revisionId":"r2"}}`)) + })) + defer s.Close() + _, err := (&Client{Session: offlineSession()}).Execute(context.Background(), "update-function-config", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL, Memory: &memory}) + if err != nil { + t.Fatal(err) + } + }) + } +} + +func TestOversizedInvocationFailsInsteadOfTruncating(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { io.WriteString(w, strings.Repeat("x", (16<<20)+1)) })) + defer s.Close() + _, err := (&Client{Session: offlineSession()}).Execute(context.Background(), "invoke", domain.FunctionRequest{Name: "test-func", BaseURL: s.URL}) + if err == nil || !strings.Contains(err.Error(), "16 MiB") { + t.Fatalf("oversize success/truncation: %v", err) + } +} diff --git a/pkg/cloudfunctions/feedback.go b/pkg/cloudfunctions/feedback.go new file mode 100644 index 0000000..b865d0c --- /dev/null +++ b/pkg/cloudfunctions/feedback.go @@ -0,0 +1,37 @@ +package cloudfunctions + +import ( + "errors" + + "github.com/Createitv/agc-cli/pkg/agcapi" + "github.com/Createitv/agc-cli/pkg/domain" +) + +// Feedback never includes OAuth sessions, function configuration or raw upstream +// credential responses. Wrapped publish failures retain the upstream code. +func Feedback(operation string, err error) domain.ErrorDetail { + detail := domain.ErrorDetail{Code: "function_transport_failed", Message: err.Error(), Endpoint: "functions/" + operation, SourceURL: "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", DocumentationCommand: "agc functions " + operation + " --docs --pretty", Suggestion: "Check the selected project service URL and transport; do not blindly retry a write."} + var invalid *agcapi.RequestValidationError + if errors.As(err, &invalid) { + detail.Code = "invalid_request" + detail.Violations = invalid.Violations + detail.Suggestion = "Correct the affected field using the documentation command before retrying." + for _, v := range invalid.Violations { + if v.Field == "sessionFile" { + detail.Code = "authentication_required" + detail.Suggestion = "Explicitly select an unexpired user OAuth session for the dedicated project." + } + } + } + var upstream agcapi.AGCError + if errors.As(err, &upstream) { + detail.Code = upstream.Code + if detail.Code == "" { + detail.Code = "upstream_error" + } + detail.CodeField = upstream.CodeField + detail.ResultCodes = upstream.ResultCodes + detail.Suggestion = "Review the upstream role, function state and documented prerequisites; retain the revision after a successful update." + } + return detail +} diff --git a/pkg/domain/capability_test.go b/pkg/domain/capability_test.go index 896ebf3..bc54e0b 100644 --- a/pkg/domain/capability_test.go +++ b/pkg/domain/capability_test.go @@ -4,7 +4,7 @@ import "testing" func TestDecoratedCapabilitiesExposeAllOfficialFamilies(t *testing.T) { capabilities := DecoratedCapabilities() - if got, want := len(capabilities), 13; got != want { + if got, want := len(capabilities), 21; got != want { t.Fatalf("len(capabilities) = %d, want %d", got, want) } for _, capability := range capabilities { diff --git a/pkg/domain/cloud_functions_test.go b/pkg/domain/cloud_functions_test.go new file mode 100644 index 0000000..929aa80 --- /dev/null +++ b/pkg/domain/cloud_functions_test.go @@ -0,0 +1,27 @@ +package domain + +import "testing" + +func TestCloudFunctionsDiscoveryAndNativeContract(t *testing.T) { + c, ok := CapabilityByID("functions") + if !ok || c.EndpointCount != 29 { + t.Fatal("functions family with 9 native workflows and 20 management transports missing") + } + for _, id := range []string{"create-function", "update-function-code", "update-function-config", "publish-function", "update-and-publish-function", "invoke", "list-functions", "query-function-version", "list-function-versions"} { + e, ok := EndpointByID("functions", id) + if !ok || e.Authentication != "agcli-user-oauth" || e.Source != "Huawei official AGCLI 1.12.0 source" { + t.Fatalf("missing source/auth contract for %s: %+v", id, e) + } + if _, ok := EndpointReference("functions", id); !ok { + t.Fatalf("source evidence missing for %s", id) + } + } + spec := OpenAPISpec() + paths := spec["paths"].(map[string]any) + op := paths["/api/v1/functions/endpoints/invoke/invoke"].(map[string]any)["post"].(map[string]any) + schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + props := schema["properties"].(map[string]any) + if props["payload"] == nil || props["sessionFile"] == nil || props["name"] == nil { + t.Fatal("native request fields missing in OpenAPI") + } +} diff --git a/pkg/domain/domain_contract_test.go b/pkg/domain/domain_contract_test.go new file mode 100644 index 0000000..760c3a9 --- /dev/null +++ b/pkg/domain/domain_contract_test.go @@ -0,0 +1,18 @@ +package domain + +import "testing" + +func TestDomainWriteRequiresHeaderAppAndQueryCategory(t *testing.T) { + e, _ := EndpointByID("domains", "domain-api-post-domain") + for _, expected := range []struct{ name, where string }{{"appId", "header"}, {"category", "query"}} { + found := false + for _, p := range e.Parameters { + if p.Name == expected.name && p.In == expected.where && p.Required { + found = true + } + } + if !found { + t.Errorf("missing required %s in %s", expected.name, expected.where) + } + } +} diff --git a/pkg/domain/draft_update_contract_test.go b/pkg/domain/draft_update_contract_test.go new file mode 100644 index 0000000..ec4d505 --- /dev/null +++ b/pkg/domain/draft_update_contract_test.go @@ -0,0 +1,18 @@ +package domain + +import "testing" + +func TestDraftUpdateRequiresAppQueryAndVersionBody(t *testing.T) { + e, _ := EndpointByID("testing", "test-api-modify-test-version") + for _, expected := range []struct{ name, where string }{{"appId", "query"}, {"versionId", "body"}} { + found := false + for _, p := range e.Parameters { + if p.Name == expected.name && p.In == expected.where && p.Required { + found = true + } + } + if !found { + t.Errorf("missing required %s in %s", expected.name, expected.where) + } + } +} diff --git a/pkg/domain/endpoint.go b/pkg/domain/endpoint.go index ebc15b1..5428b7b 100644 --- a/pkg/domain/endpoint.go +++ b/pkg/domain/endpoint.go @@ -3,35 +3,61 @@ package domain import "strings" type Endpoint struct { - ID string `json:"id"` - FamilyID string `json:"familyId"` - Name string `json:"name"` - Description string `json:"description"` - Method string `json:"method"` - Path string `json:"path"` - Command string `json:"command"` - RequiredParams []string `json:"requiredParams,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` - Body string `json:"body,omitempty"` - Status string `json:"status"` - Source string `json:"source,omitempty"` - SourceURL string `json:"sourceUrl,omitempty"` - OfficialSlug string `json:"officialSlug,omitempty"` - Direction string `json:"direction,omitempty"` - Links map[string]Link `json:"_links,omitempty"` - Affordances map[string]string `json:"affordances,omitempty"` + DefaultBaseURL string `json:"defaultBaseUrl,omitempty"` + Authentication string `json:"authentication,omitempty"` + DynamicBody *Parameter `json:"dynamicBody,omitempty"` + DynamicBodyKeyPattern string `json:"dynamicBodyKeyPattern,omitempty"` + RequestContentType string `json:"requestContentType,omitempty"` + Documentation *ReferenceSummary `json:"documentation,omitempty"` + Rules []ReferenceRule `json:"rules,omitempty"` + ID string `json:"id"` + FamilyID string `json:"familyId"` + Name string `json:"name"` + Description string `json:"description"` + Method string `json:"method"` + Path string `json:"path"` + Command string `json:"command"` + RequiredParams []string `json:"requiredParams,omitempty"` + Parameters []Parameter `json:"parameters,omitempty"` + Body string `json:"body,omitempty"` + Status string `json:"status"` + Source string `json:"source,omitempty"` + SourceURL string `json:"sourceUrl,omitempty"` + OfficialSlug string `json:"officialSlug,omitempty"` + Direction string `json:"direction,omitempty"` + Links map[string]Link `json:"_links,omitempty"` + Affordances map[string]string `json:"affordances,omitempty"` } type Parameter struct { - MinItems int `json:"minItems,omitempty"` - MaxItems int `json:"maxItems,omitempty"` - ItemsType string `json:"itemsType,omitempty"` - Type string `json:"type,omitempty"` - Format string `json:"format,omitempty"` - Name string `json:"name"` - In string `json:"in"` - Required bool `json:"required"` - Description string `json:"description,omitempty"` + AdditionalProperties *Parameter `json:"additionalProperties,omitempty"` + PropertyNamesPattern string `json:"propertyNamesPattern,omitempty"` + MinProperties int `json:"minProperties,omitempty"` + MaxProperties int `json:"maxProperties,omitempty"` + Pattern string `json:"pattern,omitempty"` + ItemsEnum []string `json:"itemsEnum,omitempty"` + EncodedJSON *Parameter `json:"encodedJson,omitempty"` + ItemsPattern string `json:"itemsPattern,omitempty"` + ItemsMaxLength int `json:"itemsMaxLength,omitempty"` + Properties []Parameter `json:"properties,omitempty"` + ItemsRules []ReferenceRule `json:"itemsRules,omitempty"` + ItemsProperties []Parameter `json:"itemsProperties,omitempty"` + SourceURL string `json:"sourceUrl,omitempty"` + MaxLength int `json:"maxLength,omitempty"` + MinLength int `json:"minLength,omitempty"` + Minimum *int64 `json:"minimum,omitempty"` + Maximum *int64 `json:"maximum,omitempty"` + Enum []string `json:"enum,omitempty"` + AllowEmpty bool `json:"allowEmpty,omitempty"` + MinItems int `json:"minItems,omitempty"` + MaxItems int `json:"maxItems,omitempty"` + ItemsType string `json:"itemsType,omitempty"` + Type string `json:"type,omitempty"` + Format string `json:"format,omitempty"` + Name string `json:"name"` + In string `json:"in"` + Required bool `json:"required"` + Description string `json:"description,omitempty"` } func endpoint(familyID, id, name, description, method, path string, requiredParams []string) Endpoint { @@ -64,13 +90,21 @@ func officialEndpoint(familyID, id, name, description, method, path string, requ endpoint.OfficialSlug = slug endpoint.SourceURL = sourceURL endpoint.Direction = direction + if familyID == "gameplay" && id == "resources" { + endpoint.DefaultBaseURL = "https://jos-open-api.cloud.huawei.com" + endpoint.RequestContentType = "application/x-www-form-urlencoded" + endpoint.Authentication = "body-signature" + } + if familyID == "game-items" && (id == "propapi-getroleinfo" || id == "propapi-order") { + endpoint.RequestContentType = "application/x-www-form-urlencoded; charset=UTF-8" + } if direction == "inbound-callback" { endpoint.Source = "Huawei AppGallery Connect inbound callback reference" } if direction == "local" { endpoint.Source = "agc-cli local integration" } - return endpoint + return applyReferenceParameters(endpoint) } func inferParameters(method, path string, requiredParams []string) []Parameter { @@ -95,9 +129,6 @@ func inferParameters(method, path string, requiredParams []string) []Parameter { } func inferBody(method string, parameters []Parameter) string { - if !methodNeedsBody(method) { - return "" - } fields := []string{} for _, parameter := range parameters { if parameter.In == "body" || parameter.In == "file" { @@ -105,6 +136,9 @@ func inferBody(method string, parameters []Parameter) string { } } if len(fields) == 0 { + if !methodNeedsBody(method) { + return "" + } return "json" } return strings.Join(fields, ",") @@ -141,6 +175,7 @@ func EndpointCount() int { } func decorateEndpoint(endpoint Endpoint) Endpoint { + endpoint = attachReference(endpoint) href := "/api/v1/" + endpoint.FamilyID + "/endpoints/" + endpoint.ID endpoint.Links = map[string]Link{ "self": {Href: href, Method: "GET"}, @@ -149,6 +184,25 @@ func decorateEndpoint(endpoint Endpoint) Endpoint { endpoint.Affordances = map[string]string{ "show": endpoint.Command + " --pretty", } + if strings.HasPrefix(endpoint.RequestContentType, "application/x-www-form-urlencoded") { + endpoint.Affordances["formInput"] = "Supply raw unescaped values using --field or a JSON object using --body; the CLI performs UTF-8 form encoding once." + } + if endpoint.Authentication == "agcli-user-oauth" { + endpoint.Affordances["invoke"] = endpoint.Command + " --invoke --name FUNCTION --session-file SESSION.json" + endpoint.Affordances["docs"] = endpoint.Command + " --docs --pretty" + return endpoint + } + if strings.HasPrefix(endpoint.Authentication, "agcli-management-") { + endpoint.Affordances["invoke"] = endpoint.Command + " --invoke --session-file SESSION.json" + if endpoint.Body != "" { + endpoint.Affordances["invoke"] += " --body body.json" + } + endpoint.Affordances["docs"] = endpoint.Command + " --docs --pretty" + if endpoint.FamilyID == "clouddb" && endpoint.ID == "import-object-types" { + endpoint.Affordances["formInput"] = "Supply raw schema JSON with --body. The reviewed vendor uses raw JSON bytes with a form Content-Type; no form encoding is performed." + } + return endpoint + } if methodNeedsBody(endpoint.Method) { endpoint.Affordances["invoke"] = endpoint.Command + " --invoke --body body.json" } else { diff --git a/pkg/domain/endpoint_catalog.go b/pkg/domain/endpoint_catalog.go index a330f61..702687e 100644 --- a/pkg/domain/endpoint_catalog.go +++ b/pkg/domain/endpoint_catalog.go @@ -2,6 +2,10 @@ package domain var EndpointFamilies = map[string][]Endpoint{ "publishing": { + // 查询 HarmonyOS 软件包的异步解析结果;successStatus=0 才表示正常。 + // 请求:GET /api/publish/v3/package/compile/status;调用方向:开发者调用华为服务端。 + // 官方文档:https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434 + officialEndpoint("publishing", "package-compile-status-v3", "查询HarmonyOS软件包编译状态", "轮询专用 HarmonyOS 软件包解析结果,不把上传接受误认为解析成功。", "GET", "/api/publish/v3/package/compile/status", []string{}, "agc-help-publish-api-query-compile-status-0000002236041434", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", "developer-to-huawei"), // 创建专用 HarmonyOS 测试应用:省略 projectId 时由华为建立同名项目。 // 请求:POST /api/publish/v3/app;调用方向:开发者调用华为服务端。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939 @@ -638,19 +642,19 @@ var EndpointFamilies = map[string][]Endpoint{ // 查询资产明细:华为游戏服务器调用此接口查询玩家在玩游戏的资产明细数据,并将信息展示在游戏中心的“在玩”页面上。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253 - officialEndpoint("gameplay", "asset-details", "查询资产明细", "华为游戏服务器调用此接口查询玩家在玩游戏的资产明细数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-asset-details-0000002022225253", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253", "inbound-callback"), + officialEndpoint("gameplay", "asset-details", "查询资产明细", "华为游戏服务器调用此接口查询玩家在玩游戏的资产明细数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-asset-details-0000002022225253", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253", "inbound-callback"), // 查询资产概要:华为游戏服务器调用此接口查询玩家在玩游戏的资产概要数据,并将信息展示在游戏中心的“在玩”页面上。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729 - officialEndpoint("gameplay", "asset-summary", "查询资产概要", "华为游戏服务器调用此接口查询玩家在玩游戏的资产概要数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-asset-summary-0000002022105729", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", "inbound-callback"), + officialEndpoint("gameplay", "asset-summary", "查询资产概要", "华为游戏服务器调用此接口查询玩家在玩游戏的资产概要数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-asset-summary-0000002022105729", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", "inbound-callback"), // 批量查询玩家基本信息:华为游戏服务器调用此接口批量查询玩家基本信息,并将信息展示在游戏中心的“在玩”页面上。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322 - officialEndpoint("gameplay", "basic-info", "批量查询玩家基本信息", "华为游戏服务器调用此接口批量查询玩家基本信息,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-basic-info-0000002038975322", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322", "inbound-callback"), + officialEndpoint("gameplay", "basic-info", "批量查询玩家基本信息", "华为游戏服务器调用此接口批量查询玩家基本信息,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-basic-info-0000002038975322", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322", "inbound-callback"), // 查询战绩筛选标签:华为游戏服务器调用此接口查询玩家在玩游戏战绩的筛选标签,并将信息展示在游戏中心的“在玩”页面上。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670 - officialEndpoint("gameplay", "label", "查询战绩筛选标签", "华为游戏服务器调用此接口查询玩家在玩游戏战绩的筛选标签,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-label-0000001985625670", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", "inbound-callback"), + officialEndpoint("gameplay", "label", "查询战绩筛选标签", "华为游戏服务器调用此接口查询玩家在玩游戏战绩的筛选标签,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-label-0000001985625670", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", "inbound-callback"), // 上传/下架游戏资源:开发者服务器调用此接口同步华为服务器的游戏资源,用于上传或下架“在玩”页面上的图片或视频。 // 请求:POST /gameservice/api/gbClientApi;调用方向:开发者调用华为服务端。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725 @@ -658,25 +662,25 @@ var EndpointFamilies = map[string][]Endpoint{ // 批量查询玩家角色信息:华为游戏服务器调用此接口批量查询玩家角色信息。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173 - officialEndpoint("gameplay", "role-info", "批量查询玩家角色信息", "华为游戏服务器调用此接口批量查询玩家角色信息。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-role-info-0000002075016173", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", "inbound-callback"), + officialEndpoint("gameplay", "role-info", "批量查询玩家角色信息", "华为游戏服务器调用此接口批量查询玩家角色信息。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-role-info-0000002075016173", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", "inbound-callback"), // 分页查询玩家战绩:华为游戏服务器调用此接口分页查询玩家在玩游戏的战绩数据,并将信息展示在游戏中心的“在玩”页面上。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938 - officialEndpoint("gameplay", "scores", "分页查询玩家战绩", "华为游戏服务器调用此接口分页查询玩家在玩游戏的战绩数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-scores-0000001985465938", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", "inbound-callback"), + officialEndpoint("gameplay", "scores", "分页查询玩家战绩", "华为游戏服务器调用此接口分页查询玩家在玩游戏的战绩数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-scores-0000001985465938", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", "inbound-callback"), // 查询游戏概要信息:华为游戏服务器调用此接口查询玩家在玩游戏的概要数据,并将信息展示在游戏中心的“在玩”页面上。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249 - officialEndpoint("gameplay", "summary", "查询游戏概要信息", "华为游戏服务器调用此接口查询玩家在玩游戏的概要数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-summary-0000002022225249", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", "inbound-callback"), + officialEndpoint("gameplay", "summary", "查询游戏概要信息", "华为游戏服务器调用此接口查询玩家在玩游戏的概要数据,并将信息展示在游戏中心的“在玩”页面上。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-summary-0000002022225249", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", "inbound-callback"), }, "game-items": { // 查询玩家区服角色:此接口用于查询玩家区服角色信息。 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377 - officialEndpoint("game-items", "propapi-getroleinfo", "查询玩家区服角色", "此接口用于查询玩家区服角色信息。", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-propapi-getroleinfo-0000002355255377", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377", "inbound-callback"), + officialEndpoint("game-items", "propapi-getroleinfo", "查询玩家区服角色", "此接口用于查询玩家区服角色信息。", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-propapi-getroleinfo-0000002355255377", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377", "inbound-callback"), // 下单:下单 // 请求:POST {callbackUrl};调用方向:华为调用开发者回调服务;本项目的请求构造不等于已实现回调接收与验签。 // 官方文档:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666 - officialEndpoint("game-items", "propapi-order", "下单", "下单", "POST", "{callbackUrl}", []string{"callbackUrl", "callbackUrl"}, "agcapi-propapi-order-0000002321296666", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666", "inbound-callback"), + officialEndpoint("game-items", "propapi-order", "下单", "下单", "POST", "{callbackUrl}", []string{"callbackUrl"}, "agcapi-propapi-order-0000002321296666", "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666", "inbound-callback"), }, "resources": { // 新增资源包版本:创建“使用华为CDN”方式的资源包预下载任务。 diff --git a/pkg/domain/endpoint_contracts.go b/pkg/domain/endpoint_contracts.go index 57653c6..cfac3f9 100644 --- a/pkg/domain/endpoint_contracts.go +++ b/pkg/domain/endpoint_contracts.go @@ -23,12 +23,53 @@ func verifiedParameters(family, id string, inferred []Parameter) []Parameter { return field } switch family + "/" + id { + case "projects/getteamlist": + // 官方仅支持 OAuth;不能将 Service Account JWT 或 API 客户端 token 当作 OAuth 用户授权。 + return []Parameter{typed("oauth2Token", "header", "string", true, "OAuth 用户授权的 Access Token;仅支持 OAuth 客户端方式,以 oauth2Token 请求头传入。")} + case "publishing/package-compile-status-v3", "publishing/query-aabfile": + return []Parameter{appQuery, typed("pkgIds", "query", "string", true, "待查询的软件包 ID;多个 ID 以英文逗号分隔")} + case "pms/batchactproduct-harmonyosnext", "pms/batchactproduct-android", "pms/batchdeactproduct-harmonyosnext", "pms/batchdeactproduct-android": + return []Parameter{appHeader, typed("requestId", "body", "string", true, "开发者自定义唯一请求标识"), stringsArray("products", true, 0, 0, "待变更状态的商品标识列表;激活限已下线商品,去激活限已上线商品")} + case "pms/batchaddproduct-harmonyosnext", "pms/batchaddproduct-android", "pms/batchupdateproduct-harmonyosnext", "pms/batchupdateproduct-android": + products := typed("products", "body", "array", true, "商品列表;各条目遵循对应平台的 ProductImportInfo 模型") + products.ItemsType = "object" + return []Parameter{appHeader, typed("requestId", "body", "string", true, "开发者自定义唯一请求标识"), products} + case "pms/batchactpromotion-harmonyosnext", "pms/batchactpromotion-android", "pms/batchdeactpromotion-harmonyosnext", "pms/batchdeactpromotion-android": + request := typed("requestId", "body", "string", true, "开发者自定义唯一请求标识") + request.MaxLength = 64 + parameters := []Parameter{appHeader, request, stringsArray("promotions", true, 0, 100, "促销 ID 列表,每个 ID 最长 32 字符")} + if id == "batchdeactpromotion-harmonyosnext" || id == "batchdeactpromotion-android" { + immediate := typed("immediateEnd", "body", "string", false, "1:立即结束促销;不传或其他值不更新促销结束时间") + immediate.MaxLength = 2 + parameters = append(parameters, immediate) + } + return parameters + case "pms/addproduct-harmonyosnext": + // ProductInfo 的 status 是预留字段;创建成功不代表审核通过或已生效。 + return []Parameter{appHeader, typed("requestId", "body", "string", true, "唯一请求序列,最长 64 字符"), typed("product", "body", "object", true, "商品定义;创建后需要审核才能上架生效")} + case "pms/addproductgroup-harmonyosnext", "pms/updateproductgroup-harmonyosnext", "pms/addproductgroup-android", "pms/updateproductgroup-android": + // 官方 ProductGroupInfo:创建时系统生成 groupId;groupName 必填。 + return []Parameter{appHeader, typed("requestId", "body", "string", true, "开发者生成的唯一请求序列,最长 64 字符"), typed("resource", "body", "object", true, "商品订阅分组信息;groupName 必填,更新时 groupId 必填;状态约束以对应版本官方模型为准")} + case "pms/getproductgroup-harmonyosnext", "pms/getproductgroup-android": + return []Parameter{appHeader, typed("requestId", "body", "string", true, "唯一请求序列,最长 64 字符"), typed("pageNum", "body", "integer", false, "起始页,默认 1"), typed("pageSize", "body", "integer", false, "每页 1 至 300 条,默认 20"), typed("orderBy", "body", "string", false, "以 JSON 表示 name、createTime 或 updateTime 的 asc/desc 排序规则")} + case "cicd/build-hvigor": + return []Parameter{typed("project", "body", "string", true, "本地 HarmonyOS 项目目录"), typed("hvigorPath", "body", "string", false, "Hvigor 可执行文件路径;默认检测 DevEco Studio 或 PATH"), typed("product", "body", "string", false, "产品名,默认 default"), typed("buildMode", "body", "string", false, "debug 或 release,默认 debug"), typed("task", "body", "string", false, "assembleHap:模块 HAP;assembleApp:项目 APP,默认 assembleHap")} + case "upload/obbfile-init": + // 官方初始化接口在 Query 中传参,POST 并不表示这些字段在 Body。 + return []Parameter{appQuery, typed("fileName", "query", "string", true, "带后缀的原始文件名"), typed("contentType", "query", "string", false, "对象 MIME 类型"), {Name: "fileType", In: "query", Type: "integer", Enum: []string{"1", "2", "3"}, Description: "1:HarmonyOS APP;2:OBB(默认);3:APK/AAB。"}, {Name: "obbType", In: "query", Type: "integer", Enum: []string{"1", "2"}, Description: "OBB文件必填:1主扩展,2补丁扩展;非OBB文件不能传入。"}, typed("releaseType", "query", "integer", false, "1:商用;6:HarmonyOS 测试"), typed("chineseMainlandFlag", "query", "integer", false, "是否分发中国大陆:0 或 1")} + case "upload/obbfile-uploadurl", "upload/obbfile-compose": + // Body 是以 additionalProp1、additionalProp2 等编号为键的动态对象,不能将文档占位名 additionalPropX 设为必填字段。 + return []Parameter{typed("objectId", "query", "string", true, "本次分片初始化返回的对象 ID"), typed("nspUploadId", "query", "string", true, "本次分片初始化返回的上传 ID")} case "publishing/app-create": return []Parameter{typed("projectId", "query", "string", false, "可选项目 ID;省略时创建专用同名项目"), typed("appName", "body", "string", true, "应用名称,最长 64 字符"), typed("packageName", "body", "string", false, "HarmonyOS 应用必填且包名唯一;元服务由系统生成"), typed("parentType", "body", "integer", true, "13:应用;2:游戏"), typed("installationFree", "body", "integer", true, "0:HarmonyOS 应用;1:元服务")} case "publishing/app-info-query-v3": return []Parameter{appQuery, typed("lang", "query", "string", false, "可选语言;不传则返回全部语言"), typed("releaseType", "query", "integer", false, "1:商用版本;6:HarmonyOS 测试版本"), typed("versionId", "query", "string", false, "releaseType=6 时必填的测试版本 ID")} case "publishing/app-version-list": return []Parameter{appHeader, typed("packageName", "body", "string", false, "应用包名;CLI 已要求 appId 请求头"), typed("state", "body", "string", false, "可选版本状态,多个状态以逗号分隔")} + case "publishing/language-info-update": + return []Parameter{appQuery, typed("lang", "body", "string", true, "目标语言;新建语言与更新语言使用相同入口"), typed("appName", "body", "string", false, "目标语言的应用名称"), typed("appDesc", "body", "string", false, "目标语言的详细描述"), typed("briefInfo", "body", "string", false, "目标语言的简介"), typed("newFeatures", "body", "string", false, "目标语言的新版本特性")} + case "publishing/language-info-delete": + return []Parameter{appQuery, typed("lang", "query", "string", true, "待删除的非默认语言"), typed("releaseType", "query", "integer", false, "应用发布方式")} case "provisioning/provision-api-get-fingerprints", "provisioning/provision-api-getacl", "testing/test-api-get-test-grouplist": return []Parameter{appHeader} case "provisioning/provision-api-add-fingerprints", "provisioning/provision-api-delete-fingerprints": @@ -38,7 +79,24 @@ func verifiedParameters(family, id string, inferred []Parameter) []Parameter { case "provisioning/provision-api-delete-cent": return []Parameter{stringsArray("certIds", true, 1, 100, "待删除的本次运行专用证书 ID 列表")} case "provisioning/provision-api-apply-provision": - return []Parameter{typed("provisionName", "body", "string", true, "专用 Profile 名称"), typed("provisionType", "body", "integer", true, "1:调试;2:发布;3:In-house;6:指定设备"), typed("certId", "body", "string", true, "本次生成的专用证书 ID"), typed("appId", "body", "string", true, "专用测试应用 ID"), typed("deviceIdList", "body", "array", false, "真实设备 ID 列表,最多 4000 项"), typed("aclPermissionList", "body", "array", false, "已获审批的 ACL 列表,最多 1000 项")} + devices := stringsArray("deviceIdList", false, 0, 4000, "真实设备 ID 列表,最多 4000 项") + devices.ItemsMaxLength = 32 + permissions := stringsArray("aclPermissionList", false, 0, 1000, "已获审批的 ACL 列表,最多 1000 项") + permissions.ItemsMaxLength = 256 + return []Parameter{typed("provisionName", "body", "string", true, "专用 Profile 名称"), typed("provisionType", "body", "integer", true, "1:调试;2:发布;3:In-house;6:指定设备"), typed("certId", "body", "string", true, "本次生成的专用证书 ID"), typed("appId", "body", "string", true, "专用测试应用 ID"), devices, permissions} + case "provisioning/provision-api-applyacl": + model := "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756" + return []Parameter{appHeader, typed("attachment", "body", "string", false, "已上传附件的 objectId"), {Name: "aclPermissionList", In: "body", Type: "array", Required: true, ItemsType: "object", Description: "受限 ACL 申请列表;按官方请求示例展开为对象数组。", ItemsProperties: []Parameter{ + {Name: "name", In: "body", Type: "string", Required: true, MaxLength: 256, SourceURL: model}, + {Name: "reason", In: "body", Type: "string", Required: true, MaxLength: 256, SourceURL: model}, + }}} + case "provisioning/provision-api-add-device": + model := "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314" + return []Parameter{{Name: "deviceList", In: "body", Type: "array", Required: true, ItemsType: "object", MaxItems: 1000, Description: "真实调试/测试设备信息列表,最多1000项。", ItemsProperties: []Parameter{ + {Name: "deviceName", In: "body", Type: "string", Required: true, MaxLength: 100, SourceURL: model}, + {Name: "udid", In: "body", Type: "string", Required: true, MaxLength: 64, SourceURL: model}, + {Name: "deviceType", In: "body", Type: "integer", Required: true, Enum: []string{"1", "2", "4", "5", "8", "19"}, SourceURL: model}, + }}} case "provisioning/provision-api-delete-provision": return []Parameter{typed("id", "query", "string", true, "本次创建并登记的专用 Profile ID")} case "provisioning/provision-api-update-provision": @@ -47,8 +105,27 @@ func verifiedParameters(family, id string, inferred []Parameter) []Parameter { return []Parameter{appHeader} case "domains/domain-api-get-domain": return []Parameter{appHeader, p("category", "query", true, "Domain category")} + case "domains/domain-api-post-domain": + // 全量替换指定分类的域名;空数组可清空。不得把 category 放在 Body。 + return []Parameter{appHeader, typed("category", "query", "string", true, "server:服务器域名;business:业务域名"), typed("domains", "body", "array", false, "全量域名列表,每项含 type 和 value;最多 3000 项")} + case "domains/domain-api-precheck": + return []Parameter{appHeader, typed("domain", "body", "object", false, "待校验的业务域名,type 必须为 webView;需提前部署校验文件")} + case "domains/domain-api-download-domain-config", "domains/domain-api-get-domain-config": + return []Parameter{appHeader} case "testing/test-api-query-test-user": return []Parameter{appHeader, p("groupId", "header", true, "Test group ID")} + case "testing/test-api-add-test-group-user": + return []Parameter{appHeader, + {Name: "groupId", In: "body", Type: "string", Required: true, MaxLength: 32, Description: "测试群组ID。"}, + {Name: "hwAccount", In: "body", Type: "string", Required: true, MaxLength: 256, Description: "真实华为账号、邮箱或手机号;内部群组手机号格式0086手机号,外部群组为86-手机号。"}, + {Name: "nickName", In: "body", Type: "string", MaxLength: 64, Description: "测试成员昵称。"}, + {Name: "uid", In: "body", Type: "string", MaxLength: 128, Description: "联盟账号ID;内部群组添加成员必填,需先确认群组类型。"}, + } + case "testing/test-api-delete-test-group-user": + return []Parameter{appHeader, + {Name: "groupId", In: "body", Type: "string", Required: true, MaxLength: 32, Description: "测试群组ID。"}, + {Name: "deleteTesterIds", In: "body", Type: "array", Required: true, ItemsType: "string", ItemsMaxLength: 100, MaxItems: 100, Description: "真实测试成员ID列表;数组长度不超过100,每个ID最长100字符。"}, + } case "testing/test-api-add-test-group": return []Parameter{appHeader, typed("groupName", "body", "string", true, "群组名称,最长 50 个字符"), typed("groupType", "body", "integer", false, "0:外部群组;1:内部群组(需要 AppTest)")} case "testing/test-api-edit-test-group": @@ -66,10 +143,16 @@ func verifiedParameters(family, id string, inferred []Parameter) []Parameter { return []Parameter{appHeader, typed("invitationCodeId", "query", "string", true, "要删除的邀请码 ID;AppTest 邀请测试不支持此接口")} case "testing/test-api-add-test-version": return []Parameter{appQuery, typed("releaseType", "body", "integer", true, "HarmonyOS 测试发布方式,默认 6"), typed("testType", "body", "integer", true, "3:邀请测试;4:公开测试"), typed("testDesc", "body", "string", true, "测试版本描述,最长 50 字符"), typed("onshelfSelfDetect", "body", "integer", false, "0:不进行正式上架自检;1:进行自检")} + case "testing/test-api-add-test-package": + // file 是已经上传的 .app 文件元数据,不是把二进制文件直接放入此 JSON 请求。 + return []Parameter{appQuery, typed("file", "body", "object", true, "文件信息,包含 fileName 和上传返回的 objectId;需随后轮询异步软件包解析"), typed("distributeMode", "body", "integer", false, "1:测试专区;2:应用市场")} + case "testing/test-api-modify-test-version": + // 已核对官方参数表,并在专用应用上读回草稿描述变更。 + return []Parameter{appQuery, typed("versionId", "body", "string", true, "本次创建的测试草稿版本 ID;在架版本不可更新"), typed("pkgId", "body", "string", false, "成功编译的软件包 ID"), typed("languages", "body", "array", false, "版本语言信息,最多 100 项"), typed("deviceTypes", "body", "array", false, "设备类型,最多 6 项"), typed("distCountryList", "body", "string", false, "公开测试国家码,以英文逗号分隔"), typed("extInfo", "body", "object", false, "版本扩展信息"), typed("openTestInfo", "body", "object", false, "测试时间、描述与任务信息"), typed("packagePermissionIntroVideoList", "body", "array", false, "权限说明视频"), typed("versionVocReq", "body", "array", false, "公开测试已解决问题")} case "testing/test-api-delete-test-version": return []Parameter{appQuery, typed("versionId", "query", "string", true, "本次创建的测试草稿版本 ID")} case "upload/upload-url-new": - return []Parameter{p("contentLength", "query", true, "Upload file length in bytes"), p("appId", "query", false, "Huawei application ID"), p("suffix", "query", false, "Upload file suffix"), p("fileName", "query", false, "Upload file name")} + return []Parameter{appQuery, typed("fileName", "query", "string", true, "包含后缀的原始文件名"), typed("contentLength", "query", "integer", true, "文件长度,单位字节"), typed("sha256", "query", "string", false, "文件内容 SHA256"), typed("releaseType", "query", "integer", false, "发布方式"), typed("chineseMainlandFlag", "query", "integer", false, "是否分发中国大陆;非中国大陆注册开发者必须设置")} case "publishing/app-info-query": return []Parameter{p("appId", "query", true, "Huawei application ID"), p("lang", "query", false, "Application information language")} case "projects/queryservice": diff --git a/pkg/domain/endpoint_test.go b/pkg/domain/endpoint_test.go index 2900f2f..212320b 100644 --- a/pkg/domain/endpoint_test.go +++ b/pkg/domain/endpoint_test.go @@ -83,20 +83,20 @@ func TestVerifiedEndpointParameterContracts(t *testing.T) { {"domains", "domain-api-get-domain", "category", "query", true}, {"testing", "test-api-get-test-grouplist", "appId", "header", true}, {"testing", "test-api-query-test-user", "appId", "header", true}, - {"testing", "test-api-query-test-user", "groupId", "header", true}, + {"testing", "test-api-query-test-user", "groupId", "query", true}, {"upload", "upload-url-new", "contentLength", "query", true}, - {"upload", "upload-url-new", "appId", "query", false}, - {"upload", "upload-url-new", "suffix", "query", false}, - {"upload", "upload-url-new", "fileName", "query", false}, + {"upload", "upload-url-new", "appId", "query", true}, + {"upload", "upload-url-new", "sha256", "query", false}, + {"upload", "upload-url-new", "fileName", "query", true}, {"publishing", "app-info-query", "appId", "query", true}, {"publishing", "app-info-query", "lang", "query", false}, {"projects", "queryservice", "projectId", "query", true}, {"projects", "queryservice", "appID", "query", true}, - {"reports", "appdownloadexport", "language", "query", false}, - {"reports", "appdownloadexport", "startTime", "query", false}, - {"reports", "appdownloadexport", "endTime", "query", false}, + {"reports", "appdownloadexport", "language", "query", true}, + {"reports", "appdownloadexport", "startTime", "query", true}, + {"reports", "appdownloadexport", "endTime", "query", true}, {"reports", "iapexport", "currency", "query", true}, - {"reports", "orderanalysisexport", "teamId", "header", true}, + {"reports", "orderanalysisexport", "exportType", "query", false}, } for _, tc := range cases { t.Run(tc.id+"/"+tc.name, func(t *testing.T) { diff --git a/pkg/domain/envelope.go b/pkg/domain/envelope.go index 77c53c6..b81f747 100644 --- a/pkg/domain/envelope.go +++ b/pkg/domain/envelope.go @@ -12,7 +12,14 @@ type ErrorEnvelope struct { } type ErrorDetail struct { - Code string `json:"code"` - Message string `json:"message"` - Details string `json:"details,omitempty"` + CodeField string `json:"codeField,omitempty"` + ResultCodes map[string]string `json:"resultCodes,omitempty"` + Endpoint string `json:"endpoint,omitempty"` + SourceURL string `json:"sourceUrl,omitempty"` + Suggestion string `json:"suggestion,omitempty"` + DocumentationCommand string `json:"documentationCommand,omitempty"` + Violations []InputViolation `json:"violations,omitempty"` + Code string `json:"code"` + Message string `json:"message"` + Details string `json:"details,omitempty"` } diff --git a/pkg/domain/functions.go b/pkg/domain/functions.go new file mode 100644 index 0000000..96a56a7 --- /dev/null +++ b/pkg/domain/functions.go @@ -0,0 +1,67 @@ +package domain + +import "encoding/json" + +// FunctionRequest is independent of HTTP, session persistence and CLI presentation. +// Nil configuration pointers mean preserve existing values, including empty maps. +type FunctionRequest struct { + Name string `json:"name,omitempty"` + SessionFile string `json:"sessionFile,omitempty"` + BaseURL string `json:"baseUrl,omitempty"` + ProjectID string `json:"projectId,omitempty"` + CodePath string `json:"codePath,omitempty"` + Runtime string `json:"runtime,omitempty"` + Handler *string `json:"handler,omitempty"` + Description string `json:"description,omitempty"` + VersionDescription string `json:"versionDescription,omitempty"` + Version string `json:"version,omitempty"` + AliasName string `json:"aliasName,omitempty"` + Memory *int `json:"memory,omitempty"` + Timeout *int `json:"timeout,omitempty"` + InstanceConcurrency *int `json:"instanceConcurrency,omitempty"` + Environment *map[string]string `json:"environment,omitempty"` + Layers *[]string `json:"layers,omitempty"` + Payload json.RawMessage `json:"payload,omitempty"` + FuzzyName string `json:"fuzzyName,omitempty"` + PageSize int `json:"pageSize,omitempty"` + PageIndex int `json:"pageIndex,omitempty"` + DryRun bool `json:"dryRun"` +} + +var FunctionOperations = []string{"create-function", "update-function-code", "update-function-config", "publish-function", "update-and-publish-function", "invoke", "list-functions", "query-function-version", "list-function-versions"} + +func init() { + Capabilities = append(Capabilities, Capability{ID: "functions", Name: "Cloud Functions", Description: "Native Go workflows based on Huawei AGCLI 1.12.0 source; explicit user OAuth session required.", Command: "agc functions", RESTPath: "/api/v1/functions", Status: "registered"}) + for _, id := range FunctionOperations { + e := Endpoint{ID: id, FamilyID: "functions", Name: id, Command: "agc functions " + id, Method: "POST", Path: "native:functions/" + id, Direction: "native-workflow", Authentication: "agcli-user-oauth", Status: "registered", OfficialSlug: "agcli-1.12.0-" + id, Source: "Huawei official AGCLI 1.12.0 source", SourceURL: "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0"} + e.Documentation = &ReferenceSummary{Title: id, SourceURL: e.SourceURL, CheckedAt: "2026-10-26", Status: "vendor-source-reviewed", ReadCommand: e.Command + " --docs --pretty"} + EndpointFamilies["functions"] = append(EndpointFamilies["functions"], e) + } +} +func FunctionSchema() map[string]any { + props := map[string]any{} + for _, n := range []string{"name", "sessionFile", "baseUrl", "projectId", "codePath", "runtime", "handler", "description", "versionDescription", "version", "aliasName", "fuzzyName"} { + props[n] = map[string]any{"type": "string"} + } + for _, n := range []string{"memory", "timeout", "instanceConcurrency", "pageSize", "pageIndex"} { + props[n] = map[string]any{"type": "integer"} + } + props["name"].(map[string]any)["pattern"] = "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + props["runtime"].(map[string]any)["enum"] = []string{"nodejs14.x", "java1.8", "python3", "custom-runtime"} + props["memory"].(map[string]any)["enum"] = []int{500, 1000, 2000, 4000} + for n, maximum := range map[string]int{"timeout": 1800, "instanceConcurrency": 1000, "pageSize": 1000} { + props[n].(map[string]any)["minimum"] = 1 + props[n].(map[string]any)["maximum"] = maximum + } + props["pageIndex"].(map[string]any)["minimum"] = 1 + props["version"].(map[string]any)["pattern"] = `^(\$latest|[1-9][0-9]{0,2}|1000)$` + for _, n := range []string{"description", "versionDescription"} { + props[n].(map[string]any)["maxLength"] = 64 + props[n].(map[string]any)["x-agcli-display-width-max"] = 64 + } + props["environment"] = map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}, "writeOnly": true} + props["layers"] = map[string]any{"type": "array", "maxItems": 5, "items": map[string]string{"type": "string"}} + props["payload"] = map[string]any{"description": "Arbitrary valid JSON; numbers retain precision."} + props["dryRun"] = map[string]any{"type": "boolean", "default": true} + return map[string]any{"type": "object", "properties": props} +} diff --git a/pkg/domain/management.go b/pkg/domain/management.go new file mode 100644 index 0000000..8aca0f6 --- /dev/null +++ b/pkg/domain/management.go @@ -0,0 +1,7 @@ +package domain + +// TemplateCodeUploadEndpoint is an internal stage of the reviewed SAM deploy +// workflow, not an application gallery or a public storage-management API. +func TemplateCodeUploadEndpoint() Endpoint { + return Endpoint{ID: "template-code-upload", FamilyID: "templates", Name: "SAM code artifact upload", Method: "PUT", Path: "/v0/{bucket}/{object_name}", Authentication: "agcli-management-oauth", Direction: "developer-to-huawei", SourceURL: "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", RequestContentType: "application/x-www-form-urlencoded"} +} diff --git a/pkg/domain/openapi.go b/pkg/domain/openapi.go index e4eb403..220bf10 100644 --- a/pkg/domain/openapi.go +++ b/pkg/domain/openapi.go @@ -1,6 +1,9 @@ package domain -import "strings" +import ( + "strconv" + "strings" +) func OpenAPISpec() map[string]any { paths := map[string]any{ @@ -73,7 +76,12 @@ func endpointOperation(prefix string, endpoint Endpoint, summaryPrefix string, t op["x-agc-command"] = endpoint.Command op["x-huawei-method"] = endpoint.Method op["x-huawei-path"] = endpoint.Path + op["x-huawei-default-base-url"] = endpoint.DefaultBaseURL + op["x-huawei-authentication"] = endpoint.Authentication + op["x-huawei-content-type"] = endpoint.RequestContentType op["x-agc-parameters"] = endpoint.Parameters + op["x-agc-rules"] = endpoint.Rules + op["x-agc-documentation"] = endpoint.Documentation if prefix == "invoke" { op["requestBody"] = map[string]any{ "required": true, @@ -88,6 +96,47 @@ func endpointOperation(prefix string, endpoint Endpoint, summaryPrefix string, t }, } } + if prefix == "invoke" { + schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + if (endpoint.FamilyID == "pms" && endpoint.ID == "resourcemanage-harmonyosnext") || (IsServerlessFamily(endpoint.FamilyID) && parameterFileRequired(endpoint)) { + if IsServerlessFamily(endpoint.FamilyID) { + schema["required"] = invokeRequiredContainers(endpoint) + } else { + schema["required"] = []string{"filePath"} + } + } + alternatives := []any{} + for _, parameter := range endpoint.Parameters { + if parameter.In != "query" || !parameter.Required { + continue + } + branches := []any{} + for _, container := range []string{"query", "queryValues"} { + branches = append(branches, map[string]any{"required": []string{container}, "properties": map[string]any{container: map[string]any{"required": []string{parameter.Name}}}}) + } + alternatives = append(alternatives, map[string]any{"anyOf": branches}) + } + if endpoint.Authentication == "agcli-user-oauth" { + required := []string{} + if endpoint.ID != "list-functions" { + required = append(required, "name") + } + if endpoint.ID == "create-function" || endpoint.ID == "update-function-code" { + required = append(required, "codePath") + } + if strings.Contains(endpoint.ID, "publish") { + required = append(required, "versionDescription") + } + schema["required"] = required + alternatives = append(alternatives, map[string]any{"if": map[string]any{"properties": map[string]any{"dryRun": map[string]any{"const": false}}, "required": []string{"dryRun"}}, "then": map[string]any{"required": []string{"sessionFile"}}}) + } + if strings.HasPrefix(endpoint.Authentication, "agcli-management-") { + alternatives = append(alternatives, map[string]any{"if": map[string]any{"properties": map[string]any{"dryRun": map[string]any{"const": false}}, "required": []string{"dryRun"}}, "then": map[string]any{"required": []string{"sessionFile"}}}) + } + if len(alternatives) > 0 { + schema["allOf"] = alternatives + } + } return op } @@ -107,15 +156,22 @@ func operation(operationID, summary, description string, tags []string) map[stri } func invokeRequestSchemaProperties(endpoint Endpoint) map[string]any { + if endpoint.Authentication == "agcli-user-oauth" { + return FunctionSchema()["properties"].(map[string]any) + } properties := map[string]any{ - "baseUrl": map[string]string{"type": "string"}, - "params": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, - "query": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, - "headers": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, - "fields": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, - "body": map[string]any{"description": "Raw JSON request body for the Huawei endpoint."}, - "token": map[string]string{"type": "string", "description": "Huawei upstream access token; separate from the local X-AGC-Server-Token header."}, - "dryRun": map[string]string{"type": "boolean"}, + "sessionFile": map[string]any{"type": "string", "writeOnly": true, "description": "Explicit user management session file; not a publishing profile."}, + "projectId": map[string]any{"type": "string", "description": "Project must match the selected management session."}, + "filePath": map[string]string{"type": "string", "description": "Explicit local file path on the CLI server host for supported file-upload endpoints. Multipart metadata is supplied through fields or body."}, + "queryValues": map[string]any{"type": "object", "description": "Ordered repeated upstream query keys. Each array replaces the scalar query entry with the same name.", "additionalProperties": map[string]any{"type": "array", "items": map[string]string{"type": "string"}}}, + "baseUrl": map[string]string{"type": "string"}, + "params": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, + "query": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, + "headers": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, + "fields": map[string]any{"type": "object", "additionalProperties": map[string]string{"type": "string"}}, + "body": map[string]any{"description": "Raw JSON request body for the Huawei endpoint."}, + "token": map[string]string{"type": "string", "description": "Huawei upstream access token; separate from the local X-AGC-Server-Token header."}, + "dryRun": map[string]string{"type": "boolean"}, } for _, parameter := range endpoint.Parameters { container := "" @@ -127,6 +183,9 @@ func invokeRequestSchemaProperties(endpoint Endpoint) map[string]any { case "path": container = "params" case "file": + if (endpoint.FamilyID == "pms" && endpoint.ID == "resourcemanage-harmonyosnext") || IsServerlessFamily(endpoint.FamilyID) { + continue + } container = "fields" } if container == "" { @@ -146,15 +205,27 @@ func invokeRequestSchemaProperties(endpoint Endpoint) map[string]any { if parameter.Format != "" { known[parameter.Name].(map[string]any)["x-huawei-format"] = parameter.Format } - if parameter.Required { + if parameter.Pattern != "" { + known[parameter.Name].(map[string]any)["pattern"] = parameter.Pattern + } + if parameter.Required && container != "query" { required, _ := object["required"].([]string) object["required"] = append(required, parameter.Name) } } - if methodNeedsBody(endpoint.Method) { + if methodNeedsBody(endpoint.Method) || endpoint.Body != "" { bodySchema := map[string]any{ "description": "Raw JSON request body for " + endpoint.Method + " " + endpoint.Path + ".", } + if endpoint.DynamicBody != nil { + child := invokeRequestSchemaProperties(Endpoint{Method: "POST", Parameters: endpoint.DynamicBody.Properties})["body"] + bodySchema["type"] = "object" + bodySchema["patternProperties"] = map[string]any{endpoint.DynamicBodyKeyPattern: child} + bodySchema["additionalProperties"] = false + if endpoint.DynamicBody.Required { + bodySchema["minProperties"] = 1 + } + } fields := map[string]any{} required := []string{} for _, parameter := range endpoint.Parameters { @@ -165,12 +236,103 @@ func invokeRequestSchemaProperties(endpoint Endpoint) map[string]any { if parameter.Type != "" { field["type"] = parameter.Type } + if parameter.EncodedJSON != nil { + model := *parameter.EncodedJSON + model.Name = "value" + model.In = "body" + nested := invokeRequestSchemaProperties(Endpoint{Method: "POST", Parameters: []Parameter{model}})["body"].(map[string]any)["properties"].(map[string]any)["value"] + field["contentMediaType"] = "application/json" + field["contentSchema"] = nested + } if parameter.Format != "" { field["format"] = parameter.Format } + if parameter.Pattern != "" { + field["pattern"] = parameter.Pattern + } + if parameter.MaxLength > 0 { + field["maxLength"] = parameter.MaxLength + } + if parameter.MinLength > 0 { + field["minLength"] = parameter.MinLength + } + if parameter.Minimum != nil { + field["minimum"] = *parameter.Minimum + } + if parameter.Maximum != nil { + field["maximum"] = *parameter.Maximum + } + if len(parameter.Enum) > 0 { + if parameter.Type == "integer" { + values := []int64{} + for _, text := range parameter.Enum { + if value, err := strconv.ParseInt(text, 10, 64); err == nil { + values = append(values, value) + } + } + field["enum"] = values + } else { + field["enum"] = parameter.Enum + } + } + if parameter.Type == "string" && parameter.Required && !parameter.AllowEmpty { + field["minLength"] = 1 + } + if parameter.Type == "object" && len(parameter.Properties) > 0 { + nested := invokeRequestSchemaProperties(Endpoint{Method: "POST", Parameters: parameter.Properties})["body"].(map[string]any) + for name, value := range nested { + field[name] = value + } + } + if parameter.Type == "object" { + if parameter.MinProperties > 0 { + field["minProperties"] = parameter.MinProperties + } + if parameter.MaxProperties > 0 { + field["maxProperties"] = parameter.MaxProperties + } + if parameter.PropertyNamesPattern != "" { + field["propertyNames"] = map[string]any{"pattern": parameter.PropertyNamesPattern} + } + if parameter.AdditionalProperties != nil { + value := *parameter.AdditionalProperties + value.In = "body" + value.Name = "value" + value.Required = false + nested := invokeRequestSchemaProperties(Endpoint{Method: "POST", Parameters: []Parameter{value}})["body"].(map[string]any)["properties"].(map[string]any)["value"] + field["additionalProperties"] = nested + } + } if parameter.Type == "array" { if parameter.ItemsType != "" { - field["items"] = map[string]string{"type": parameter.ItemsType} + itemSchema := map[string]any{"type": parameter.ItemsType} + if len(parameter.ItemsEnum) > 0 { + if parameter.ItemsType == "integer" { + values := []int64{} + for _, text := range parameter.ItemsEnum { + if value, err := strconv.ParseInt(text, 10, 64); err == nil { + values = append(values, value) + } + } + itemSchema["enum"] = values + } else { + itemSchema["enum"] = parameter.ItemsEnum + } + } + if parameter.ItemsPattern != "" { + itemSchema["pattern"] = parameter.ItemsPattern + } + if parameter.ItemsMaxLength > 0 { + itemSchema["maxLength"] = parameter.ItemsMaxLength + } + field["items"] = itemSchema + if len(parameter.ItemsProperties) > 0 { + nested := invokeRequestSchemaProperties(Endpoint{Method: "POST", Parameters: parameter.ItemsProperties}) + field["items"] = nested["body"] + if len(parameter.ItemsRules) > 0 { + field["items"].(map[string]any)["x-agc-rules"] = parameter.ItemsRules + } + } } if parameter.MinItems > 0 { field["minItems"] = parameter.MinItems @@ -212,6 +374,10 @@ func exportedID(id string) string { func invokeRequiredContainers(endpoint Endpoint) []string { required := []string{} seen := map[string]bool{} + if endpoint.DynamicBody != nil && endpoint.DynamicBody.Required { + required = append(required, "body") + seen["body"] = true + } for _, parameter := range endpoint.Parameters { if !parameter.Required { continue @@ -221,10 +387,14 @@ func invokeRequiredContainers(endpoint Endpoint) []string { case "header": container = "headers" case "query": - container = "query" + continue case "path": container = "params" case "file": + if IsServerlessFamily(endpoint.FamilyID) { + container = "filePath" + break + } container = "fields" case "body": container = "body" @@ -236,3 +406,12 @@ func invokeRequiredContainers(endpoint Endpoint) []string { } return required } + +func parameterFileRequired(e Endpoint) bool { + for _, p := range e.Parameters { + if p.In == "file" && p.Required { + return true + } + } + return false +} diff --git a/pkg/domain/openapi_test.go b/pkg/domain/openapi_test.go index 2721546..fcc1980 100644 --- a/pkg/domain/openapi_test.go +++ b/pkg/domain/openapi_test.go @@ -40,26 +40,25 @@ func TestOpenAPISpecCarriesHuaweiEndpointMetadata(t *testing.T) { } } -func TestOpenAPIExposesVerifiedHeaderContract(t *testing.T) { +func TestOpenAPIExposesVerifiedTestingMemberContract(t *testing.T) { ep, _ := EndpointByID("testing", "test-api-query-test-user") props := invokeRequestSchemaProperties(ep) headers := props["headers"].(map[string]any) - known, ok := headers["properties"].(map[string]any) - if !ok { - t.Fatal("headers has no documented properties") - } - if _, ok := known["groupId"]; !ok { - t.Fatal("missing groupId header") - } required := headers["required"].([]string) - if len(required) != 2 || required[0] != "appId" || required[1] != "groupId" { - t.Fatalf("required headers = %v", required) + if len(required) != 1 || required[0] != "appId" { + t.Fatalf("wrong required headers: %v", required) + } + query := props["query"].(map[string]any)["properties"].(map[string]any) + for _, name := range []string{"appId", "groupId"} { + field, ok := query[name].(map[string]any) + if !ok || field["x-huawei-required"] != true { + t.Fatalf("missing required query field %s", name) + } } op := endpointOperation("invoke", ep, "Invoke endpoint", nil) schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) - containers := schema["required"].([]string) - if len(containers) != 1 || containers[0] != "headers" { - t.Fatalf("required containers = %v", containers) + if len(schema["allOf"].([]any)) != 2 { + t.Fatal("missing scalar/repeated required query alternatives") } } diff --git a/pkg/domain/pms_contract_test.go b/pkg/domain/pms_contract_test.go new file mode 100644 index 0000000..16702c2 --- /dev/null +++ b/pkg/domain/pms_contract_test.go @@ -0,0 +1,67 @@ +package domain + +import "testing" + +func TestLegacyProductGroupContracts(t *testing.T) { + for _, id := range []string{"addproductgroup-android", "updateproductgroup-android", "getproductgroup-android"} { + e, _ := EndpointByID("pms", id) + for _, expected := range []struct{ name, where string }{{"appId", "header"}, {"requestId", "body"}} { + found := false + for _, p := range e.Parameters { + if p.Name == expected.name && p.In == expected.where && p.Required { + found = true + } + } + if !found { + t.Errorf("%s missing %s in %s", id, expected.name, expected.where) + } + } + } +} + +func TestHarmonyProductCreateContract(t *testing.T) { + e, _ := EndpointByID("pms", "addproduct-harmonyosnext") + for _, expected := range []struct{ name, where, kind string }{{"appId", "header", ""}, {"requestId", "body", "string"}, {"product", "body", "object"}} { + found := false + for _, p := range e.Parameters { + if p.Name == expected.name && p.In == expected.where && p.Required && (expected.kind == "" || p.Type == expected.kind) { + found = true + } + } + if !found { + t.Errorf("missing %s in %s of type %s", expected.name, expected.where, expected.kind) + } + } +} + +func TestHarmonyProductGroupCreateContract(t *testing.T) { + e, _ := EndpointByID("pms", "addproductgroup-harmonyosnext") + for _, expected := range []struct{ name, where, kind string }{{"appId", "header", ""}, {"requestId", "body", "string"}, {"resource", "body", "object"}} { + found := false + for _, p := range e.Parameters { + if p.Name == expected.name && p.In == expected.where && p.Required && (expected.kind == "" || p.Type == expected.kind) { + found = true + } + } + if !found { + t.Errorf("missing %s in %s of type %s", expected.name, expected.where, expected.kind) + } + } +} + +func TestHarmonyProductGroupUpdateAndListContract(t *testing.T) { + for _, id := range []string{"updateproductgroup-harmonyosnext", "getproductgroup-harmonyosnext"} { + e, _ := EndpointByID("pms", id) + for _, expected := range []struct{ name, where string }{{"appId", "header"}, {"requestId", "body"}} { + found := false + for _, p := range e.Parameters { + if p.Name == expected.name && p.In == expected.where && p.Required { + found = true + } + } + if !found { + t.Errorf("%s missing %s in %s", id, expected.name, expected.where) + } + } + } +} diff --git a/pkg/domain/pms_upload_openapi_test.go b/pkg/domain/pms_upload_openapi_test.go new file mode 100644 index 0000000..ab44ff2 --- /dev/null +++ b/pkg/domain/pms_upload_openapi_test.go @@ -0,0 +1,23 @@ +package domain + +import "testing" + +func TestPMSUploadOpenAPIRequiresFilePathInsteadOfJSONFile(t *testing.T) { + op := OpenAPISpec()["paths"].(map[string]any)["/api/v1/pms/endpoints/resourcemanage-harmonyosnext/invoke"].(map[string]any)["post"].(map[string]any) + schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + required, _ := schema["required"].([]string) + found := false + for _, name := range required { + found = found || name == "filePath" + } + if !found { + t.Fatal("multipart filePath not required in REST schema") + } + fields := schema["properties"].(map[string]any)["fields"].(map[string]any) + fieldRequired, _ := fields["required"].([]string) + for _, name := range fieldRequired { + if name == "file" { + t.Fatal("file incorrectly required inside JSON fields") + } + } +} diff --git a/pkg/domain/privacy_source_contract_test.go b/pkg/domain/privacy_source_contract_test.go new file mode 100644 index 0000000..88a863b --- /dev/null +++ b/pkg/domain/privacy_source_contract_test.go @@ -0,0 +1,48 @@ +package domain + +import ( + "encoding/json" + "reflect" + "testing" +) + +func TestPrivacyModelsMatchCapturedOfficialLinkContracts(t *testing.T) { + raw, err := referenceDocuments.ReadFile("reference/supplemental/privacy-agreement-info.contract.json") + if err != nil { + t.Fatal(err) + } + var model struct{ Parameters []Parameter } + if err := json.Unmarshal(raw, &model); err != nil { + t.Fatal(err) + } + e, _ := EndpointByID("publishing", "privacy-agreement-update") + var actual []Parameter + for _, p := range e.Parameters { + if p.Name == "agreementInfos" { + actual = p.ItemsProperties + } + } + var compare func(string, []Parameter, []Parameter) + compare = func(path string, got, want []Parameter) { + if len(got) != len(want) { + t.Errorf("%s field count: got %d want %d", path, len(got), len(want)) + } + for _, expected := range want { + found := false + for _, p := range got { + if p.Name == expected.Name { + found = true + if p.Type != expected.Type || p.Required != expected.Required || p.MaxLength != expected.MaxLength || p.ItemsMaxLength != expected.ItemsMaxLength || p.MinItems != expected.MinItems || p.MaxItems != expected.MaxItems || p.ItemsType != expected.ItemsType || !reflect.DeepEqual(p.Enum, expected.Enum) || p.SourceURL != expected.SourceURL { + t.Errorf("%s.%s differs from official table: got %+v want %+v", path, p.Name, p, expected) + } + compare(path+"."+p.Name, p.Properties, expected.Properties) + compare(path+"."+p.Name+"[]", p.ItemsProperties, expected.ItemsProperties) + } + } + if !found { + t.Errorf("%s missing official field %s", path, expected.Name) + } + } + } + compare("agreementInfos[]", actual, model.Parameters) +} diff --git a/pkg/domain/provisioning_contract_test.go b/pkg/domain/provisioning_contract_test.go index bb3098d..19f8137 100644 --- a/pkg/domain/provisioning_contract_test.go +++ b/pkg/domain/provisioning_contract_test.go @@ -4,7 +4,7 @@ import "testing" func TestProvisioningLifecycleRequiredContracts(t *testing.T) { cases := []struct{ id, name, location, kind string }{ - {"provision-api-add-fingerprints", "appId", "header", ""}, + {"provision-api-add-fingerprints", "appId", "header", "string"}, {"provision-api-add-fingerprints", "fingerprintList", "body", "array"}, {"provision-api-delete-fingerprints", "fingerprintList", "body", "array"}, {"provision-api-apply-cent", "csr", "body", "string"}, @@ -18,7 +18,7 @@ func TestProvisioningLifecycleRequiredContracts(t *testing.T) { {"provision-api-delete-provision", "id", "query", "string"}, {"provision-api-update-provision", "provisionId", "body", "string"}, {"provision-api-update-provision", "deviceIdList", "body", "array"}, - {"provision-api-query-provision", "appId", "header", ""}, + {"provision-api-query-provision", "appId", "header", "string"}, } for _, c := range cases { t.Run(c.id+"/"+c.name, func(t *testing.T) { diff --git a/pkg/domain/publishing_agreement.go b/pkg/domain/publishing_agreement.go new file mode 100644 index 0000000..37f7ad8 --- /dev/null +++ b/pkg/domain/publishing_agreement.go @@ -0,0 +1,52 @@ +package domain + +// AgreementInfo has separate official models for user and privacy agreements. +// Keep nested rules in the domain so CLI, REST and OpenAPI share the same +// contract. Optional baseInfo becomes subject to its required name only when +// the caller supplies that object. +func applyPublishingAgreementModels(e Endpoint) Endpoint { + privacy := e.ID == "privacy-agreement-update" + if !privacy && e.ID != "user-agreement-create" && e.ID != "user-agreement-update" { + return e + } + const root = "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/" + infoSource := root + "agc-help-publish-api-data-agreementinfo-user-0000002236041482" + baseSource := root + "agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290" + base := []Parameter{ + {Name: "name", In: "body", Type: "string", Required: true, MaxLength: 100, SourceURL: baseSource}, + {Name: "agreementTitle", In: "body", Type: "string", MaxLength: 100, SourceURL: baseSource}, + {Name: "userAgreementUrl", In: "body", Type: "string", MaxLength: 512, SourceURL: baseSource}, + } + if privacy { + infoSource = root + "agc-help-publish-api-data-agreementinfo-privacy-0000002294845630" + baseSource = root + "publish-api-agreementbaseinfo-privacy-0000002328924929" + base = []Parameter{ + {Name: "name", In: "body", Type: "string", Required: true, MaxLength: 100, SourceURL: baseSource}, + {Name: "appName", In: "body", Type: "string", MaxLength: 255, SourceURL: baseSource}, + {Name: "companyName", In: "body", Type: "string", MaxLength: 1024, SourceURL: baseSource}, + {Name: "briefDesc", In: "body", Type: "string", MaxLength: 500, SourceURL: baseSource}, + {Name: "effectiveTime", In: "body", Type: "integer", SourceURL: baseSource}, + } + } + for i := range e.Parameters { + p := &e.Parameters[i] + if p.In != "body" || p.Name != "agreementInfos" { + continue + } + p.MaxItems = 100 + p.ItemsProperties = []Parameter{ + {Name: "lang", In: "body", Type: "string", Required: true, MaxLength: 20, Enum: []string{"zh", "en", "ug", "bo", "zh-Hant-HK", "zh-Hant-TW"}, SourceURL: infoSource}, + {Name: "baseInfo", In: "body", Type: "object", Properties: base, SourceURL: infoSource}, + } + if privacy { + p.ItemsProperties = append(p.ItemsProperties, + Parameter{Name: "personalInfo", In: "body", Type: "object", Properties: publishingPrivacyFields("PersonalInfo"), SourceURL: infoSource}, + Parameter{Name: "devicePermissions", In: "body", Type: "array", ItemsType: "object", ItemsProperties: publishingPrivacyFields("DevicePermission"), MaxItems: 200, SourceURL: infoSource}, + Parameter{Name: "thirdSdkInfo", In: "body", Type: "object", Properties: publishingPrivacyFields("ThirdSdkInfo"), SourceURL: infoSource}, + Parameter{Name: "thirdSharedInfos", In: "body", Type: "array", ItemsType: "object", ItemsProperties: publishingPrivacyFields("ThirdSharedInfo"), MaxItems: 200, SourceURL: infoSource}, + Parameter{Name: "extInfo", In: "body", Type: "object", Properties: publishingPrivacyFields("ExtendInfo"), SourceURL: infoSource}, + ) + } + } + return e +} diff --git a/pkg/domain/publishing_contract_test.go b/pkg/domain/publishing_contract_test.go new file mode 100644 index 0000000..e7e504b --- /dev/null +++ b/pkg/domain/publishing_contract_test.go @@ -0,0 +1,40 @@ +package domain + +import "testing" + +func TestHarmonyCompileStatusContract(t *testing.T) { + e, ok := EndpointByID("publishing", "package-compile-status-v3") + if !ok || e.Method != "GET" || e.Path != "/api/publish/v3/package/compile/status" { + t.Fatal("missing current HarmonyOS compile status endpoint") + } + for _, name := range []string{"appId", "pkgIds"} { + found := false + for _, p := range e.Parameters { + if p.Name == name && p.In == "query" && p.Required { + found = true + } + } + if !found { + t.Errorf("missing required query %s", name) + } + } +} + +func TestLanguageCommandsRequireApplicationAndLanguage(t *testing.T) { + for _, c := range []struct{ id, name, where string }{ + {"language-info-update", "appId", "query"}, + {"language-info-update", "lang", "body"}, + {"language-info-delete", "appId", "query"}, + {"language-info-delete", "lang", "query"}, + } { + t.Run(c.id+"/"+c.name, func(t *testing.T) { + e, _ := EndpointByID("publishing", c.id) + for _, p := range e.Parameters { + if p.Name == c.name && p.In == c.where && p.Required { + return + } + } + t.Fatalf("missing %s@%s", c.name, c.where) + }) + } +} diff --git a/pkg/domain/publishing_current.go b/pkg/domain/publishing_current.go new file mode 100644 index 0000000..2d3812e --- /dev/null +++ b/pkg/domain/publishing_current.go @@ -0,0 +1,263 @@ +package domain + +import "strings" + +// Current Publishing API operations and parameters from Huawei reference tables. +// Existing V2 commands are retained; V3 updates/submission have explicit V3 IDs. +func currentPublishingEndpoints() []Endpoint { + return []Endpoint{ + currentPublishingEndpoint("app-create", "创建APP ID", "POST", "/api/publish/v3/app", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939", []Parameter{ + {Name: "projectId", In: "query", Type: "string", Required: false, Description: "项目ID,获取方法请参见查看应用信息。 如果不传projectId,系统会先在内部创建一个与应用同名的项目,随后再创建应用。"}, + {Name: "appName", In: "body", Type: "string", Required: true, Description: "应用名称。"}, + {Name: "packageName", In: "body", Type: "string", Required: false, Description: "应用包名,必须唯一,且不能与其他应用(包括Android应用)包名相同。 说明 installationFree取值为0(HarmonyOS应用)时,此参数必填。 installationFree取值为1(元服务)时,系统将自动生成包名,此参数无需填写。"}, + {Name: "parentType", In: "body", Type: "integer", Required: true, Description: "应用分类。 取值范围: 2:游戏 13:应用"}, + {Name: "installationFree", In: "body", Type: "integer", Required: true, Description: "应用类型。 取值范围: 0:HarmonyOS应用 1:元服务 默认值:0"}, + }), + currentPublishingEndpoint("appid-list", "查询应用包名对应的appid", "GET", "/api/publish/v2/appid-list", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617", []Parameter{ + {Name: "packageName", In: "query", Type: "string", Required: true, Description: "需要查询的应用包名。 多个包名以逗号分隔,最多支持50个。"}, + {Name: "packageTypes", In: "query", Type: "string", Required: false, Description: "通过软件包类型过滤应用,只查询指定软件包类型的应用。 取值范围: 7:APP(HarmonyOS应用/元服务)"}, + }), + currentPublishingEndpoint("members-role-list", "查询团队账号下的成员角色列表", "GET", "/api/publish/v3/members-role-list", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743", []Parameter{ + {Name: "fromPage", In: "query", Type: "integer", Required: true, Description: "起始页。 最小值:1,表示从第1页开始查询。"}, + {Name: "pageSize", In: "query", Type: "integer", Required: true, Description: "每页查询的条数。 取值范围:[1,50]"}, + {Name: "languageCode", In: "query", Type: "string", Required: true, Description: "语言码。 取值范围: zh_cn:中文 en_us:英文 ru_ru:俄语"}, + }), + currentPublishingEndpoint("app-info-query-v3", "查询应用信息", "GET", "/api/publish/v3/app-info", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "需要查询的应用ID。"}, + {Name: "lang", In: "query", Type: "string", Required: false, Description: "需要查询的语言。 说明 取值参考语言类型。 不传该参数,则查询全部语言的应用信息。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 6:HarmonyOS测试发布方式(API>=10) 默认值:1"}, + {Name: "versionId", In: "query", Type: "string", Required: false, Description: "需要查询的版本ID。 注意 releaseType为6,该字段必填。"}, + }), + currentPublishingEndpoint("app-info-update-v3", "更新应用基本信息", "PUT", "/api/publish/v3/app-info", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "需要更新的应用ID。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 默认值:1"}, + {Name: "releasePhase", In: "query", Type: "integer", Required: false, Description: "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0"}, + {Name: "defaultLang", In: "body", Type: "string", Required: false, Description: "应用的默认语言。 说明 取值参见语言类型。"}, + {Name: "harmonyChildType", In: "body", Type: "integer", Required: false, Description: "HarmonyOS应用/元服务的二级分类。 固定ID。 说明 取值参见应用游戏分类。"}, + {Name: "kindMainTag", In: "body", Type: "integer", Required: false, Description: "HarmonyOS应用/元服务主标签。 固定ID。 说明 取值参见应用游戏分类的“标签”列。"}, + {Name: "kindSubTags", In: "body", Type: "array", Required: false, Description: "HarmonyOS应用/元服务附属标签。 固定ID。最多可选4个附属标签。 说明 取值参见应用游戏分类的“标签”列。", ItemsType: "integer"}, + {Name: "privacyPolicy", In: "body", Type: "string", Required: false, Description: "隐私政策网址。"}, + {Name: "appNetType", In: "body", Type: "integer", Required: false, Description: "应用联网类型。 取值范围: 1:单机 2:网游 默认值:1"}, + {Name: "publishCountry", In: "body", Type: "string", Required: true, Description: "应用发布国家的国家码。 多个国家以英文逗号分隔,例如:“CN,DE,MC”。 如果取值为“OTHER”,则表示当App Gallery支持的国家或地区列表中新增某个国家或地区时,应用将自动分发到新增的国家和地区。 注意 取值不能只包含OTHER。 如果国家码有设置非CN的地区,将存在个人信息出境的情况,具体请参考个人信息出境授权声明。"}, + {Name: "appTariffType", In: "body", Type: "string", Required: false, Description: "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 支持设置多个,使用英文逗号分隔,例如“1,2,3”。"}, + {Name: "publicationNumber", In: "body", Type: "string", Required: false, Description: "版号信息。 此参数只支持游戏类应用。"}, + {Name: "developerWebsite", In: "body", Type: "string", Required: false, Description: "开发者官网。"}, + {Name: "customInfo", In: "body", Type: "object", Required: false, Description: "客服信息。"}, + {Name: "deviceTypes", In: "body", Type: "array", Required: false, Description: "设备类型信息。", ItemsType: "object"}, + {Name: "privacyRightsUrl", In: "body", Type: "string", Required: false, Description: "隐私权利网址。 即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。"}, + {Name: "registeredDclType", In: "body", Type: "integer", Required: false, Description: "APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP"}, + {Name: "registeredIdType", In: "body", Type: "integer", Required: false, Description: "主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码)"}, + {Name: "registeredIdNumber", In: "body", Type: "string", Required: false, Description: "主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码"}, + {Name: "registeredEntity", In: "body", Type: "integer", Required: false, Description: "主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 若在版本提交时,该字段值选择“一致”,则主办单位名称和证件号,将直接复用开发者联盟注册账号信息。 若您提交的主办单位信息与联盟账号信息不一致,该字段值却选择了“一致”,则系统将自动判定为“不一致”,将会影响审核结果。"}, + {Name: "registeredEntityName", In: "body", Type: "string", Required: false, Description: "主办单位名称。 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。"}, + {Name: "privacyAgreementId", In: "body", Type: "string", Required: false, Description: "隐私协议ID。"}, + {Name: "userAgreementUrl", In: "body", Type: "string", Required: false, Description: "用户协议URL。"}, + {Name: "userAgreementIds", In: "body", Type: "array", Required: false, Description: "用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。", ItemsType: "string"}, + {Name: "encrypted", In: "body", Type: "integer", Required: true, Description: "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1"}, + {Name: "isAiGenerate", In: "body", Type: "integer", Required: false, Description: "是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。"}, + {Name: "aiTypes", In: "body", Type: "array", Required: false, Description: "涉及的AI生成合成服务类型。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景 说明 isAiGenerate取值为1(涉及)时,此参数必填。", ItemsType: "integer"}, + {Name: "testUserName", In: "body", Type: "string", Required: false, Description: "应用审核信息的测试账号用户名。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号用户名。"}, + {Name: "testUserPassword", In: "body", Type: "string", Required: false, Description: "应用审核信息的测试账号密码。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号密码。"}, + {Name: "appRemark", In: "body", Type: "string", Required: false, Description: "应用审核信息的备注。 提供有助于审核人员更准确、高效测试您应用的额外信息,比如在审核时需要的特别设置等。"}, + {Name: "selfTestVideos", In: "body", Type: "string", Required: false, Description: "应用审核信息的自测文件。 格式为JSON字符串,示例:{\"objectId1\":\"文件名1\",\"objectId2\":\"文件名2\"...} 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 最多可上传5个自测视频,总大小不超过500MB。 注意 此字段只支持元服务。 元服务需要与设备联动时,此参数必填。"}, + {Name: "appReviewPhoneInfo", In: "body", Type: "object", Required: false, Description: "应用负责人的手机号信息。用于沟通审核问题。"}, + {Name: "appReviewEmailInfo", In: "body", Type: "object", Required: false, Description: "应用负责人的邮箱账号信息。用于接收上架审核结果,应用整改或下架通知。"}, + {Name: "appReviewName", In: "body", Type: "string", Required: false, Description: "应用负责人的姓名。"}, + {Name: "versionVocs", In: "body", Type: "array", Required: false, Description: "应用版本已解决问题。 数组长度不超过1000。 说明 调用查询应用未处理的问题工单接口可以查询用户反馈的应用问题。如果在应用版本更新时某些问题已经解决,可以将这些问题提交审核,工单平台验证通过后会关闭工单。", ItemsType: "object"}, + }), + currentPublishingEndpoint("language-info-update-v3", "更新应用语言信息", "PUT", "/api/publish/v3/app-language-info", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "需要更新语言描述信息的应用ID。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 默认值:1"}, + {Name: "releasePhase", In: "query", Type: "integer", Required: false, Description: "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0"}, + {Name: "lang", In: "body", Type: "string", Required: true, Description: "语言种类。 说明 取值参见语言类型。"}, + {Name: "appName", In: "body", Type: "string", Required: false, Description: "对应语言的应用名称。 新增一个语言种类时,此字段必选。"}, + {Name: "appDesc", In: "body", Type: "string", Required: false, Description: "对应语言的应用描述信息。"}, + {Name: "briefInfo", In: "body", Type: "string", Required: false, Description: "对应语言的一句话简介。"}, + {Name: "newFeatures", In: "body", Type: "string", Required: false, Description: "对应语言的新版本简介。 说明 升级版本时,此参数必填。"}, + }), + currentPublishingEndpoint("language-info-delete", "删除应用语言信息", "DELETE", "/api/publish/v2/app-language-info", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "需要删除语言描述信息的应用ID。"}, + {Name: "lang", In: "query", Type: "string", Required: true, Description: "需要删除的语言。 说明 取值参见语言类型。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 默认值:1"}, + }), + currentPublishingEndpoint("app-file-info-v3", "更新应用文件信息", "PUT", "/api/publish/v3/app-file-info", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "需要更新的应用ID。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 默认值:1"}, + {Name: "releasePhase", In: "query", Type: "integer", Required: false, Description: "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0"}, + {Name: "appIconList", In: "body", Type: "array", Required: false, Description: "应用图标信息。 数组长度不超过20。 说明 应用图标必须与软件包中的应用图标一致,且需符合审核政策与应用文件要求。", ItemsType: "object"}, + {Name: "screenShotList", In: "body", Type: "array", Required: false, Description: "应用介绍截图信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。", ItemsType: "object"}, + {Name: "introVideoList", In: "body", Type: "array", Required: false, Description: "应用介绍视频信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。", ItemsType: "object"}, + {Name: "rcmdVideoList", In: "body", Type: "array", Required: false, Description: "推荐视频信息。 数组长度不超过20。", ItemsType: "object"}, + {Name: "rcmdPicList", In: "body", Type: "array", Required: false, Description: "推荐图片信息。 数组长度不超过20。", ItemsType: "object"}, + {Name: "elecCertificate", In: "body", Type: "string", Required: false, Description: "电子版本证书。"}, + {Name: "certificateList", In: "body", Type: "array", Required: false, Description: "应用版权证书或代理证书。 数组长度不超过10。", ItemsType: "string"}, + {Name: "publicationList", In: "body", Type: "array", Required: false, Description: "版号证明。 数组长度不超过10。", ItemsType: "string"}, + {Name: "packagePermissionIntroVideoList", In: "body", Type: "array", Required: false, Description: "包权限使用场景说明视频。 数组长度不超过100。 说明 隐私权限说明的“权限描述”、“权限使用设备范围”和“权限使用理由”从上传的软件包体中读取,无需通过接口更新。", ItemsType: "object"}, + {Name: "otherCertificatesURL", In: "body", Type: "string", Required: false, Description: "授权书及其他材料文件压缩包的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 若文件格式不正确,提交发布时会出错,具体限制如下: 压缩包必须为zip格式,不超过200MB。 解压后的大小不超过1GB。 文件夹层级不超过3层。 只能包含JPG、JPEG、BMP格式图片和PDF格式的文件,累计不超过200个。 说明 此字段只支持HarmonyOS应用,不支持元服务。"}, + {Name: "updateScreenShotList", In: "body", Type: "array", Required: false, Description: "更新截图素材。 数组长度不超过20。", ItemsType: "object"}, + {Name: "updateVideoList", In: "body", Type: "array", Required: false, Description: "更新视频素材。 数组长度不超过20。", ItemsType: "object"}, + }), + currentPublishingEndpoint("app-package-info-update", "更新应用软件包信息", "PUT", "/api/publish/v3/app-package-info", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "需要更新的应用ID。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 默认值:1"}, + {Name: "releasePhase", In: "query", Type: "integer", Required: false, Description: "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0"}, + {Name: "fileName", In: "body", Type: "string", Required: true, Description: "文件名称,包括文件的后缀名。"}, + {Name: "objectId", In: "body", Type: "string", Required: true, Description: "文件在文件服务器中的对象ID。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。"}, + }), + currentPublishingEndpoint("update-releasetime", "更新版本上架时间", "PUT", "/api/publish/v2/on-shelf-time", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "应用ID。"}, + {Name: "changeType", In: "body", Type: "integer", Required: true, Description: "修改类型。 取值范围: 2:指定时间上架改为审核通过立即上架 3:变更定时上架时间"}, + {Name: "releaseTime", In: "body", Type: "string", Required: true, Description: "指定的版本上架时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 changeType为3时有效。"}, + {Name: "releaseType", In: "body", Type: "integer", Required: true, Description: "发布方式。 取值范围: 1:全网 目前支持全网及releasePhase为3的分阶段发布。"}, + }), + currentPublishingEndpoint("phased-release-update", "更新分阶段发布", "PUT", "/api/publish/v2/version/phased-release", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "versionId", In: "body", Type: "string", Required: true, Description: "版本ID。 可从查询应用所有版本类型的版本列表接口返回的versionId参数中获取。"}, + {Name: "releasePhase", In: "body", Type: "integer", Required: false, Description: "分阶段发布标识。 取值范围: 3:分阶段。 4:分阶段转全网。"}, + {Name: "state", In: "body", Type: "string", Required: false, Description: "分阶段发布的状态。 取值范围: SUSPEND:暂停。 RELEASE:恢复为发布中。"}, + {Name: "description", In: "body", Type: "string", Required: false, Description: "分阶段发布说明。"}, + {Name: "phaseDay", In: "body", Type: "integer", Required: false, Description: "更新分阶段天数。 取值范围2、3、4、5、6、7,对应分阶段发布比例加速到2%、5%、10%、20%、50%、100%。"}, + }), + currentPublishingEndpoint("app-package-info-query", "查询应用软件包信息", "GET", "/api/publish/v2/app-package-info", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "packageId", In: "query", Type: "string", Required: true, Description: "待查询的软件包ID。"}, + }), + currentPublishingEndpoint("package-compile-status-v3", "查询软件包编译状态", "GET", "/api/publish/v3/package/compile/status", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "应用ID。"}, + {Name: "pkgIds", In: "query", Type: "string", Required: true, Description: "待查询的软件包ID。 多个ID之间用英文逗号分隔。 可从更新应用软件包信息接口返回的packageId参数中获取。"}, + }), + currentPublishingEndpoint("app-version-list", "查询应用所有版本类型的版本列表", "POST", "/api/publish/v3/version/brief-info/list", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "packageName", In: "body", Type: "string", Required: false, Description: "应用包名。 说明 appId和packageName至少传一个。"}, + {Name: "state", In: "body", Type: "string", Required: false, Description: "版本状态。 多个状态用逗号分隔。 说明 state字段的取值请参考AppInfo中的releaseState参数。"}, + }), + currentPublishingEndpoint("app-version-voc", "查询应用未处理的问题工单", "POST", "/api/publish/v1/app-voc/version-voc", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "vocId", In: "body", Type: "string", Required: false, Description: "工单ID。"}, + {Name: "vocDesc", In: "body", Type: "string", Required: false, Description: "工单描述。"}, + {Name: "pageNo", In: "body", Type: "integer", Required: true, Description: "当前页。 最小值:1"}, + {Name: "pageSize", In: "body", Type: "integer", Required: true, Description: "每页数量。 最大值:100"}, + }), + currentPublishingEndpoint("tag-qual-dependent", "查询需要上传的资质文件信息", "GET", "/api/publish/v2/tag-qual-dependent", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577", []Parameter{}), + currentPublishingEndpoint("qualification-review-create", "提交资质审核任务", "POST", "/api/publish/v2/qualification-review-task", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "tagQualInfos", In: "body", Type: "array", Required: true, Description: "标签和标签对应的资质信息列表。 数组长度不超过5。", ItemsType: "object"}, + }), + currentPublishingEndpoint("qualification-review-query", "查询资质审核任务详情", "GET", "/api/publish/v2/qualification-review-task", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "tagIds", In: "query", Type: "string", Required: true, Description: "审核任务包含的标签ID列表,逗号分隔。"}, + }), + currentPublishingEndpoint("qualification-review-update", "修改资质审核任务", "PUT", "/api/publish/v2/qualification-review-task", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "tagQualInfos", In: "body", Type: "array", Required: true, Description: "标签和标签对应的资质信息列表。 数组长度不超过5。", ItemsType: "object"}, + }), + currentPublishingEndpoint("qualification-review-cancel", "撤销资质审核任务", "PUT", "/api/publish/v2/qualification-review-task/cancel", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "taskId", In: "body", Type: "string", Required: true, Description: "资质审核任务ID。"}, + }), + currentPublishingEndpoint("qualification-review-delete", "删除资质审核任务", "DELETE", "/api/publish/v2/qualification-review-task", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "tagIds", In: "body", Type: "array", Required: true, Description: "需要删除的资质审核标签ID列表,逗号分隔。 数组长度不超过5。 说明 具体取值请参见元服务的“标签ID”列。", ItemsType: "string"}, + }), + currentPublishingEndpoint("user-agreement-create", "新建用户协议", "POST", "/api/publish/v2/agreement", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "type", In: "body", Type: "integer", Required: true, Description: "协议类型。 取值范围: 2:用户协议"}, + {Name: "defaultLang", In: "body", Type: "string", Required: false, Description: "用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)"}, + {Name: "agreementInfos", In: "body", Type: "array", ItemsType: "object", MaxItems: 100, Required: false, Description: "用户协议列表;以官方请求样例的数组格式为准,最多100项。"}, + {Name: "channel", In: "body", Type: "integer", Required: false, Description: "官方创建用户协议请求样例中的渠道字段。"}, + }), + currentPublishingEndpoint("user-agreement-list", "查询用户协议列表", "POST", "/api/publish/v2/agreement/list", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "agreementIdList", In: "body", Type: "array", Required: false, Description: "用户协议ID。 数组长度为1~1000。", ItemsType: "string"}, + {Name: "name", In: "body", Type: "string", Required: true, Description: "用户协议名称。 使用模糊查询方式。", AllowEmpty: true}, + {Name: "status", In: "body", Type: "integer", Required: false, Description: "用户协议状态。 取值范围: 2:已完成 3:已删除"}, + {Name: "type", In: "body", Type: "integer", Required: false, Description: "协议类型。 取值范围: 2:用户协议"}, + {Name: "fromRecCount", In: "body", Type: "integer", Required: false, Description: "查询起始位置。 默认值:1"}, + {Name: "maxReqCount", In: "body", Type: "integer", Required: false, Description: "最大请求查询数。 取值范围:[1,100] 默认值:30"}, + }), + currentPublishingEndpoint("user-agreement-update", "更新用户协议", "PUT", "/api/publish/v2/agreement", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "id", In: "body", Type: "string", Required: true, Description: "用户协议ID。"}, + {Name: "defaultLang", In: "body", Type: "string", Required: false, Description: "用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)"}, + {Name: "agreementInfos", In: "body", Type: "array", Required: false, Description: "用户协议列表。 数组长度不超过100。", ItemsType: "object"}, + }), + currentPublishingEndpoint("privacy-agreement-submit", "提交隐私政策协议", "PUT", "/api/publish/v2/agreement/submit", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "id", In: "body", Type: "string", Required: true, Description: "隐私政策协议ID。"}, + {Name: "requireConfirm", In: "body", Type: "integer", Required: false, Description: "是否弹窗确认。 取值范围: 1:是 0:否"}, + }), + currentPublishingEndpoint("privacy-agreement-list", "查询隐私政策协议列表", "POST", "/api/publish/v2/agreement/list", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "agreementIdList", In: "body", Type: "array", Required: false, Description: "隐私政策协议ID。 数组长度为1~1000。", ItemsType: "string"}, + {Name: "name", In: "body", Type: "string", Required: true, Description: "隐私政策协议名称。 使用模糊查询方式。", AllowEmpty: true}, + {Name: "status", In: "body", Type: "integer", Required: false, Description: "隐私政策协议状态。 取值范围: 1:草稿 2:已完成 3:已删除 不传值:默认查未删除的记录"}, + {Name: "type", In: "body", Type: "integer", Required: false, Description: "协议类型。 取值范围: 1:隐私政策协议"}, + {Name: "fromRecCount", In: "body", Type: "integer", Required: false, Description: "起始页数。 默认值:1"}, + {Name: "maxReqCount", In: "body", Type: "integer", Required: false, Description: "每页返回条数。 取值范围:[1,100] 默认值:30"}, + }), + currentPublishingEndpoint("privacy-agreement-update", "更新隐私政策协议", "PUT", "/api/publish/v2/agreement", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "id", In: "body", Type: "string", Required: true, Description: "隐私政策协议ID。"}, + {Name: "defaultLang", In: "body", Type: "string", Required: false, Description: "隐私政策协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)"}, + {Name: "agreementInfos", In: "body", Type: "array", Required: false, Description: "隐私政策协议列表。 数组长度不超过100。", ItemsType: "object"}, + }), + currentPublishingEndpoint("app-age-rating", "申请年龄分级", "POST", "/api/publish/v2/app-age-rating", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID。 获取方法参考查看应用信息。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 默认值:1"}, + {Name: "releasePhase", In: "query", Type: "integer", Required: false, Description: "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0"}, + {Name: "feedback", In: "body", Type: "string", Required: true, Description: "问卷内容。 说明 具体请参见feedback获取方式。"}, + {Name: "expectedRating", In: "body", Type: "integer", Required: false, Description: "预期年龄分级。 取值范围: 1:巴西适用所有年龄段,中国区及其他区域年满3周岁 2:中国区年满8周岁,巴西年满10周岁,其他区域年满7周岁 3:巴西年满14周岁,中国区及其他区域年满12周岁 4:年满16周岁 5:年满18周岁"}, + {Name: "ratingRule", In: "body", Type: "integer", Required: false, Description: "年龄分级生效规则。 取值范围: 0:以问卷内容评级结果为准。 1:当预期年龄分级expectedRating设置的值大于问卷评级结果中的年龄值时,以预期年龄分级为准,否则以问卷内容评级结果为准。"}, + {Name: "childFlag", In: "body", Type: "integer", Required: false, Description: "应用是否仅面向儿童。 取值范围: 0:应用不仅面向儿童 1:应用仅面向儿童"}, + }), + currentPublishingEndpoint("app-submit-v3", "提交发布", "POST", "/api/publish/v3/app-submit", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "应用ID。"}, + {Name: "releaseTime", In: "body", Type: "string", Required: false, Description: "指定发布时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 可以不用填写,则表示立刻发布。 说明 如果在首次提交发布时已设置过releaseTime参数,撤销审核后再次提交发布时,需要将releaseTime参数重新设置为过去的时间,才能实现立即发布。"}, + {Name: "remark", In: "body", Type: "string", Required: false, Description: "提审发布备注。 可以为空,如果填写则长度范围为10-300。"}, + {Name: "releaseType", In: "body", Type: "integer", Required: false, Description: "应用发布方式。 取值范围: 1:全网 默认值:1"}, + {Name: "releasePhase", In: "body", Type: "integer", Required: false, Description: "分阶段发布标识。 取值范围: 0:全网发布 3:分阶段发布(7天内自动更新) 默认值:0"}, + {Name: "phasedReleaseDescription", In: "body", Type: "string", Required: false, Description: "分阶段发布说明。 说明 releasePhase取值为3(分阶段发布)时,此参数必填。"}, + }), + currentPublishingEndpoint("on-shelf-cancel", "撤销审核", "PUT", "/api/publish/v3/version/on-shelf/cancel", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637", []Parameter{ + {Name: "appId", In: "header", Type: "string", Required: true, Description: "应用ID,获取方法参考查看应用信息。"}, + {Name: "versionId", In: "body", Type: "string", Required: true, Description: "版本ID。"}, + }), + currentPublishingEndpoint("app-shelf-off", "下架应用", "POST", "/api/publish/v2/app-shelf-off", "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450", []Parameter{ + {Name: "appId", In: "query", Type: "string", Required: true, Description: "需要下架的应用ID。"}, + {Name: "reason", In: "query", Type: "string", Required: true, Description: "下架的原因描述。 说明 中文字符需要进行URL编码后再传入。"}, + {Name: "releaseType", In: "query", Type: "integer", Required: false, Description: "下架的方式。 取值范围: 1:全网下架。 默认值:1"}, + }), + } +} + +func currentPublishingEndpoint(id, name, method, path, sourceURL string, parameters []Parameter) Endpoint { + e := officialEndpoint("publishing", id, name, name, method, path, nil, sourceURL[strings.LastIndex(sourceURL, "/")+1:], sourceURL, "developer-to-huawei") + e.Parameters = parameters + e.RequiredParams = nil + for _, p := range parameters { + if p.Required { + e.RequiredParams = append(e.RequiredParams, p.Name) + } + } + e.Body = inferBody(method, parameters) + e = applyReferenceParameters(e) + e = applyPublishingAgreementModels(e) + e = applyPublishingMetadataModels(e) + return applyPublishingQualificationModels(e) +} + +func init() { + for _, current := range currentPublishingEndpoints() { + replaced := false + for i, existing := range EndpointFamilies["publishing"] { + if existing.ID == current.ID { + EndpointFamilies["publishing"][i] = current + replaced = true + break + } + } + if !replaced { + EndpointFamilies["publishing"] = append(EndpointFamilies["publishing"], current) + } + } +} diff --git a/pkg/domain/publishing_legacy_enum_openapi_test.go b/pkg/domain/publishing_legacy_enum_openapi_test.go new file mode 100644 index 0000000..4037e41 --- /dev/null +++ b/pkg/domain/publishing_legacy_enum_openapi_test.go @@ -0,0 +1,18 @@ +package domain + +import ( + "reflect" + "testing" +) + +func TestLegacyAppInfoOpenAPIIncludesDocumentedSignedEnumValues(t *testing.T) { + op := OpenAPISpec()["paths"].(map[string]any)["/api/v1/publishing/endpoints/app-info-update/invoke"].(map[string]any)["post"].(map[string]any) + schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + body := schema["properties"].(map[string]any)["body"].(map[string]any)["properties"].(map[string]any) + for name, want := range map[string][]int64{"isFree": {0, 1}, "registeredDclType": {-1, 0, 1, 2}, "registeredIdType": {-1, 1, 2, 3}} { + p := body[name].(map[string]any) + if !reflect.DeepEqual(p["enum"], want) { + t.Fatalf("%s enum=%#v, want %#v", name, p["enum"], want) + } + } +} diff --git a/pkg/domain/publishing_metadata.go b/pkg/domain/publishing_metadata.go new file mode 100644 index 0000000..2c04a3a --- /dev/null +++ b/pkg/domain/publishing_metadata.go @@ -0,0 +1,44 @@ +package domain + +// The metadata update accepts model objects directly. Their names in the +// reference are type names, not extra JSON wrapper properties. +func applyPublishingMetadataModels(e Endpoint) Endpoint { + if e.ID != "app-info-update-v3" { + return e + } + const root = "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/" + customerSource := root + "agc-help-publish-api-data-custinfo-0000002504067925" + deviceSource := root + "agc-help-publish-api-data-devicetypeinfo-0000002236201270" + contactSource := root + "agc-help-publish-api-data-appreviewcontact-0000002505438989" + vocSource := root + "agc-help-publish-api-data-versionvoc-0000002495156924" + for i := range e.Parameters { + p := &e.Parameters[i] + if p.In != "body" { + continue + } + switch p.Name { + case "customInfo": + p.Properties = []Parameter{ + {Name: "phone", In: "body", Type: "string", MaxLength: 50, SourceURL: customerSource}, + {Name: "email", In: "body", Type: "string", MaxLength: 50, SourceURL: customerSource}, + {Name: "qqNum", In: "body", Type: "string", MaxLength: 50, SourceURL: customerSource}, + {Name: "internalPath", In: "body", Type: "string", MaxLength: 100, SourceURL: customerSource}, + } + case "deviceTypes": + p.ItemsProperties = []Parameter{ + {Name: "deviceType", In: "body", Type: "integer", Required: true, Enum: []string{"4", "5", "8", "12", "14", "19"}, SourceURL: deviceSource}, + {Name: "appAdapters", In: "body", Type: "string", MaxLength: 32, SourceURL: deviceSource}, + {Name: "remoteControl", In: "body", Type: "string", MaxLength: 16, Enum: []string{"1"}, SourceURL: deviceSource}, + } + case "appReviewPhoneInfo", "appReviewEmailInfo": + p.Properties = []Parameter{{Name: "account", In: "body", Type: "string", MaxLength: 500, SourceURL: contactSource}} + case "versionVocs": + p.ItemsProperties = []Parameter{ + {Name: "versionId", In: "body", Type: "string", Required: true, MaxLength: 32, SourceURL: vocSource}, + {Name: "packageId", In: "body", Type: "string", Required: true, MaxLength: 32, SourceURL: vocSource}, + {Name: "vocId", In: "body", Type: "string", Required: true, MaxLength: 32, SourceURL: vocSource}, + } + } + } + return e +} diff --git a/pkg/domain/publishing_openapi_test.go b/pkg/domain/publishing_openapi_test.go new file mode 100644 index 0000000..9cfd9b2 --- /dev/null +++ b/pkg/domain/publishing_openapi_test.go @@ -0,0 +1,102 @@ +package domain + +import ( + "encoding/json" + "os" + "strings" + "testing" +) + +func TestCurrentPublishingOpenAPIExposesOfficialParameters(t *testing.T) { + raw, err := os.ReadFile("../../cmd/agc/command/testdata/publishing-current.json") + if err != nil { + t.Fatal(err) + } + var ref struct { + Endpoints []struct { + ID, Method, Path string + Parameters []struct { + Name, In, Type string + Required bool + } + } + } + if err = json.Unmarshal(raw, &ref); err != nil { + t.Fatal(err) + } + paths := OpenAPISpec()["paths"].(map[string]any) + for _, e := range ref.Endpoints { + t.Run(e.ID, func(t *testing.T) { + route := "/api/v1/publishing/endpoints/" + e.ID + "/invoke" + item, ok := paths[route].(map[string]any) + if !ok { + t.Fatalf("missing route %s", route) + } + operation := item["post"].(map[string]any) + if operation["x-huawei-method"] != e.Method || operation["x-huawei-path"] != e.Path { + t.Fatal("wrong Huawei operation exposed") + } + schema := operation["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + props := schema["properties"].(map[string]any) + for _, p := range e.Parameters { + container := map[string]string{"query": "query", "header": "headers", "body": "body"}[p.In] + object := props[container].(map[string]any) + fields, ok := object["properties"].(map[string]any) + if !ok { + t.Fatalf("missing %s schema", container) + } + field, ok := fields[p.Name].(map[string]any) + if !ok { + t.Fatalf("missing %s.%s", container, p.Name) + } + typ := "object" + switch { + case strings.HasPrefix(p.Type, "String"): + typ = "string" + case strings.HasPrefix(p.Type, "Integer"): + typ = "integer" + case strings.HasPrefix(p.Type, "List<"): + typ = "array" + } + if p.In == "body" { + if field["type"] != typ { + t.Errorf("%s wrong type", p.Name) + } + } else if field["x-huawei-type"] != typ { + t.Errorf("%s wrong upstream type", p.Name) + } + found := false + required, _ := object["required"].([]string) + for _, name := range required { + if name == p.Name { + found = true + } + } + if p.In == "query" { + allOf, _ := schema["allOf"].([]any) + for _, condition := range allOf { + branches, _ := condition.(map[string]any)["anyOf"].([]any) + alternatives := map[string]bool{} + for _, rawBranch := range branches { + branch := rawBranch.(map[string]any) + for _, container := range branch["required"].([]string) { + nested := branch["properties"].(map[string]any)[container].(map[string]any) + for _, name := range nested["required"].([]string) { + if name == p.Name { + alternatives[container] = true + } + } + } + } + if alternatives["query"] && alternatives["queryValues"] { + found = true + } + } + } + if found != p.Required { + t.Errorf("%s wrong requiredness", p.Name) + } + } + }) + } +} diff --git a/pkg/domain/publishing_privacy.go b/pkg/domain/publishing_privacy.go new file mode 100644 index 0000000..4677da2 --- /dev/null +++ b/pkg/domain/publishing_privacy.go @@ -0,0 +1,110 @@ +package domain + +// These are the reviewed privacy-policy request models. Each field retains +// the exact model URL; the same structure drives CLI/REST validation and +// OpenAPI. Integer widths describe types, not numeric bounds. All nested +// fields below are optional, as marked in the official model tables. +func publishingPrivacyFields(model string) []Parameter { + const root = "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/" + sources := map[string]string{ + "PersonalInfo": "agc-help-publish-api-data-personalinfo-0000002328805173", + "RequiredInfo": "agc-help-publish-api-data-requiredinfo-0000002295005294", + "RecommendInfo": "agc-help-publish-api-data-recommendinfo-0000002328805177", + "AdsInfo": "agc-help-publish-api-data-adsinfo-0000002295005298", + "FullServiceMode": "agc-help-publish-api-data-fullservicemode-0000002294845638", + "ContractObligationMode": "agc-help-publish-api-data-contractobligationmode-0000002328924941", + "LawRegulationMode": "agc-help-publish-api-data-lawregulationmode-0000002295005342", + "ServiceTypeInfo": "agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "SceneItem": "agc-help-publish-api-data-sceneitem-0000002294845634", + "DataItem": "agc-help-publish-api-data-dataitem-0000002328924933", + "DevicePermission": "agc-help-publish-api-data-devicepermission-0000002294845674", + "Permission": "agc-help-publish-api-data-permission-0000002328924977", + "ThirdSdkInfo": "agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "SdkInfo": "agc-help-publish-api-data-sdkinfo-0000002295005346", + "ThirdSharedInfo": "agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "ExtendInfo": "agc-help-publish-api-data-extendinfo-0000002328924981", + "ContactInfo": "agc-help-publish-api-data-contactinfo-0000002328805225", + "StorageInfo": "agc-help-publish-api-data-storageinfo-0000002295005350", + "VersionChangeDesc": "agc-help-publish-api-data-versionchangedesc-0000002294845686", + "ManagePersonalInfo": "agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "InfoAccess": "agc-help-publish-api-data-infoaccess-0000002328805233", + "InfoModify": "agc-help-publish-api-data-infomodify-0000002295005354", + "InfoDelete": "agc-help-publish-api-data-infodelete-0000002294845690", + "InfoCancel": "agc-help-publish-api-data-infocancel-0000002328924989", + "ServiceStop": "agc-help-publish-api-data-servicestop-0000002328805237", + "CustomInfo": "agc-help-publish-api-data-custominfo-0000002295005358", + "CustomChapter": "agc-help-publish-api-data-customchapter-0000002294845694", + "ExtFieldCustomInfo": "agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + } + source := root + sources[model] + text := func(name string, length int) Parameter { + return Parameter{Name: name, In: "body", Type: "string", MaxLength: length, SourceURL: source} + } + object := func(name, child string) Parameter { + return Parameter{Name: name, In: "body", Type: "object", Properties: publishingPrivacyFields(child), SourceURL: source} + } + list := func(name, child string, maximum int) Parameter { + return Parameter{Name: name, In: "body", Type: "array", ItemsType: "object", ItemsProperties: publishingPrivacyFields(child), MaxItems: maximum, SourceURL: source} + } + switch model { + case "PersonalInfo": + return []Parameter{object("requiredInfo", "RequiredInfo"), object("recommendInfo", "RecommendInfo"), object("adsInfo", "AdsInfo"), object("fullServiceMode", "FullServiceMode"), object("contractObligationMode", "ContractObligationMode"), object("lawRegulationMode", "LawRegulationMode")} + case "RequiredInfo": + return []Parameter{list("sceneItems", "SceneItem", 200)} + case "RecommendInfo": + return []Parameter{list("sceneItems", "SceneItem", 200), text("closeSetting", 500)} + case "AdsInfo": + return []Parameter{list("sceneItems", "SceneItem", 200), text("pushContent", 500), text("closeSetting", 500)} + case "FullServiceMode": + return []Parameter{text("selectPath", 500), text("personalCollectType", 500), text("basicServiceType", 500), text("extraServiceType", 500)} + case "ContractObligationMode": + return []Parameter{text("serviceType", 500), text("personalCollectReason", 500), list("serviceTypeInfos", "ServiceTypeInfo", 100)} + case "LawRegulationMode": + return []Parameter{list("serviceTypeInfos", "ServiceTypeInfo", 100)} + case "ServiceTypeInfo": + return []Parameter{text("serviceType", 100), list("sceneItems", "SceneItem", 200)} + case "SceneItem": + return []Parameter{list("dataItems", "DataItem", 200), text("sceneId", 64), text("sceneReason", 500), text("collectModeId", 64), text("collectMode", 500), text("legalBasisId", 64), text("legalBasis", 500), text("remark", 500)} + case "DataItem": + return []Parameter{text("itemId", 64), text("itemDesc", 500), {Name: "sensitiveData", In: "body", Type: "integer", Enum: []string{"0", "1"}, SourceURL: source}} + case "DevicePermission": + permissions := list("permissions", "Permission", 200) + permissions.MinItems = 1 + return []Parameter{permissions, text("reasonId", 64), text("reason", 500), text("groupId", 100), text("groupName", 256)} + case "Permission": + return []Parameter{text("permissionName", 100), text("permissionDesc", 500)} + case "ThirdSdkInfo": + return []Parameter{list("sdkInfos", "SdkInfo", 50)} + case "SdkInfo": + return []Parameter{text("name", 100), text("providerName", 100), text("version", 100), text("privacyDeclare", 512), list("privacyLabels", "SceneItem", 200), text("scene", 200), text("collectType", 100), text("purpose", 500)} + case "ThirdSharedInfo": + return []Parameter{text("name", 100), text("purpose", 500), text("personalType", 500), text("officialPrivacyUrl", 1024), text("serviceType", 100), text("scene", 200), text("shareType", 100), list("dataItems", "DataItem", 200)} + case "ExtendInfo": + return []Parameter{object("contactInfo", "ContactInfo"), object("storageInfo", "StorageInfo"), text("childPrivacyUrl", 512), list("versionChangeDescs", "VersionChangeDesc", 0), text("abstracts", 300), object("managePersonalInfo", "ManagePersonalInfo"), object("customInfo", "CustomInfo"), text("extField", 8192), object("extFieldCustomInfo", "ExtFieldCustomInfo")} + case "ContactInfo": + return []Parameter{ + {Name: "email", In: "body", Type: "array", ItemsType: "string", MaxItems: 10, ItemsMaxLength: 100, SourceURL: source}, + {Name: "phoneNum", In: "body", Type: "array", ItemsType: "string", MaxItems: 10, ItemsMaxLength: 31, SourceURL: source}, + text("companyAddress", 512), text("customContactInfo", 500), + } + case "StorageInfo": + return []Parameter{text("storagePeriod", 512), text("country", 100), {Name: "isCrossBorder", In: "body", Type: "boolean", SourceURL: source}, text("crossBorderReason", 500), text("crossBorderReceiveName", 100), list("crossBorderDeclarations", "SceneItem", 200), text("crossBorderCountry", 100)} + case "VersionChangeDesc": + return []Parameter{text("chapter", 50), text("desc", 500)} + case "ManagePersonalInfo": + return []Parameter{object("infoAccess", "InfoAccess"), object("infoModify", "InfoModify"), object("infoDelete", "InfoDelete"), object("infoCancel", "InfoCancel"), object("serviceStop", "ServiceStop")} + case "InfoAccess", "InfoModify", "InfoDelete": + return []Parameter{text("personalSettingPath", 500), text("personalType", 500)} + case "InfoCancel": + return []Parameter{text("personalSettingPath", 500), text("serviceType", 200)} + case "ServiceStop": + return []Parameter{text("personalSettingPath", 500)} + case "CustomInfo": + return []Parameter{text("title", 100), text("customInfoDesc", 5000), list("customInfos", "CustomChapter", 5)} + case "CustomChapter": + return []Parameter{text("title", 100), text("customInfoDesc", 3000)} + case "ExtFieldCustomInfo": + return []Parameter{text("childPrivacyTitle", 512), text("childPrivacyCustomInfoDesc", 5000)} + } + return nil +} diff --git a/pkg/domain/publishing_privacy_test.go b/pkg/domain/publishing_privacy_test.go new file mode 100644 index 0000000..20fa377 --- /dev/null +++ b/pkg/domain/publishing_privacy_test.go @@ -0,0 +1,129 @@ +package domain + +import ( + "encoding/json" + "path" + "regexp" + "strconv" + "strings" + "testing" +) + +// Compare every deep field to its independently browser-read parameter row. +// This checks more than registry-generated fixtures: missing fields, incorrect +// types, requiredness and explicit string/array bounds all fail the audit. +func TestPrivacyModelsMatchReviewedSourceTables(t *testing.T) { + seen := map[string]bool{} + var visit func([]Parameter) + visit = func(fields []Parameter) { + if len(fields) == 0 { + return + } + source := fields[0].SourceURL + if seen[source] { + return + } + seen[source] = true + raw, err := referenceDocuments.ReadFile("reference/supplemental/" + path.Base(source) + ".json") + if err != nil { + t.Fatal(err) + } + var doc struct{ Tables []struct{ Rows [][]string } } + if err = json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + rows := map[string][]string{} + for _, table := range doc.Tables { + for _, row := range table.Rows { + if len(row) >= 4 && row[0] != "参数名称" { + rows[row[0]] = row + } + } + } + if len(fields) != len(rows) { + t.Errorf("%s: implemented %d/%d fields", source, len(fields), len(rows)) + } + for _, field := range fields { + row, ok := rows[field.Name] + if !ok { + t.Errorf("undocumented field %s.%s", source, field.Name) + continue + } + if field.Required != (row[1] == "M") { + t.Errorf("%s wrong requiredness", field.Name) + } + kind := "object" + switch { + case strings.HasPrefix(row[2], "String"): + kind = "string" + case strings.HasPrefix(row[2], "Integer"): + kind = "integer" + case row[2] == "boolean": + kind = "boolean" + case strings.HasPrefix(row[2], "List<"): + kind = "array" + } + if field.Type != kind { + t.Errorf("%s wrong type %s, expected %s", field.Name, field.Type, kind) + } + if match := regexp.MustCompile(`^String\((\d+)\)$`).FindStringSubmatch(row[2]); len(match) > 0 { + limit, _ := strconv.Atoi(match[1]) + if field.MaxLength != limit { + t.Errorf("%s missing string bound %d", field.Name, limit) + } + } + if match := regexp.MustCompile(`^List$`).FindStringSubmatch(row[2]); len(match) > 0 { + limit, _ := strconv.Atoi(match[1]) + if field.ItemsType != "string" || field.ItemsMaxLength != limit { + t.Errorf("%s missing string-item bound %d", field.Name, limit) + } + } + if match := regexp.MustCompile(`数组长度不超过(\d+)`).FindStringSubmatch(row[3]); len(match) > 0 { + limit, _ := strconv.Atoi(match[1]) + if field.MaxItems != limit { + t.Errorf("%s missing array maximum %d", field.Name, limit) + } + } + if strings.Contains(row[3], "数组长度为1~200") && (field.MinItems != 1 || field.MaxItems != 200) { + t.Errorf("%s missing explicit array interval", field.Name) + } + visit(field.Properties) + visit(field.ItemsProperties) + } + } + for _, model := range []string{"PersonalInfo", "DevicePermission", "ThirdSdkInfo", "ThirdSharedInfo", "ExtendInfo"} { + visit(publishingPrivacyFields(model)) + } + if len(seen) != 28 { + t.Fatalf("reviewed model coverage %d, want 28", len(seen)) + } +} + +func TestPrivacyOpenAPIExposesDeepBoundsAndBoolean(t *testing.T) { + e, _ := EndpointByID("publishing", "privacy-agreement-update") + schema := invokeRequestSchemaProperties(e)["body"].(map[string]any) + props := schema["properties"].(map[string]any) + item := props["agreementInfos"].(map[string]any)["items"].(map[string]any)["properties"].(map[string]any) + sdks := item["thirdSdkInfo"].(map[string]any)["properties"].(map[string]any)["sdkInfos"].(map[string]any) + if sdks["maxItems"] != 50 { + t.Fatal("SDK limit missing") + } + labels := sdks["items"].(map[string]any)["properties"].(map[string]any)["privacyLabels"].(map[string]any) + if labels["maxItems"] != 200 { + t.Fatal("SDK labels limit missing") + } + data := labels["items"].(map[string]any)["properties"].(map[string]any)["dataItems"].(map[string]any) + sensitive := data["items"].(map[string]any)["properties"].(map[string]any)["sensitiveData"].(map[string]any) + if sensitive["type"] != "integer" || len(sensitive["enum"].([]int64)) != 2 { + t.Fatal("sensitive-data enum lost") + } + ext := item["extInfo"].(map[string]any)["properties"].(map[string]any) + storage := ext["storageInfo"].(map[string]any)["properties"].(map[string]any) + if storage["isCrossBorder"].(map[string]any)["type"] != "boolean" { + t.Fatal("cross-border flag must remain boolean") + } + contact := ext["contactInfo"].(map[string]any)["properties"].(map[string]any)["phoneNum"].(map[string]any) + if contact["maxItems"] != 10 || contact["items"].(map[string]any)["maxLength"] != 31 { + t.Fatal("contact array/item bounds missing") + } +} diff --git a/pkg/domain/publishing_qualification.go b/pkg/domain/publishing_qualification.go new file mode 100644 index 0000000..48e2f67 --- /dev/null +++ b/pkg/domain/publishing_qualification.go @@ -0,0 +1,38 @@ +package domain + +func applyPublishingQualificationModels(e Endpoint) Endpoint { + if e.ID != "qualification-review-create" && e.ID != "qualification-review-update" { + return e + } + const root = "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/" + tagSource := root + "agc-help-publish-api-data-tagqualinfo-0000002236041478" + qualSource := root + "agc-help-publish-api-data-qualificationinfo-0000002236201286" + fileSource := root + "agc-help-publish-api-data-qualificationfileinfo-0000002271160609" + files := []Parameter{ + {Name: "objectId", In: "body", Type: "string", Required: true, MaxLength: 128, SourceURL: fileSource}, + {Name: "fileName", In: "body", Type: "string", Required: true, MaxLength: 128, SourceURL: fileSource}, + {Name: "fileSize", In: "body", Type: "integer", Required: true, SourceURL: fileSource}, + {Name: "sha256", In: "body", Type: "string", Required: true, MaxLength: 128, SourceURL: fileSource}, + } + qualifications := []Parameter{ + {Name: "qualificationCode", In: "body", Type: "string", Required: true, MaxLength: 32, SourceURL: qualSource}, + {Name: "qualificationFileInfos", In: "body", Type: "array", Required: true, ItemsType: "object", ItemsProperties: files, MaxItems: 10, SourceURL: qualSource}, + {Name: "validityType", In: "body", Type: "integer", Required: true, Enum: []string{"0", "1"}, SourceURL: qualSource}, + {Name: "startTime", In: "body", Type: "string", Format: "date", MaxLength: 20, SourceURL: qualSource}, + {Name: "expireTime", In: "body", Type: "string", Format: "date", MaxLength: 20, SourceURL: qualSource}, + } + for i := range e.Parameters { + p := &e.Parameters[i] + if p.In != "body" || p.Name != "tagQualInfos" { + continue + } + p.ItemsProperties = []Parameter{ + {Name: "tagId", In: "body", Type: "string", Required: true, MaxLength: 64, SourceURL: tagSource}, + {Name: "taskId", In: "body", Type: "string", Required: e.ID == "qualification-review-update", MaxLength: 32, SourceURL: tagSource}, + {Name: "qualificationInfos", In: "body", Type: "array", ItemsType: "object", MaxItems: 10, ItemsProperties: qualifications, SourceURL: tagSource, ItemsRules: []ReferenceRule{ + {ID: "qualification_remaining_validity", Kind: "minimum_remaining_days", Field: "body.expireTime", MinDays: 30, When: &RuleCondition{Field: "body.validityType", Equals: "0", Default: "0"}, SourceURL: qualSource, Message: "Custom qualification expiry must have more than 30 days remaining.", Suggestion: "Use a real qualification expiry date in yyyy-MM-dd format with more than 30 days remaining; do not change the source certificate's validity."}, + }}, + } + } + return e +} diff --git a/pkg/domain/publishing_qualification_test.go b/pkg/domain/publishing_qualification_test.go new file mode 100644 index 0000000..aa7be94 --- /dev/null +++ b/pkg/domain/publishing_qualification_test.go @@ -0,0 +1,36 @@ +package domain + +import "testing" + +func TestQualificationOpenAPINestedRequiredness(t *testing.T) { + for _, id := range []string{"qualification-review-create", "qualification-review-update"} { + e, _ := EndpointByID("publishing", id) + body := invokeRequestSchemaProperties(e)["body"].(map[string]any) + tags := body["properties"].(map[string]any)["tagQualInfos"].(map[string]any)["items"].(map[string]any) + required := map[string]bool{} + for _, name := range tags["required"].([]string) { + required[name] = true + } + if !required["tagId"] || required["taskId"] != (id == "qualification-review-update") { + t.Fatalf("%s wrong create/update requirements: %v", id, required) + } + qualifications := tags["properties"].(map[string]any)["qualificationInfos"].(map[string]any) + item := qualifications["items"].(map[string]any) + props := item["properties"].(map[string]any) + if props["expireTime"].(map[string]any)["format"] != "date" { + t.Fatal("expiry format missing") + } + files := props["qualificationFileInfos"].(map[string]any)["items"].(map[string]any) + if len(files["required"].([]string)) != 4 { + t.Fatal("file model requirements missing") + } + size := files["properties"].(map[string]any)["fileSize"].(map[string]any) + if size["minimum"] != nil || size["maximum"] != nil { + t.Fatal("integer width must not become an invented size range") + } + rules := item["x-agc-rules"].([]ReferenceRule) + if len(rules) != 1 || rules[0].MinDays != 30 || rules[0].When.Equals != "0" { + t.Fatal("custom-validity branch rule missing") + } + } +} diff --git a/pkg/domain/publishing_reference_test.go b/pkg/domain/publishing_reference_test.go new file mode 100644 index 0000000..c6329f7 --- /dev/null +++ b/pkg/domain/publishing_reference_test.go @@ -0,0 +1,138 @@ +package domain + +import ( + "encoding/json" + "strings" + "testing" +) + +func TestPublishingDiscoveryExplainsPurpose(t *testing.T) { + for _, tc := range []struct{ id, purpose string }{ + {"app-create", "HarmonyOS应用/元服务"}, + {"qualification-review-create", "元服务"}, + {"app-package-info-update", "软件包"}, + } { + e, _ := EndpointByID("publishing", tc.id) + if e.Description == e.Name || !strings.Contains(e.Description, tc.purpose) { + t.Errorf("%s lacks official purpose: %s", tc.id, e.Description) + } + } +} + +func TestPublishingAgreementDocsIncludeLinkedModels(t *testing.T) { + for _, tc := range []struct{ id, info, base string }{ + {"user-agreement-create", "AgreementInfo(用户协议)", "AgreementBaseInfo(用户协议)"}, + {"privacy-agreement-update", "AgreementInfo(隐私政策协议)", "AgreementBaseInfo(隐私政策协议)"}, + } { + raw, _ := EndpointReference("publishing", tc.id) + var doc struct { + RelatedDocuments []struct { + Title string + Tables []json.RawMessage + } `json:"relatedDocuments"` + } + if err := json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + found := map[string]bool{} + for _, model := range doc.RelatedDocuments { + found[model.Title] = len(model.Tables) > 0 + } + for _, name := range []string{tc.info, tc.base} { + if !found[name] { + t.Errorf("%s missing full source model %s", tc.id, name) + } + } + } +} + +func TestUserAgreementDocsDoNotFollowAdjacentModelNavigation(t *testing.T) { + raw, _ := EndpointReference("publishing", "user-agreement-create") + var doc struct { + RelatedDocuments []struct{ Title string } `json:"relatedDocuments"` + } + if err := json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + for _, model := range doc.RelatedDocuments { + if strings.Contains(model.Title, "隐私政策") || model.Title == "AdsInfo" { + t.Fatalf("unrelated adjacent document included: %s", model.Title) + } + } +} + +func TestPublishingDocsIncludeOfficialErrorTable(t *testing.T) { + raw, _ := EndpointReference("publishing", "language-info-delete") + var doc struct { + RelatedDocuments []struct { + Title string + Tables []struct{ Rows [][]string } + } `json:"relatedDocuments"` + } + if err := json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + for _, model := range doc.RelatedDocuments { + if model.Title != "错误码" { + continue + } + for _, table := range model.Tables { + for _, row := range table.Rows { + if len(row) >= 2 && row[0] == "204144651" && strings.Contains(row[1], "默认语言") { + return + } + } + } + } + t.Fatal("missing official default-language business-error guidance") +} + +func TestPrivacyDocsIncludeBothApplicationKindExamples(t *testing.T) { + for _, id := range []string{"privacy-agreement-update", "privacy-agreement-list"} { + raw, _ := EndpointReference("publishing", id) + var doc struct { + Examples []struct{ Section, Text string } + } + if err := json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + section := "请求示例" + if id == "privacy-agreement-list" { + section = "响应示例" + } + found := false + for _, example := range doc.Examples { + if example.Section == section && strings.Contains(example.Text, "HarmonyOS应用") && strings.Contains(example.Text, "元服务") && strings.Contains(example.Text, "agreementInfos") { + found = true + } + } + if !found { + t.Fatalf("%s lost the application-kind example bodies", id) + } + } +} + +func TestPublishingAgreementOpenAPINestedModel(t *testing.T) { + paths := OpenAPISpec()["paths"].(map[string]any) + for _, id := range []string{"user-agreement-create", "user-agreement-update", "privacy-agreement-update"} { + op := paths["/api/v1/publishing/endpoints/"+id+"/invoke"].(map[string]any)["post"].(map[string]any) + schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + body := schema["properties"].(map[string]any)["body"].(map[string]any) + list := body["properties"].(map[string]any)["agreementInfos"].(map[string]any) + item := list["items"].(map[string]any) + props := item["properties"].(map[string]any) + if props["lang"].(map[string]any)["maxLength"] != 20 { + t.Fatalf("%s lost language bound", id) + } + base := props["baseInfo"].(map[string]any) + if base["properties"].(map[string]any)["name"].(map[string]any)["maxLength"] != 100 { + t.Fatalf("%s lost name bound", id) + } + if len(item["required"].([]string)) != 1 || item["required"].([]string)[0] != "lang" { + t.Fatalf("%s must require only lang", id) + } + if len(base["required"].([]string)) != 1 || base["required"].([]string)[0] != "name" { + t.Fatalf("%s missing conditional object requirement", id) + } + } +} diff --git a/pkg/domain/reference.go b/pkg/domain/reference.go new file mode 100644 index 0000000..87182ff --- /dev/null +++ b/pkg/domain/reference.go @@ -0,0 +1,506 @@ +package domain + +import ( + "embed" + "encoding/json" + "regexp" + "strconv" + "strings" + "sync" +) + +//go:embed reference/*/*.json +var referenceDocuments embed.FS + +type ReferenceSummary struct { + Title string `json:"title"` + SourceURL string `json:"sourceUrl"` + UpdatedAt string `json:"updatedAt,omitempty"` + CheckedAt string `json:"checkedAt,omitempty"` + Status string `json:"status"` + ReadCommand string `json:"readCommand"` +} + +type RuleCondition struct { + Field string `json:"field"` + Equals string `json:"equals"` + Default string `json:"default,omitempty"` +} +type ReferenceRule struct { + UnlessPresent string `json:"unlessPresent,omitempty"` + MinItems int `json:"minItems,omitempty"` + MaxItems int `json:"maxItems,omitempty"` + MinDays int `json:"minDays,omitempty"` + MaxDays int `json:"maxDays,omitempty"` + ID string `json:"id"` + Kind string `json:"kind"` + Field string `json:"field,omitempty"` + Fields []string `json:"fields,omitempty"` + When *RuleCondition `json:"when,omitempty"` + SourceURL string `json:"sourceUrl"` + Message string `json:"message"` + Suggestion string `json:"suggestion"` +} + +type InputViolation struct { + Code string `json:"code"` + Field string `json:"field"` + Message string `json:"message"` + SourceURL string `json:"sourceUrl"` + Suggestion string `json:"suggestion"` +} + +func EndpointReference(family, id string) (json.RawMessage, bool) { + data, err := referenceDocuments.ReadFile("reference/" + family + "/" + id + ".json") + if err != nil { + return nil, false + } + // Supplemental requirements and request models are separate official pages. + // Return their full source content with the endpoint rather than bare links. + var supplemental []string + if (family == "publishing" && (id == "app-file-info-v3" || id == "app-file-info")) || family == "upload" { + supplemental = append(supplemental, "application-file-requirements") + if family == "publishing" && id == "app-file-info-v3" { + supplemental = append(supplemental, "lang-file-info", "file-info", "package-permission-intro-video") + } + } + if family == "pms" { + switch id { + case "batchaddproduct-android", "batchupdateproduct-android": + supplemental = append(supplemental, "product-import-android") + case "batchaddproduct-harmonyosnext", "batchupdateproduct-harmonyosnext": + supplemental = append(supplemental, "product-import-harmonyosnext") + } + } + if family == "pms" && len(supplemental) > 0 { + platform := "android" + if supplemental[0] == "product-import-harmonyosnext" { + platform = "harmonyosnext" + } + for _, model := range []string{"defaultproductpriceinfo", "productlanguageinfo", "productpriceinfo", "promotioninfo"} { + supplemental = append(supplemental, model+"-"+platform) + } + } + if family == "domains" { + switch id { + case "domain-api-post-domain": + supplemental = append(supplemental, "domain-info-server", "domain-info-business") + case "domain-api-precheck": + supplemental = append(supplemental, "domain-info-business") + } + } + if family == "provisioning" { + switch id { + case "provision-api-add-device": + supplemental = append(supplemental, "add-device-info") + case "provision-api-applyacl": + supplemental = append(supplemental, "acl-apply-permission-info") + } + } + if family == "testing" { + switch id { + case "test-api-add-test-package": + supplemental = append(supplemental, "testing-package-file-info") + case "test-api-modify-test-version": + supplemental = append(supplemental, "testing-app-language", "testing-device-material", "testing-device-type-info", "testing-open-test-info", "testing-test-task-info", "testing-group-info", "testing-package-permission-intro-video", "testing-version-ext-info", "testing-app-review-contact", "testing-version-voc-req") + case "test-api-query-feedback": + supplemental = append(supplemental, "testing-feedback-list-request") + case "test-api-delete-feedback": + supplemental = append(supplemental, "testing-delete-feedback-request", "testing-delete-feedback-info") + } + } + if family == "resources" { + supplemental = append(supplemental, "developer-project-id-guide") + } + if family == "publishing" { + supplemental = append(supplemental, "publishing-error-codes") + } + if len(supplemental) > 0 { + var doc map[string]json.RawMessage + if json.Unmarshal(data, &doc) == nil { + var related []json.RawMessage + for _, name := range supplemental { + if model, err := referenceDocuments.ReadFile("reference/supplemental/" + name + ".json"); err == nil { + related = append(related, model) + } + } + doc["relatedDocuments"], _ = json.Marshal(related) + data, _ = json.Marshal(doc) + } + } + if family == "publishing" { + data = attachPublishingLinkedModels(data) + } + if IsServerlessFamily(family) { + var doc map[string]json.RawMessage + if json.Unmarshal(data, &doc) == nil { + var related []json.RawMessage + _ = json.Unmarshal(doc["relatedDocuments"], &related) + entries, _ := referenceDocuments.ReadDir("reference/supplemental") + for _, entry := range entries { + if strings.HasPrefix(entry.Name(), "serverless-") { + if raw, err := referenceDocuments.ReadFile("reference/supplemental/" + entry.Name()); err == nil { + related = append(related, raw) + } + } + } + doc["relatedDocuments"], _ = json.Marshal(related) + data, _ = json.Marshal(doc) + } + } + return json.RawMessage(data), true +} + +// Follow captured links through reviewed model documents. This includes +// response models and transitive prerequisites without guessing from model +// names (user and privacy AgreementInfo have different source URLs). +func attachPublishingLinkedModels(data []byte) []byte { + var doc map[string]json.RawMessage + if json.Unmarshal(data, &doc) != nil { + return data + } + var related []json.RawMessage + _ = json.Unmarshal(doc["relatedDocuments"], &related) + models := map[string]json.RawMessage{} + entries, _ := referenceDocuments.ReadDir("reference/supplemental") + for _, entry := range entries { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + raw, err := referenceDocuments.ReadFile("reference/supplemental/" + entry.Name()) + if err != nil { + continue + } + var model struct { + SourceURL string `json:"sourceUrl"` + Status string `json:"status"` + } + if json.Unmarshal(raw, &model) == nil && model.Status == "browser-read" && + (strings.Contains(model.SourceURL, "publish-api-data-") || strings.Contains(model.SourceURL, "publish-api-agreementbaseinfo") || strings.Contains(model.SourceURL, "publish-api-devicemulti") || strings.Contains(model.SourceURL, "publish-api-packagepermission")) { + models[model.SourceURL] = raw + } + } + seen := map[string]bool{} + queue := []json.RawMessage{data} + for _, raw := range related { + var model struct { + SourceURL string `json:"sourceUrl"` + } + _ = json.Unmarshal(raw, &model) + seen[model.SourceURL] = true + queue = append(queue, raw) + } + for len(queue) > 0 { + raw := queue[0] + queue = queue[1:] + var model struct { + Links []struct { + SourceURL string `json:"sourceUrl"` + Title string `json:"title"` + } + Tables []struct{ Rows [][]string } + } + if json.Unmarshal(raw, &model) != nil { + continue + } + // Captures also contain previous/next navigation. Only links naming a + // type in a parameter table are semantic model dependencies. + types := map[string]bool{} + for _, table := range model.Tables { + for _, row := range table.Rows { + if len(row) < 3 { + continue + } + name := strings.TrimPrefix(row[2], "List<") + name = strings.TrimSuffix(name, ">") + types[name] = true + } + } + for _, link := range model.Links { + if !types[link.Title] { + continue + } + url := strings.SplitN(link.SourceURL, "#", 2)[0] + if next, ok := models[url]; ok && !seen[url] { + seen[url] = true + related = append(related, next) + queue = append(queue, next) + } + } + } + if len(related) == 0 { + return data + } + doc["relatedDocuments"], _ = json.Marshal(related) + result, err := json.Marshal(doc) + if err != nil { + return data + } + return result +} + +type referenceMetadata struct { + summary ReferenceSummary + description string + rules []ReferenceRule +} + +var referenceMetadataCache sync.Map + +func attachReference(e Endpoint) Endpoint { + // Full examples and public vendor source are read only by --docs. Repeated + // command discovery needs immutable metadata, not another full-document parse. + if e.FamilyID == "functions" && e.Documentation != nil { + summary := *e.Documentation + e.Documentation = &summary + return e + } + key := e.FamilyID + "/" + e.ID + cached, ok := referenceMetadataCache.Load(key) + if !ok { + data, err := referenceDocuments.ReadFile("reference/" + key + ".json") + if err != nil { + return e + } + var meta referenceMetadata + if json.Unmarshal(data, &meta.summary) != nil { + return e + } + if e.FamilyID == "publishing" { + var content struct { + Notes []struct{ Section, Text string } + } + if json.Unmarshal(data, &content) == nil { + for _, note := range content.Notes { + if note.Section == "功能介绍" && note.Text != "" { + meta.description = note.Text + break + } + } + } + } + meta.rules = referenceRules(e.FamilyID, e.ID) + cached, _ = referenceMetadataCache.LoadOrStore(key, meta) + } + meta := cached.(referenceMetadata) + summary := meta.summary + summary.ReadCommand = e.Command + " --docs --pretty" + e.Documentation = &summary + if meta.description != "" { + e.Description = meta.description + } + e.Rules = make([]ReferenceRule, len(meta.rules)) + for i, rule := range meta.rules { + e.Rules[i] = rule + e.Rules[i].Fields = append([]string(nil), rule.Fields...) + if rule.When != nil { + condition := *rule.When + e.Rules[i].When = &condition + } + } + return e +} + +func referenceRules(family, id string) []ReferenceRule { + data, err := referenceDocuments.ReadFile("reference/" + family + "/" + id + ".rules.json") + if err != nil { + return nil + } + var rules []ReferenceRule + if json.Unmarshal(data, &rules) != nil { + return nil + } + return rules +} + +// Enrich only fields whose actual official table has been browser-read. Integer +// widths such as Integer(32) are not interpreted as value ranges. +func applyReferenceParameters(e Endpoint) Endpoint { + // Parameter parsing uses the endpoint's own tables; related model contracts + // are applied explicitly below, not inferred from response documentation. + data, err := referenceDocuments.ReadFile("reference/" + e.FamilyID + "/" + e.ID + ".json") + if err != nil { + return e + } + var doc struct { + Tables []struct { + Section string + Location string + SourceURL string `json:"sourceUrl"` + Rows [][]string + } + } + if json.Unmarshal(data, &doc) != nil { + return e + } + if parameterData, err := referenceDocuments.ReadFile("reference/" + e.FamilyID + "/" + e.ID + ".parameters.json"); err == nil { + var reviewed []Parameter + if json.Unmarshal(parameterData, &reviewed) == nil { + // Retain independently verified bounds while replacing legacy inferred + // locations, types and requiredness with the actual parameter table. + for i := range reviewed { + for _, previous := range e.Parameters { + if previous.Name == reviewed[i].Name && previous.In == reviewed[i].In { + if reviewed[i].MinItems == 0 { + reviewed[i].MinItems = previous.MinItems + } + if reviewed[i].MaxItems == 0 { + reviewed[i].MaxItems = previous.MaxItems + } + } + } + } + for _, previous := range e.Parameters { + if previous.In == "path" || previous.In == "file" { + found := false + for _, p := range reviewed { + if p.Name == previous.Name && p.In == previous.In { + found = true + break + } + } + if !found { + reviewed = append([]Parameter{previous}, reviewed...) + } + } + } + e.Parameters = reviewed + } + } + for i := range e.Parameters { + p := &e.Parameters[i] + // Reviewed model contracts already identify the correct nesting and paragraph. + if p.SourceURL != "" { + continue + } + matchedParameter: + for _, table := range doc.Tables { + if table.Section != "请求参数" || table.Location != p.In { + continue + } + for _, row := range table.Rows { + if len(row) < 4 || row[0] != p.Name { + continue + } + if match := regexp.MustCompile(`^List$`).FindStringSubmatch(row[2]); len(match) > 1 { + p.ItemsMaxLength, _ = strconv.Atoi(match[1]) + } + p.Description = row[3] + p.SourceURL = table.SourceURL + break matchedParameter + } + } + } + extra, err := referenceDocuments.ReadFile("reference/" + e.FamilyID + "/" + e.ID + ".constraints.json") + if err == nil { + var constraints map[string]Parameter + if json.Unmarshal(extra, &constraints) == nil { + for i := range e.Parameters { + p := &e.Parameters[i] + c, ok := constraints[p.In+"."+p.Name] + if !ok { + continue + } + p.MinLength, p.MaxLength = c.MinLength, c.MaxLength + p.MinItems, p.MaxItems = c.MinItems, c.MaxItems + p.Minimum, p.Maximum, p.Enum = c.Minimum, c.Maximum, c.Enum + } + } + } + // The table marks appId mandatory but the packageName remark explicitly + // permits either identity; the rule below enforces the documented alternative. + if e.FamilyID == "publishing" && e.ID == "app-version-list" { + for i := range e.Parameters { + if e.Parameters[i].Name == "appId" { + e.Parameters[i].Required = false + } + } + } + if e.FamilyID == "publishing" && e.ID == "app-file-info-v3" { + langSource := "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653" + fileSource := "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466" + fileFields := []Parameter{ + {Name: "deviceType", In: "body", Type: "integer", Required: true, Enum: []string{"4", "5", "8", "12", "14", "19"}, SourceURL: fileSource}, + {Name: "objectIdList", In: "body", Type: "array", Required: true, ItemsType: "string", ItemsMaxLength: 512, MaxItems: 10, SourceURL: fileSource}, + {Name: "showType", In: "body", Type: "integer", Enum: []string{"0", "1"}, SourceURL: fileSource}, + } + for i := range e.Parameters { + p := &e.Parameters[i] + switch p.Name { + case "packagePermissionIntroVideoList": + source := "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278" + p.ItemsProperties = []Parameter{ + {Name: "lang", In: "body", Type: "string", Required: true, MaxLength: 8, SourceURL: source}, + {Name: "permissionName", In: "body", Type: "string", Required: true, MaxLength: 512, SourceURL: source}, + {Name: "deviceType", In: "body", Type: "integer", Required: true, Enum: []string{"4", "5", "8", "12", "14", "19"}, SourceURL: source}, + {Name: "objectId", In: "body", Type: "string", Required: true, MaxLength: 512, SourceURL: source}, + } + case "appIconList", "screenShotList", "introVideoList", "rcmdVideoList", "rcmdPicList", "updateScreenShotList", "updateVideoList": + p.ItemsProperties = []Parameter{ + {Name: "lang", In: "body", Type: "string", Required: true, MaxLength: 8, SourceURL: langSource}, + {Name: "fileInfoList", In: "body", Type: "array", Required: true, ItemsType: "object", MaxItems: 20, ItemsProperties: fileFields, SourceURL: langSource}, + } + } + } + } + if e.FamilyID == "pms" { + var platform string + switch e.ID { + case "batchaddproduct-android", "batchupdateproduct-android": + platform = "android" + case "batchaddproduct-harmonyosnext", "batchupdateproduct-harmonyosnext": + platform = "harmonyosnext" + } + if platform != "" { + data, err := referenceDocuments.ReadFile("reference/supplemental/product-import-" + platform + ".contract.json") + var model struct { + Parameters []Parameter + Rules []ReferenceRule + } + if err == nil && json.Unmarshal(data, &model) == nil { + for i := range e.Parameters { + if e.Parameters[i].Name == "products" { + e.Parameters[i].ItemsProperties = model.Parameters + e.Parameters[i].ItemsRules = model.Rules + } + } + } + } + } + if e.FamilyID == "upload" && (e.ID == "obbfile-uploadurl" || e.ID == "obbfile-compose") { + var bodyTables []struct { + SourceURL string + Rows [][]string + } + for _, table := range doc.Tables { + if table.Section == "请求参数" && table.Location == "body" { + bodyTables = append(bodyTables, struct { + SourceURL string + Rows [][]string + }{table.SourceURL, table.Rows}) + } + } + if len(bodyTables) == 2 { + model := Parameter{Type: "object", Required: true, SourceURL: bodyTables[0].SourceURL} + for _, row := range bodyTables[1].Rows[1:] { + p := Parameter{Name: row[0], In: "body", Required: row[1] == "M", Description: row[3], SourceURL: bodyTables[1].SourceURL, Type: "string"} + if row[2] == "Integer(64)" { + p.Type = "integer" + p.Format = "int64" + } else if row[2] == "String(64)" { + p.MaxLength = 64 + } + model.Properties = append(model.Properties, p) + } + e.DynamicBody = &model + e.DynamicBodyKeyPattern = "^additionalProp[1-9][0-9]*$" + } + } + e.RequiredParams = nil + for _, p := range e.Parameters { + if p.Required { + e.RequiredParams = append(e.RequiredParams, p.Name) + } + } + return e +} diff --git a/pkg/domain/reference/cache/connection-info.json b/pkg/domain/reference/cache/connection-info.json new file mode 100644 index 0000000..87eb59f --- /dev/null +++ b/pkg/domain/reference/cache/connection-info.json @@ -0,0 +1,622 @@ +{ + "title": "connection-info", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudcache/util/constants.js", + "sha256": "9ca1175c760e2ec50cf864464c54b5a2841d372254d372a654fe4a7db2705906", + "source": "const SERVICES=Object.freeze({EXEC_COMMAND:{path:\"/agc/edge/scs/scs-service/v1/eval\",method:\"POST\"},INFO_USAGE_STATISTICS:{path:\"/agc/edge/spms/v1/query/metric/scs-metric\",method:\"POST\"},SET_PASSWORD:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"POST\"},PASSWORD_CHANGE:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"PUT\"},ENABLE_CACHE:{path:\"/agc/edge/cpms/project-service/v1/services/order\",method:\"POST\"},CACHE_INVOKE:{path:\"/agc/edge/scs/scs-service/v1/cache-invoke-address\",method:\"GET\"}}),ENUMS=Object.freeze({MONITOR_TYPES:{METRIC_STATISTICS:\"query_cache_metric_trend\",SLOW_KEY:\"query_cache_slow_key_trend\",HOT_KEY:\"query_cache_hot_key_trend\",BIG_KEY:\"query_cache_big_key_trend\"},EPOCH_TIMESTAMP:{MIN:1296e4,MAX:21588768e5}});export{SERVICES,ENUMS};" + }, + { + "packagePath": "commands/cloudcache/util/Validation.js", + "sha256": "8ae84156e6579e00258add710553f259af4bc12c5abfd0695d89fe9608827cef", + "source": "import{ENUMS}from\"./constants.js\";export function isValidTimestamp(e){const t=parseInt(e);return t>=ENUMS.EPOCH_TIMESTAMP.MIN&&t<=ENUMS.EPOCH_TIMESTAMP.MAX}export function validatePassword(e){const t=/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[-~!@#%^*_=+?$&()|<>{}[\\]])[A-Za-z0-9-~!@#%^*_=+?$&()|<>{}[\\]]{8,32}$/;if(!t.test(e))throw new Error(\"Enter a password comprising 8 to 32 characters. It must start with a letter and contain at least one digit, one uppercase letter, one lowercase letter, and one special character (-~!@#%^*_=+?$&()| <>{}[]).)\");return t.test(e)}export async function checkCacheServiceEnabled(e){const t=e.storage.globalGet(\"serviceInfos\")||null;return!t||-1!==t.indexOf(\"cloudCache\")}export async function checkCacheServiceEnabledThrowError(e){if(!1===await checkCacheServiceEnabled(e))throw\"Please enable the Cloud Cache Service first by running the 'agcli cache enable --password ' command.\"}" + }, + { + "packagePath": "commands/cloudcache/cmd/infoUsageStatistics.js", + "sha256": "3f4e6735d3760ec937cc125545b4be0068e73760988b6866f739f8c8d2215ae3", + "source": "import{toLocaleDateString}from\"../../cloudstorage/util/helpers.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{CacheService}from\"../boundary/CacheService.js\";import{checkCacheServiceEnabledThrowError,isValidTimestamp}from\"../util/Validation.js\";async function infoUsageStatistics(e,t){try{validate(t);const i=await CacheService.getInfoOfUsageStatistics(e,t);if(void 0===i.metrics)throw new Error(i?.ret?.msg??\"The start time or end time is illegal\");if(Array.isArray(i.metrics)){const e=i.metrics.filter((e=>0!==e.count)).map((e=>({...e,date:toLocaleDateString(parseInt(e.timestamp)).replace(\"T\",\" \")})));e.length>0?TABLE(e):WARN(\"No record found!\")}else SUCCESS(i.metrics)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(void 0===e.startTime){const t=new Date;t.setHours(t.getHours()-24),e.startTime=Math.floor(t.getTime())}else if(!isValidTimestamp(e.startTime))throw new Error(\"Invalid start time\");if(void 0===e.endTime)e.endTime=parseInt(e.startTime)+864e5;else if(!isValidTimestamp(e.endTime))throw new Error(\"Invalid end time\");if(void 0!==e.startTime&&void 0!==e.endTime&&e.endTime-e.startTime>2592e5)throw new Error(\"The start and end date range can be up to 3 days.\")}export default function main(e){return{cmd:\"info\",desc:\"Show usage statistics of the Cloud Cache\",options:[{opt:\"--start-time \",desc:\"Start time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1},{opt:\"--end-time \",desc:\"End time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1}],addHelpText:[[\"after\",\"\\nExample:\\n agcli cache info --start-time timestamp --end-time timestamp\"]],child:[],action(t){infoUsageStatistics(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkCacheServiceEnabledThrowError(e)}}}" + }, + { + "packagePath": "commands/cloudcache/api/cacheInvokeAdress.js", + "sha256": "d2b5bc17e87ee90ffd9f50cca60eef9ee795c821c3813b3c471d2cbf8f734dfd", + "source": "import{SERVICES}from\"../util/constants.js\";async function cacheInvoke(e){return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.CACHE_INVOKE,{})}export default cacheInvoke;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "projectId header comes from session." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p16276124912475", + "title": "方式一" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p131976468508", + "title": "方式二" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p159471258125610", + "title": "方式三" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "title": "配置管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-overview-0000001367568657", + "title": "总览查看" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "title": "获取云缓存信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "title": "Java" + } + ], + "notes": [ + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "用户名:用于客户端访问云缓存时的用户名。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "使用云缓存", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "text": "您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。" + }, + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "提供了三种方式,可根据业务情况选择合适的方式:" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式一:使用原生的jedis客户端连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式二:使用Spring封装的RedisTemplate能力。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式一】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式二】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式三】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "renderedText": "指南\n云缓存\n使用云缓存\n使用云缓存\n更新时间: 2026-10-23 16:58\n获取云缓存信息\n\n在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。\n\n获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。\n\n获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。\n\n使用云缓存\n\n您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。\n\nNode.js\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\n\n const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;\nJava\n\n提供了三种方式,可根据业务情况选择合适的方式:\n\n方式一:使用原生的jedis客户端连接云缓存。\n方式二:使用Spring封装的RedisTemplate能力。\n方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。\n\n【方式一】\n\n在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}\n\n【方式二】\n\n在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n\n【方式三】\n\n在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0\n在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n配置管理\n总览查看\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n获取云缓存信息\n使用云缓存\nNode.js\nJava\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "status": "browser-read", + "tables": [], + "title": "使用云缓存" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "title": "Web CLI命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "title": "访问命令行工具" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "title": "查看用户名、内网地址" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "text": "云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码不能为空。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码必须以字母开头。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码长度在8到32位之间。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "小写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "大写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "数字(0-9)" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + } + ], + "renderedText": "配置管理\n更新时间: 2026-10-23 16:58\n\n云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。\n\n访问命令行工具\n\n云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。\n\n重置访问密码\n\n云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])\n\n查看用户名、内网地址\n\n云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n访问命令行工具\n重置访问密码\n查看用户名、内网地址\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "status": "browser-read", + "tables": [], + "title": "配置管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-usage-0000001316079964", + "title": "用量统计" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "本章节主要介绍Web CLI工具支持的命令列表。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当value值为空时,执行get命令返回nil。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "各个命令的详细语法请前往Redis官方网站查看。" + } + ], + "renderedText": "指南\n云缓存\nWeb CLI命令\nWeb CLI命令\n更新时间: 2026-10-23 16:58\n\n本章节主要介绍Web CLI工具支持的命令列表。\n\n说明\n当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。\n当value值为空时,执行get命令返回nil。\n各个命令的详细语法请前往Redis官方网站查看。\n\nKeys\n\n\t\n\nString\n\n\t\n\nList\n\n\t\n\nSet\n\n\t\n\nHash\n\n\n\n\nDEL\n\n\t\n\nAPPEND\n\n\t\n\nLINDEX\n\n\t\n\nSADD\n\n\t\n\nHDEL\n\n\n\n\nEXISTS\n\n\t\n\nDECR\n\n\t\n\nLLEN\n\n\t\n\nSCARD\n\n\t\n\nHEXISTS\n\n\n\n\nEXPIRE\n\n\t\n\nDECRBY\n\n\t\n\nLPOP\n\n\t\n\nSISMEMBER\n\n\t\n\nHGET\n\n\n\n\nPEXPIRE\n\n\t\n\nGET\n\n\t\n\nLPUSH\n\n\t\n\nSMEMBERS\n\n\t\n\nHGETALL\n\n\n\n\nTTL\n\n\t\n\nGETSET\n\n\t\n\nLRANGE\n\n\t\n\nSPOP\n\n\t\n\nHINCRBY\n\n\n\n\nTYPE\n\n\t\n\nINCR\n\n\t\n\nLREM\n\n\t\n\nSRANDMEMBER\n\n\t\n\nHLEN\n\n\n\n\n-\n\n\t\n\nINCRBY\n\n\t\n\nLSET\n\n\t\n\nSREM\n\n\t\n\nHKEYS\n\n\n\n\n-\n\n\t\n\nMGET\n\n\t\n\nLTRIM\n\n\t\n\n-\n\n\t\n\nHMGET\n\n\n\n\n-\n\n\t\n\nMSET\n\n\t\n\nRPOP\n\n\t\n\n-\n\n\t\n\nHMSET\n\n\n\n\n-\n\n\t\n\nMSETNX\n\n\t\n\nRPUSH\n\n\t\n\n-\n\n\t\n\nHSET\n\n\n\n\n-\n\n\t\n\nSET\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\nHVALS\n\n\n\n\n-\n\n\t\n\nSETEX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\n-\n\n\t\n\nSETNX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n用量统计\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Keys", + "String", + "List", + "Set", + "Hash" + ], + [ + "DEL", + "APPEND", + "LINDEX", + "SADD", + "HDEL" + ], + [ + "EXISTS", + "DECR", + "LLEN", + "SCARD", + "HEXISTS" + ], + [ + "EXPIRE", + "DECRBY", + "LPOP", + "SISMEMBER", + "HGET" + ], + [ + "PEXPIRE", + "GET", + "LPUSH", + "SMEMBERS", + "HGETALL" + ], + [ + "TTL", + "GETSET", + "LRANGE", + "SPOP", + "HINCRBY" + ], + [ + "TYPE", + "INCR", + "LREM", + "SRANDMEMBER", + "HLEN" + ], + [ + "-", + "INCRBY", + "LSET", + "SREM", + "HKEYS" + ], + [ + "-", + "MGET", + "LTRIM", + "-", + "HMGET" + ], + [ + "-", + "MSET", + "RPOP", + "-", + "HMSET" + ], + [ + "-", + "MSETNX", + "RPUSH", + "-", + "HSET" + ], + [ + "-", + "SET", + "-", + "-", + "HVALS" + ], + [ + "-", + "SETEX", + "-", + "-", + "-" + ], + [ + "-", + "SETNX", + "-", + "-", + "-" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729" + } + ], + "title": "Web CLI命令" + } + ] +} diff --git a/pkg/domain/reference/cache/enable-service.json b/pkg/domain/reference/cache/enable-service.json new file mode 100644 index 0000000..0e8bbf3 --- /dev/null +++ b/pkg/domain/reference/cache/enable-service.json @@ -0,0 +1,622 @@ +{ + "title": "enable-service", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudcache/util/constants.js", + "sha256": "9ca1175c760e2ec50cf864464c54b5a2841d372254d372a654fe4a7db2705906", + "source": "const SERVICES=Object.freeze({EXEC_COMMAND:{path:\"/agc/edge/scs/scs-service/v1/eval\",method:\"POST\"},INFO_USAGE_STATISTICS:{path:\"/agc/edge/spms/v1/query/metric/scs-metric\",method:\"POST\"},SET_PASSWORD:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"POST\"},PASSWORD_CHANGE:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"PUT\"},ENABLE_CACHE:{path:\"/agc/edge/cpms/project-service/v1/services/order\",method:\"POST\"},CACHE_INVOKE:{path:\"/agc/edge/scs/scs-service/v1/cache-invoke-address\",method:\"GET\"}}),ENUMS=Object.freeze({MONITOR_TYPES:{METRIC_STATISTICS:\"query_cache_metric_trend\",SLOW_KEY:\"query_cache_slow_key_trend\",HOT_KEY:\"query_cache_hot_key_trend\",BIG_KEY:\"query_cache_big_key_trend\"},EPOCH_TIMESTAMP:{MIN:1296e4,MAX:21588768e5}});export{SERVICES,ENUMS};" + }, + { + "packagePath": "commands/cloudcache/util/Validation.js", + "sha256": "8ae84156e6579e00258add710553f259af4bc12c5abfd0695d89fe9608827cef", + "source": "import{ENUMS}from\"./constants.js\";export function isValidTimestamp(e){const t=parseInt(e);return t>=ENUMS.EPOCH_TIMESTAMP.MIN&&t<=ENUMS.EPOCH_TIMESTAMP.MAX}export function validatePassword(e){const t=/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[-~!@#%^*_=+?$&()|<>{}[\\]])[A-Za-z0-9-~!@#%^*_=+?$&()|<>{}[\\]]{8,32}$/;if(!t.test(e))throw new Error(\"Enter a password comprising 8 to 32 characters. It must start with a letter and contain at least one digit, one uppercase letter, one lowercase letter, and one special character (-~!@#%^*_=+?$&()| <>{}[]).)\");return t.test(e)}export async function checkCacheServiceEnabled(e){const t=e.storage.globalGet(\"serviceInfos\")||null;return!t||-1!==t.indexOf(\"cloudCache\")}export async function checkCacheServiceEnabledThrowError(e){if(!1===await checkCacheServiceEnabled(e))throw\"Please enable the Cloud Cache Service first by running the 'agcli cache enable --password ' command.\"}" + }, + { + "packagePath": "commands/cloudcache/cmd/infoUsageStatistics.js", + "sha256": "3f4e6735d3760ec937cc125545b4be0068e73760988b6866f739f8c8d2215ae3", + "source": "import{toLocaleDateString}from\"../../cloudstorage/util/helpers.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{CacheService}from\"../boundary/CacheService.js\";import{checkCacheServiceEnabledThrowError,isValidTimestamp}from\"../util/Validation.js\";async function infoUsageStatistics(e,t){try{validate(t);const i=await CacheService.getInfoOfUsageStatistics(e,t);if(void 0===i.metrics)throw new Error(i?.ret?.msg??\"The start time or end time is illegal\");if(Array.isArray(i.metrics)){const e=i.metrics.filter((e=>0!==e.count)).map((e=>({...e,date:toLocaleDateString(parseInt(e.timestamp)).replace(\"T\",\" \")})));e.length>0?TABLE(e):WARN(\"No record found!\")}else SUCCESS(i.metrics)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(void 0===e.startTime){const t=new Date;t.setHours(t.getHours()-24),e.startTime=Math.floor(t.getTime())}else if(!isValidTimestamp(e.startTime))throw new Error(\"Invalid start time\");if(void 0===e.endTime)e.endTime=parseInt(e.startTime)+864e5;else if(!isValidTimestamp(e.endTime))throw new Error(\"Invalid end time\");if(void 0!==e.startTime&&void 0!==e.endTime&&e.endTime-e.startTime>2592e5)throw new Error(\"The start and end date range can be up to 3 days.\")}export default function main(e){return{cmd:\"info\",desc:\"Show usage statistics of the Cloud Cache\",options:[{opt:\"--start-time \",desc:\"Start time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1},{opt:\"--end-time \",desc:\"End time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1}],addHelpText:[[\"after\",\"\\nExample:\\n agcli cache info --start-time timestamp --end-time timestamp\"]],child:[],action(t){infoUsageStatistics(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkCacheServiceEnabledThrowError(e)}}}" + }, + { + "packagePath": "commands/cloudcache/api/enableCache.js", + "sha256": "60dd448ec0f57b18d1859ef53071a8264e295c60c66fcf46f9bfef76a4a5a327", + "source": "import{SERVICES}from\"../util/constants.js\";async function enableCloudCache(e){const t={query:{projectId:e.storage.getProjectId()},body:{serviceName:\"cloudCache\"}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.ENABLE_CACHE,t)}export default enableCloudCache;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "Does not configure a password or prove the service is ready." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p16276124912475", + "title": "方式一" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p131976468508", + "title": "方式二" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p159471258125610", + "title": "方式三" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "title": "配置管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-overview-0000001367568657", + "title": "总览查看" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "title": "获取云缓存信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "title": "Java" + } + ], + "notes": [ + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "用户名:用于客户端访问云缓存时的用户名。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "使用云缓存", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "text": "您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。" + }, + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "提供了三种方式,可根据业务情况选择合适的方式:" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式一:使用原生的jedis客户端连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式二:使用Spring封装的RedisTemplate能力。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式一】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式二】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式三】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "renderedText": "指南\n云缓存\n使用云缓存\n使用云缓存\n更新时间: 2026-10-23 16:58\n获取云缓存信息\n\n在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。\n\n获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。\n\n获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。\n\n使用云缓存\n\n您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。\n\nNode.js\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\n\n const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;\nJava\n\n提供了三种方式,可根据业务情况选择合适的方式:\n\n方式一:使用原生的jedis客户端连接云缓存。\n方式二:使用Spring封装的RedisTemplate能力。\n方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。\n\n【方式一】\n\n在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}\n\n【方式二】\n\n在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n\n【方式三】\n\n在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0\n在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n配置管理\n总览查看\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n获取云缓存信息\n使用云缓存\nNode.js\nJava\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "status": "browser-read", + "tables": [], + "title": "使用云缓存" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "title": "Web CLI命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "title": "访问命令行工具" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "title": "查看用户名、内网地址" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "text": "云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码不能为空。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码必须以字母开头。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码长度在8到32位之间。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "小写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "大写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "数字(0-9)" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + } + ], + "renderedText": "配置管理\n更新时间: 2026-10-23 16:58\n\n云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。\n\n访问命令行工具\n\n云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。\n\n重置访问密码\n\n云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])\n\n查看用户名、内网地址\n\n云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n访问命令行工具\n重置访问密码\n查看用户名、内网地址\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "status": "browser-read", + "tables": [], + "title": "配置管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-usage-0000001316079964", + "title": "用量统计" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "本章节主要介绍Web CLI工具支持的命令列表。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当value值为空时,执行get命令返回nil。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "各个命令的详细语法请前往Redis官方网站查看。" + } + ], + "renderedText": "指南\n云缓存\nWeb CLI命令\nWeb CLI命令\n更新时间: 2026-10-23 16:58\n\n本章节主要介绍Web CLI工具支持的命令列表。\n\n说明\n当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。\n当value值为空时,执行get命令返回nil。\n各个命令的详细语法请前往Redis官方网站查看。\n\nKeys\n\n\t\n\nString\n\n\t\n\nList\n\n\t\n\nSet\n\n\t\n\nHash\n\n\n\n\nDEL\n\n\t\n\nAPPEND\n\n\t\n\nLINDEX\n\n\t\n\nSADD\n\n\t\n\nHDEL\n\n\n\n\nEXISTS\n\n\t\n\nDECR\n\n\t\n\nLLEN\n\n\t\n\nSCARD\n\n\t\n\nHEXISTS\n\n\n\n\nEXPIRE\n\n\t\n\nDECRBY\n\n\t\n\nLPOP\n\n\t\n\nSISMEMBER\n\n\t\n\nHGET\n\n\n\n\nPEXPIRE\n\n\t\n\nGET\n\n\t\n\nLPUSH\n\n\t\n\nSMEMBERS\n\n\t\n\nHGETALL\n\n\n\n\nTTL\n\n\t\n\nGETSET\n\n\t\n\nLRANGE\n\n\t\n\nSPOP\n\n\t\n\nHINCRBY\n\n\n\n\nTYPE\n\n\t\n\nINCR\n\n\t\n\nLREM\n\n\t\n\nSRANDMEMBER\n\n\t\n\nHLEN\n\n\n\n\n-\n\n\t\n\nINCRBY\n\n\t\n\nLSET\n\n\t\n\nSREM\n\n\t\n\nHKEYS\n\n\n\n\n-\n\n\t\n\nMGET\n\n\t\n\nLTRIM\n\n\t\n\n-\n\n\t\n\nHMGET\n\n\n\n\n-\n\n\t\n\nMSET\n\n\t\n\nRPOP\n\n\t\n\n-\n\n\t\n\nHMSET\n\n\n\n\n-\n\n\t\n\nMSETNX\n\n\t\n\nRPUSH\n\n\t\n\n-\n\n\t\n\nHSET\n\n\n\n\n-\n\n\t\n\nSET\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\nHVALS\n\n\n\n\n-\n\n\t\n\nSETEX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\n-\n\n\t\n\nSETNX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n用量统计\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Keys", + "String", + "List", + "Set", + "Hash" + ], + [ + "DEL", + "APPEND", + "LINDEX", + "SADD", + "HDEL" + ], + [ + "EXISTS", + "DECR", + "LLEN", + "SCARD", + "HEXISTS" + ], + [ + "EXPIRE", + "DECRBY", + "LPOP", + "SISMEMBER", + "HGET" + ], + [ + "PEXPIRE", + "GET", + "LPUSH", + "SMEMBERS", + "HGETALL" + ], + [ + "TTL", + "GETSET", + "LRANGE", + "SPOP", + "HINCRBY" + ], + [ + "TYPE", + "INCR", + "LREM", + "SRANDMEMBER", + "HLEN" + ], + [ + "-", + "INCRBY", + "LSET", + "SREM", + "HKEYS" + ], + [ + "-", + "MGET", + "LTRIM", + "-", + "HMGET" + ], + [ + "-", + "MSET", + "RPOP", + "-", + "HMSET" + ], + [ + "-", + "MSETNX", + "RPUSH", + "-", + "HSET" + ], + [ + "-", + "SET", + "-", + "-", + "HVALS" + ], + [ + "-", + "SETEX", + "-", + "-", + "-" + ], + [ + "-", + "SETNX", + "-", + "-", + "-" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729" + } + ], + "title": "Web CLI命令" + } + ] +} diff --git a/pkg/domain/reference/cache/execute-command.json b/pkg/domain/reference/cache/execute-command.json new file mode 100644 index 0000000..f72c90e --- /dev/null +++ b/pkg/domain/reference/cache/execute-command.json @@ -0,0 +1,620 @@ +{ + "title": "execute-command", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudcache/util/constants.js", + "sha256": "9ca1175c760e2ec50cf864464c54b5a2841d372254d372a654fe4a7db2705906", + "source": "const SERVICES=Object.freeze({EXEC_COMMAND:{path:\"/agc/edge/scs/scs-service/v1/eval\",method:\"POST\"},INFO_USAGE_STATISTICS:{path:\"/agc/edge/spms/v1/query/metric/scs-metric\",method:\"POST\"},SET_PASSWORD:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"POST\"},PASSWORD_CHANGE:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"PUT\"},ENABLE_CACHE:{path:\"/agc/edge/cpms/project-service/v1/services/order\",method:\"POST\"},CACHE_INVOKE:{path:\"/agc/edge/scs/scs-service/v1/cache-invoke-address\",method:\"GET\"}}),ENUMS=Object.freeze({MONITOR_TYPES:{METRIC_STATISTICS:\"query_cache_metric_trend\",SLOW_KEY:\"query_cache_slow_key_trend\",HOT_KEY:\"query_cache_hot_key_trend\",BIG_KEY:\"query_cache_big_key_trend\"},EPOCH_TIMESTAMP:{MIN:1296e4,MAX:21588768e5}});export{SERVICES,ENUMS};" + }, + { + "packagePath": "commands/cloudcache/util/Validation.js", + "sha256": "8ae84156e6579e00258add710553f259af4bc12c5abfd0695d89fe9608827cef", + "source": "import{ENUMS}from\"./constants.js\";export function isValidTimestamp(e){const t=parseInt(e);return t>=ENUMS.EPOCH_TIMESTAMP.MIN&&t<=ENUMS.EPOCH_TIMESTAMP.MAX}export function validatePassword(e){const t=/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[-~!@#%^*_=+?$&()|<>{}[\\]])[A-Za-z0-9-~!@#%^*_=+?$&()|<>{}[\\]]{8,32}$/;if(!t.test(e))throw new Error(\"Enter a password comprising 8 to 32 characters. It must start with a letter and contain at least one digit, one uppercase letter, one lowercase letter, and one special character (-~!@#%^*_=+?$&()| <>{}[]).)\");return t.test(e)}export async function checkCacheServiceEnabled(e){const t=e.storage.globalGet(\"serviceInfos\")||null;return!t||-1!==t.indexOf(\"cloudCache\")}export async function checkCacheServiceEnabledThrowError(e){if(!1===await checkCacheServiceEnabled(e))throw\"Please enable the Cloud Cache Service first by running the 'agcli cache enable --password ' command.\"}" + }, + { + "packagePath": "commands/cloudcache/cmd/infoUsageStatistics.js", + "sha256": "3f4e6735d3760ec937cc125545b4be0068e73760988b6866f739f8c8d2215ae3", + "source": "import{toLocaleDateString}from\"../../cloudstorage/util/helpers.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{CacheService}from\"../boundary/CacheService.js\";import{checkCacheServiceEnabledThrowError,isValidTimestamp}from\"../util/Validation.js\";async function infoUsageStatistics(e,t){try{validate(t);const i=await CacheService.getInfoOfUsageStatistics(e,t);if(void 0===i.metrics)throw new Error(i?.ret?.msg??\"The start time or end time is illegal\");if(Array.isArray(i.metrics)){const e=i.metrics.filter((e=>0!==e.count)).map((e=>({...e,date:toLocaleDateString(parseInt(e.timestamp)).replace(\"T\",\" \")})));e.length>0?TABLE(e):WARN(\"No record found!\")}else SUCCESS(i.metrics)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(void 0===e.startTime){const t=new Date;t.setHours(t.getHours()-24),e.startTime=Math.floor(t.getTime())}else if(!isValidTimestamp(e.startTime))throw new Error(\"Invalid start time\");if(void 0===e.endTime)e.endTime=parseInt(e.startTime)+864e5;else if(!isValidTimestamp(e.endTime))throw new Error(\"Invalid end time\");if(void 0!==e.startTime&&void 0!==e.endTime&&e.endTime-e.startTime>2592e5)throw new Error(\"The start and end date range can be up to 3 days.\")}export default function main(e){return{cmd:\"info\",desc:\"Show usage statistics of the Cloud Cache\",options:[{opt:\"--start-time \",desc:\"Start time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1},{opt:\"--end-time \",desc:\"End time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1}],addHelpText:[[\"after\",\"\\nExample:\\n agcli cache info --start-time timestamp --end-time timestamp\"]],child:[],action(t){infoUsageStatistics(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkCacheServiceEnabledThrowError(e)}}}" + }, + { + "packagePath": "commands/cloudcache/api/execCommand.js", + "sha256": "2cce24cec21f79f3d99c93174365ef8bcb53fe3e19e2caf5290b29428147f94e", + "source": "import{SERVICES}from\"../util/constants.js\";async function execCommand(e,t){const o={body:{command:t}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.EXEC_COMMAND,o)}export default execCommand;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p16276124912475", + "title": "方式一" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p131976468508", + "title": "方式二" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p159471258125610", + "title": "方式三" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "title": "配置管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-overview-0000001367568657", + "title": "总览查看" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "title": "获取云缓存信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "title": "Java" + } + ], + "notes": [ + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "用户名:用于客户端访问云缓存时的用户名。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "使用云缓存", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "text": "您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。" + }, + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "提供了三种方式,可根据业务情况选择合适的方式:" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式一:使用原生的jedis客户端连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式二:使用Spring封装的RedisTemplate能力。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式一】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式二】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式三】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "renderedText": "指南\n云缓存\n使用云缓存\n使用云缓存\n更新时间: 2026-10-23 16:58\n获取云缓存信息\n\n在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。\n\n获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。\n\n获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。\n\n使用云缓存\n\n您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。\n\nNode.js\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\n\n const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;\nJava\n\n提供了三种方式,可根据业务情况选择合适的方式:\n\n方式一:使用原生的jedis客户端连接云缓存。\n方式二:使用Spring封装的RedisTemplate能力。\n方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。\n\n【方式一】\n\n在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}\n\n【方式二】\n\n在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n\n【方式三】\n\n在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0\n在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n配置管理\n总览查看\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n获取云缓存信息\n使用云缓存\nNode.js\nJava\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "status": "browser-read", + "tables": [], + "title": "使用云缓存" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "title": "Web CLI命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "title": "访问命令行工具" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "title": "查看用户名、内网地址" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "text": "云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码不能为空。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码必须以字母开头。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码长度在8到32位之间。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "小写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "大写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "数字(0-9)" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + } + ], + "renderedText": "配置管理\n更新时间: 2026-10-23 16:58\n\n云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。\n\n访问命令行工具\n\n云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。\n\n重置访问密码\n\n云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])\n\n查看用户名、内网地址\n\n云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n访问命令行工具\n重置访问密码\n查看用户名、内网地址\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "status": "browser-read", + "tables": [], + "title": "配置管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-usage-0000001316079964", + "title": "用量统计" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "本章节主要介绍Web CLI工具支持的命令列表。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当value值为空时,执行get命令返回nil。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "各个命令的详细语法请前往Redis官方网站查看。" + } + ], + "renderedText": "指南\n云缓存\nWeb CLI命令\nWeb CLI命令\n更新时间: 2026-10-23 16:58\n\n本章节主要介绍Web CLI工具支持的命令列表。\n\n说明\n当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。\n当value值为空时,执行get命令返回nil。\n各个命令的详细语法请前往Redis官方网站查看。\n\nKeys\n\n\t\n\nString\n\n\t\n\nList\n\n\t\n\nSet\n\n\t\n\nHash\n\n\n\n\nDEL\n\n\t\n\nAPPEND\n\n\t\n\nLINDEX\n\n\t\n\nSADD\n\n\t\n\nHDEL\n\n\n\n\nEXISTS\n\n\t\n\nDECR\n\n\t\n\nLLEN\n\n\t\n\nSCARD\n\n\t\n\nHEXISTS\n\n\n\n\nEXPIRE\n\n\t\n\nDECRBY\n\n\t\n\nLPOP\n\n\t\n\nSISMEMBER\n\n\t\n\nHGET\n\n\n\n\nPEXPIRE\n\n\t\n\nGET\n\n\t\n\nLPUSH\n\n\t\n\nSMEMBERS\n\n\t\n\nHGETALL\n\n\n\n\nTTL\n\n\t\n\nGETSET\n\n\t\n\nLRANGE\n\n\t\n\nSPOP\n\n\t\n\nHINCRBY\n\n\n\n\nTYPE\n\n\t\n\nINCR\n\n\t\n\nLREM\n\n\t\n\nSRANDMEMBER\n\n\t\n\nHLEN\n\n\n\n\n-\n\n\t\n\nINCRBY\n\n\t\n\nLSET\n\n\t\n\nSREM\n\n\t\n\nHKEYS\n\n\n\n\n-\n\n\t\n\nMGET\n\n\t\n\nLTRIM\n\n\t\n\n-\n\n\t\n\nHMGET\n\n\n\n\n-\n\n\t\n\nMSET\n\n\t\n\nRPOP\n\n\t\n\n-\n\n\t\n\nHMSET\n\n\n\n\n-\n\n\t\n\nMSETNX\n\n\t\n\nRPUSH\n\n\t\n\n-\n\n\t\n\nHSET\n\n\n\n\n-\n\n\t\n\nSET\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\nHVALS\n\n\n\n\n-\n\n\t\n\nSETEX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\n-\n\n\t\n\nSETNX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n用量统计\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Keys", + "String", + "List", + "Set", + "Hash" + ], + [ + "DEL", + "APPEND", + "LINDEX", + "SADD", + "HDEL" + ], + [ + "EXISTS", + "DECR", + "LLEN", + "SCARD", + "HEXISTS" + ], + [ + "EXPIRE", + "DECRBY", + "LPOP", + "SISMEMBER", + "HGET" + ], + [ + "PEXPIRE", + "GET", + "LPUSH", + "SMEMBERS", + "HGETALL" + ], + [ + "TTL", + "GETSET", + "LRANGE", + "SPOP", + "HINCRBY" + ], + [ + "TYPE", + "INCR", + "LREM", + "SRANDMEMBER", + "HLEN" + ], + [ + "-", + "INCRBY", + "LSET", + "SREM", + "HKEYS" + ], + [ + "-", + "MGET", + "LTRIM", + "-", + "HMGET" + ], + [ + "-", + "MSET", + "RPOP", + "-", + "HMSET" + ], + [ + "-", + "MSETNX", + "RPUSH", + "-", + "HSET" + ], + [ + "-", + "SET", + "-", + "-", + "HVALS" + ], + [ + "-", + "SETEX", + "-", + "-", + "-" + ], + [ + "-", + "SETNX", + "-", + "-", + "-" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729" + } + ], + "title": "Web CLI命令" + } + ] +} diff --git a/pkg/domain/reference/cache/reset-password.json b/pkg/domain/reference/cache/reset-password.json new file mode 100644 index 0000000..03e32cb --- /dev/null +++ b/pkg/domain/reference/cache/reset-password.json @@ -0,0 +1,622 @@ +{ + "title": "reset-password", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudcache/util/constants.js", + "sha256": "9ca1175c760e2ec50cf864464c54b5a2841d372254d372a654fe4a7db2705906", + "source": "const SERVICES=Object.freeze({EXEC_COMMAND:{path:\"/agc/edge/scs/scs-service/v1/eval\",method:\"POST\"},INFO_USAGE_STATISTICS:{path:\"/agc/edge/spms/v1/query/metric/scs-metric\",method:\"POST\"},SET_PASSWORD:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"POST\"},PASSWORD_CHANGE:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"PUT\"},ENABLE_CACHE:{path:\"/agc/edge/cpms/project-service/v1/services/order\",method:\"POST\"},CACHE_INVOKE:{path:\"/agc/edge/scs/scs-service/v1/cache-invoke-address\",method:\"GET\"}}),ENUMS=Object.freeze({MONITOR_TYPES:{METRIC_STATISTICS:\"query_cache_metric_trend\",SLOW_KEY:\"query_cache_slow_key_trend\",HOT_KEY:\"query_cache_hot_key_trend\",BIG_KEY:\"query_cache_big_key_trend\"},EPOCH_TIMESTAMP:{MIN:1296e4,MAX:21588768e5}});export{SERVICES,ENUMS};" + }, + { + "packagePath": "commands/cloudcache/util/Validation.js", + "sha256": "8ae84156e6579e00258add710553f259af4bc12c5abfd0695d89fe9608827cef", + "source": "import{ENUMS}from\"./constants.js\";export function isValidTimestamp(e){const t=parseInt(e);return t>=ENUMS.EPOCH_TIMESTAMP.MIN&&t<=ENUMS.EPOCH_TIMESTAMP.MAX}export function validatePassword(e){const t=/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[-~!@#%^*_=+?$&()|<>{}[\\]])[A-Za-z0-9-~!@#%^*_=+?$&()|<>{}[\\]]{8,32}$/;if(!t.test(e))throw new Error(\"Enter a password comprising 8 to 32 characters. It must start with a letter and contain at least one digit, one uppercase letter, one lowercase letter, and one special character (-~!@#%^*_=+?$&()| <>{}[]).)\");return t.test(e)}export async function checkCacheServiceEnabled(e){const t=e.storage.globalGet(\"serviceInfos\")||null;return!t||-1!==t.indexOf(\"cloudCache\")}export async function checkCacheServiceEnabledThrowError(e){if(!1===await checkCacheServiceEnabled(e))throw\"Please enable the Cloud Cache Service first by running the 'agcli cache enable --password ' command.\"}" + }, + { + "packagePath": "commands/cloudcache/cmd/infoUsageStatistics.js", + "sha256": "3f4e6735d3760ec937cc125545b4be0068e73760988b6866f739f8c8d2215ae3", + "source": "import{toLocaleDateString}from\"../../cloudstorage/util/helpers.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{CacheService}from\"../boundary/CacheService.js\";import{checkCacheServiceEnabledThrowError,isValidTimestamp}from\"../util/Validation.js\";async function infoUsageStatistics(e,t){try{validate(t);const i=await CacheService.getInfoOfUsageStatistics(e,t);if(void 0===i.metrics)throw new Error(i?.ret?.msg??\"The start time or end time is illegal\");if(Array.isArray(i.metrics)){const e=i.metrics.filter((e=>0!==e.count)).map((e=>({...e,date:toLocaleDateString(parseInt(e.timestamp)).replace(\"T\",\" \")})));e.length>0?TABLE(e):WARN(\"No record found!\")}else SUCCESS(i.metrics)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(void 0===e.startTime){const t=new Date;t.setHours(t.getHours()-24),e.startTime=Math.floor(t.getTime())}else if(!isValidTimestamp(e.startTime))throw new Error(\"Invalid start time\");if(void 0===e.endTime)e.endTime=parseInt(e.startTime)+864e5;else if(!isValidTimestamp(e.endTime))throw new Error(\"Invalid end time\");if(void 0!==e.startTime&&void 0!==e.endTime&&e.endTime-e.startTime>2592e5)throw new Error(\"The start and end date range can be up to 3 days.\")}export default function main(e){return{cmd:\"info\",desc:\"Show usage statistics of the Cloud Cache\",options:[{opt:\"--start-time \",desc:\"Start time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1},{opt:\"--end-time \",desc:\"End time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1}],addHelpText:[[\"after\",\"\\nExample:\\n agcli cache info --start-time timestamp --end-time timestamp\"]],child:[],action(t){infoUsageStatistics(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkCacheServiceEnabledThrowError(e)}}}" + }, + { + "packagePath": "commands/cloudcache/api/changePassword.js", + "sha256": "f8eedb3345769cfd423a629d6a4e22a6cd589a98d8e3f2e243fd40948fd1e905", + "source": "import{SERVICES}from\"../util/constants.js\";async function changeCloudCachePassword(e,o){const s={body:{password:`${o}`}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.PASSWORD_CHANGE,s)}export default changeCloudCachePassword;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "Password is write-only; resetting a used cache password can disrupt applications." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p16276124912475", + "title": "方式一" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p131976468508", + "title": "方式二" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p159471258125610", + "title": "方式三" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "title": "配置管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-overview-0000001367568657", + "title": "总览查看" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "title": "获取云缓存信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "title": "Java" + } + ], + "notes": [ + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "用户名:用于客户端访问云缓存时的用户名。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "使用云缓存", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "text": "您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。" + }, + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "提供了三种方式,可根据业务情况选择合适的方式:" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式一:使用原生的jedis客户端连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式二:使用Spring封装的RedisTemplate能力。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式一】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式二】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式三】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "renderedText": "指南\n云缓存\n使用云缓存\n使用云缓存\n更新时间: 2026-10-23 16:58\n获取云缓存信息\n\n在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。\n\n获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。\n\n获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。\n\n使用云缓存\n\n您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。\n\nNode.js\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\n\n const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;\nJava\n\n提供了三种方式,可根据业务情况选择合适的方式:\n\n方式一:使用原生的jedis客户端连接云缓存。\n方式二:使用Spring封装的RedisTemplate能力。\n方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。\n\n【方式一】\n\n在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}\n\n【方式二】\n\n在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n\n【方式三】\n\n在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0\n在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n配置管理\n总览查看\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n获取云缓存信息\n使用云缓存\nNode.js\nJava\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "status": "browser-read", + "tables": [], + "title": "使用云缓存" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "title": "Web CLI命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "title": "访问命令行工具" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "title": "查看用户名、内网地址" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "text": "云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码不能为空。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码必须以字母开头。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码长度在8到32位之间。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "小写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "大写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "数字(0-9)" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + } + ], + "renderedText": "配置管理\n更新时间: 2026-10-23 16:58\n\n云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。\n\n访问命令行工具\n\n云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。\n\n重置访问密码\n\n云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])\n\n查看用户名、内网地址\n\n云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n访问命令行工具\n重置访问密码\n查看用户名、内网地址\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "status": "browser-read", + "tables": [], + "title": "配置管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-usage-0000001316079964", + "title": "用量统计" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "本章节主要介绍Web CLI工具支持的命令列表。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当value值为空时,执行get命令返回nil。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "各个命令的详细语法请前往Redis官方网站查看。" + } + ], + "renderedText": "指南\n云缓存\nWeb CLI命令\nWeb CLI命令\n更新时间: 2026-10-23 16:58\n\n本章节主要介绍Web CLI工具支持的命令列表。\n\n说明\n当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。\n当value值为空时,执行get命令返回nil。\n各个命令的详细语法请前往Redis官方网站查看。\n\nKeys\n\n\t\n\nString\n\n\t\n\nList\n\n\t\n\nSet\n\n\t\n\nHash\n\n\n\n\nDEL\n\n\t\n\nAPPEND\n\n\t\n\nLINDEX\n\n\t\n\nSADD\n\n\t\n\nHDEL\n\n\n\n\nEXISTS\n\n\t\n\nDECR\n\n\t\n\nLLEN\n\n\t\n\nSCARD\n\n\t\n\nHEXISTS\n\n\n\n\nEXPIRE\n\n\t\n\nDECRBY\n\n\t\n\nLPOP\n\n\t\n\nSISMEMBER\n\n\t\n\nHGET\n\n\n\n\nPEXPIRE\n\n\t\n\nGET\n\n\t\n\nLPUSH\n\n\t\n\nSMEMBERS\n\n\t\n\nHGETALL\n\n\n\n\nTTL\n\n\t\n\nGETSET\n\n\t\n\nLRANGE\n\n\t\n\nSPOP\n\n\t\n\nHINCRBY\n\n\n\n\nTYPE\n\n\t\n\nINCR\n\n\t\n\nLREM\n\n\t\n\nSRANDMEMBER\n\n\t\n\nHLEN\n\n\n\n\n-\n\n\t\n\nINCRBY\n\n\t\n\nLSET\n\n\t\n\nSREM\n\n\t\n\nHKEYS\n\n\n\n\n-\n\n\t\n\nMGET\n\n\t\n\nLTRIM\n\n\t\n\n-\n\n\t\n\nHMGET\n\n\n\n\n-\n\n\t\n\nMSET\n\n\t\n\nRPOP\n\n\t\n\n-\n\n\t\n\nHMSET\n\n\n\n\n-\n\n\t\n\nMSETNX\n\n\t\n\nRPUSH\n\n\t\n\n-\n\n\t\n\nHSET\n\n\n\n\n-\n\n\t\n\nSET\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\nHVALS\n\n\n\n\n-\n\n\t\n\nSETEX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\n-\n\n\t\n\nSETNX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n用量统计\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Keys", + "String", + "List", + "Set", + "Hash" + ], + [ + "DEL", + "APPEND", + "LINDEX", + "SADD", + "HDEL" + ], + [ + "EXISTS", + "DECR", + "LLEN", + "SCARD", + "HEXISTS" + ], + [ + "EXPIRE", + "DECRBY", + "LPOP", + "SISMEMBER", + "HGET" + ], + [ + "PEXPIRE", + "GET", + "LPUSH", + "SMEMBERS", + "HGETALL" + ], + [ + "TTL", + "GETSET", + "LRANGE", + "SPOP", + "HINCRBY" + ], + [ + "TYPE", + "INCR", + "LREM", + "SRANDMEMBER", + "HLEN" + ], + [ + "-", + "INCRBY", + "LSET", + "SREM", + "HKEYS" + ], + [ + "-", + "MGET", + "LTRIM", + "-", + "HMGET" + ], + [ + "-", + "MSET", + "RPOP", + "-", + "HMSET" + ], + [ + "-", + "MSETNX", + "RPUSH", + "-", + "HSET" + ], + [ + "-", + "SET", + "-", + "-", + "HVALS" + ], + [ + "-", + "SETEX", + "-", + "-", + "-" + ], + [ + "-", + "SETNX", + "-", + "-", + "-" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729" + } + ], + "title": "Web CLI命令" + } + ] +} diff --git a/pkg/domain/reference/cache/set-password.json b/pkg/domain/reference/cache/set-password.json new file mode 100644 index 0000000..4ef89b6 --- /dev/null +++ b/pkg/domain/reference/cache/set-password.json @@ -0,0 +1,622 @@ +{ + "title": "set-password", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudcache/util/constants.js", + "sha256": "9ca1175c760e2ec50cf864464c54b5a2841d372254d372a654fe4a7db2705906", + "source": "const SERVICES=Object.freeze({EXEC_COMMAND:{path:\"/agc/edge/scs/scs-service/v1/eval\",method:\"POST\"},INFO_USAGE_STATISTICS:{path:\"/agc/edge/spms/v1/query/metric/scs-metric\",method:\"POST\"},SET_PASSWORD:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"POST\"},PASSWORD_CHANGE:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"PUT\"},ENABLE_CACHE:{path:\"/agc/edge/cpms/project-service/v1/services/order\",method:\"POST\"},CACHE_INVOKE:{path:\"/agc/edge/scs/scs-service/v1/cache-invoke-address\",method:\"GET\"}}),ENUMS=Object.freeze({MONITOR_TYPES:{METRIC_STATISTICS:\"query_cache_metric_trend\",SLOW_KEY:\"query_cache_slow_key_trend\",HOT_KEY:\"query_cache_hot_key_trend\",BIG_KEY:\"query_cache_big_key_trend\"},EPOCH_TIMESTAMP:{MIN:1296e4,MAX:21588768e5}});export{SERVICES,ENUMS};" + }, + { + "packagePath": "commands/cloudcache/util/Validation.js", + "sha256": "8ae84156e6579e00258add710553f259af4bc12c5abfd0695d89fe9608827cef", + "source": "import{ENUMS}from\"./constants.js\";export function isValidTimestamp(e){const t=parseInt(e);return t>=ENUMS.EPOCH_TIMESTAMP.MIN&&t<=ENUMS.EPOCH_TIMESTAMP.MAX}export function validatePassword(e){const t=/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[-~!@#%^*_=+?$&()|<>{}[\\]])[A-Za-z0-9-~!@#%^*_=+?$&()|<>{}[\\]]{8,32}$/;if(!t.test(e))throw new Error(\"Enter a password comprising 8 to 32 characters. It must start with a letter and contain at least one digit, one uppercase letter, one lowercase letter, and one special character (-~!@#%^*_=+?$&()| <>{}[]).)\");return t.test(e)}export async function checkCacheServiceEnabled(e){const t=e.storage.globalGet(\"serviceInfos\")||null;return!t||-1!==t.indexOf(\"cloudCache\")}export async function checkCacheServiceEnabledThrowError(e){if(!1===await checkCacheServiceEnabled(e))throw\"Please enable the Cloud Cache Service first by running the 'agcli cache enable --password ' command.\"}" + }, + { + "packagePath": "commands/cloudcache/cmd/infoUsageStatistics.js", + "sha256": "3f4e6735d3760ec937cc125545b4be0068e73760988b6866f739f8c8d2215ae3", + "source": "import{toLocaleDateString}from\"../../cloudstorage/util/helpers.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{CacheService}from\"../boundary/CacheService.js\";import{checkCacheServiceEnabledThrowError,isValidTimestamp}from\"../util/Validation.js\";async function infoUsageStatistics(e,t){try{validate(t);const i=await CacheService.getInfoOfUsageStatistics(e,t);if(void 0===i.metrics)throw new Error(i?.ret?.msg??\"The start time or end time is illegal\");if(Array.isArray(i.metrics)){const e=i.metrics.filter((e=>0!==e.count)).map((e=>({...e,date:toLocaleDateString(parseInt(e.timestamp)).replace(\"T\",\" \")})));e.length>0?TABLE(e):WARN(\"No record found!\")}else SUCCESS(i.metrics)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(void 0===e.startTime){const t=new Date;t.setHours(t.getHours()-24),e.startTime=Math.floor(t.getTime())}else if(!isValidTimestamp(e.startTime))throw new Error(\"Invalid start time\");if(void 0===e.endTime)e.endTime=parseInt(e.startTime)+864e5;else if(!isValidTimestamp(e.endTime))throw new Error(\"Invalid end time\");if(void 0!==e.startTime&&void 0!==e.endTime&&e.endTime-e.startTime>2592e5)throw new Error(\"The start and end date range can be up to 3 days.\")}export default function main(e){return{cmd:\"info\",desc:\"Show usage statistics of the Cloud Cache\",options:[{opt:\"--start-time \",desc:\"Start time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1},{opt:\"--end-time \",desc:\"End time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1}],addHelpText:[[\"after\",\"\\nExample:\\n agcli cache info --start-time timestamp --end-time timestamp\"]],child:[],action(t){infoUsageStatistics(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkCacheServiceEnabledThrowError(e)}}}" + }, + { + "packagePath": "commands/cloudcache/api/setPassword.js", + "sha256": "edba557a80a3c11d10faa34cc8c9b075bdc8b3c0278a0af8df379cf25330d55e", + "source": "import{SERVICES}from\"../util/constants.js\";async function setCloudCachePassword(e,s){const t={body:{password:`${s}`}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.SET_PASSWORD,t)}export default setCloudCachePassword;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "Password is write-only; resetting a used cache password can disrupt applications." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p16276124912475", + "title": "方式一" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p131976468508", + "title": "方式二" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p159471258125610", + "title": "方式三" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "title": "配置管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-overview-0000001367568657", + "title": "总览查看" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "title": "获取云缓存信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "title": "Java" + } + ], + "notes": [ + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "用户名:用于客户端访问云缓存时的用户名。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "使用云缓存", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "text": "您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。" + }, + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "提供了三种方式,可根据业务情况选择合适的方式:" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式一:使用原生的jedis客户端连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式二:使用Spring封装的RedisTemplate能力。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式一】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式二】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式三】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "renderedText": "指南\n云缓存\n使用云缓存\n使用云缓存\n更新时间: 2026-10-23 16:58\n获取云缓存信息\n\n在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。\n\n获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。\n\n获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。\n\n使用云缓存\n\n您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。\n\nNode.js\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\n\n const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;\nJava\n\n提供了三种方式,可根据业务情况选择合适的方式:\n\n方式一:使用原生的jedis客户端连接云缓存。\n方式二:使用Spring封装的RedisTemplate能力。\n方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。\n\n【方式一】\n\n在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}\n\n【方式二】\n\n在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n\n【方式三】\n\n在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0\n在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n配置管理\n总览查看\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n获取云缓存信息\n使用云缓存\nNode.js\nJava\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "status": "browser-read", + "tables": [], + "title": "使用云缓存" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "title": "Web CLI命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "title": "访问命令行工具" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "title": "查看用户名、内网地址" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "text": "云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码不能为空。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码必须以字母开头。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码长度在8到32位之间。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "小写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "大写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "数字(0-9)" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + } + ], + "renderedText": "配置管理\n更新时间: 2026-10-23 16:58\n\n云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。\n\n访问命令行工具\n\n云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。\n\n重置访问密码\n\n云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])\n\n查看用户名、内网地址\n\n云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n访问命令行工具\n重置访问密码\n查看用户名、内网地址\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "status": "browser-read", + "tables": [], + "title": "配置管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-usage-0000001316079964", + "title": "用量统计" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "本章节主要介绍Web CLI工具支持的命令列表。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当value值为空时,执行get命令返回nil。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "各个命令的详细语法请前往Redis官方网站查看。" + } + ], + "renderedText": "指南\n云缓存\nWeb CLI命令\nWeb CLI命令\n更新时间: 2026-10-23 16:58\n\n本章节主要介绍Web CLI工具支持的命令列表。\n\n说明\n当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。\n当value值为空时,执行get命令返回nil。\n各个命令的详细语法请前往Redis官方网站查看。\n\nKeys\n\n\t\n\nString\n\n\t\n\nList\n\n\t\n\nSet\n\n\t\n\nHash\n\n\n\n\nDEL\n\n\t\n\nAPPEND\n\n\t\n\nLINDEX\n\n\t\n\nSADD\n\n\t\n\nHDEL\n\n\n\n\nEXISTS\n\n\t\n\nDECR\n\n\t\n\nLLEN\n\n\t\n\nSCARD\n\n\t\n\nHEXISTS\n\n\n\n\nEXPIRE\n\n\t\n\nDECRBY\n\n\t\n\nLPOP\n\n\t\n\nSISMEMBER\n\n\t\n\nHGET\n\n\n\n\nPEXPIRE\n\n\t\n\nGET\n\n\t\n\nLPUSH\n\n\t\n\nSMEMBERS\n\n\t\n\nHGETALL\n\n\n\n\nTTL\n\n\t\n\nGETSET\n\n\t\n\nLRANGE\n\n\t\n\nSPOP\n\n\t\n\nHINCRBY\n\n\n\n\nTYPE\n\n\t\n\nINCR\n\n\t\n\nLREM\n\n\t\n\nSRANDMEMBER\n\n\t\n\nHLEN\n\n\n\n\n-\n\n\t\n\nINCRBY\n\n\t\n\nLSET\n\n\t\n\nSREM\n\n\t\n\nHKEYS\n\n\n\n\n-\n\n\t\n\nMGET\n\n\t\n\nLTRIM\n\n\t\n\n-\n\n\t\n\nHMGET\n\n\n\n\n-\n\n\t\n\nMSET\n\n\t\n\nRPOP\n\n\t\n\n-\n\n\t\n\nHMSET\n\n\n\n\n-\n\n\t\n\nMSETNX\n\n\t\n\nRPUSH\n\n\t\n\n-\n\n\t\n\nHSET\n\n\n\n\n-\n\n\t\n\nSET\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\nHVALS\n\n\n\n\n-\n\n\t\n\nSETEX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\n-\n\n\t\n\nSETNX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n用量统计\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Keys", + "String", + "List", + "Set", + "Hash" + ], + [ + "DEL", + "APPEND", + "LINDEX", + "SADD", + "HDEL" + ], + [ + "EXISTS", + "DECR", + "LLEN", + "SCARD", + "HEXISTS" + ], + [ + "EXPIRE", + "DECRBY", + "LPOP", + "SISMEMBER", + "HGET" + ], + [ + "PEXPIRE", + "GET", + "LPUSH", + "SMEMBERS", + "HGETALL" + ], + [ + "TTL", + "GETSET", + "LRANGE", + "SPOP", + "HINCRBY" + ], + [ + "TYPE", + "INCR", + "LREM", + "SRANDMEMBER", + "HLEN" + ], + [ + "-", + "INCRBY", + "LSET", + "SREM", + "HKEYS" + ], + [ + "-", + "MGET", + "LTRIM", + "-", + "HMGET" + ], + [ + "-", + "MSET", + "RPOP", + "-", + "HMSET" + ], + [ + "-", + "MSETNX", + "RPUSH", + "-", + "HSET" + ], + [ + "-", + "SET", + "-", + "-", + "HVALS" + ], + [ + "-", + "SETEX", + "-", + "-", + "-" + ], + [ + "-", + "SETNX", + "-", + "-", + "-" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729" + } + ], + "title": "Web CLI命令" + } + ] +} diff --git a/pkg/domain/reference/cache/usage.json b/pkg/domain/reference/cache/usage.json new file mode 100644 index 0000000..f0d0eca --- /dev/null +++ b/pkg/domain/reference/cache/usage.json @@ -0,0 +1,622 @@ +{ + "title": "usage", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudcache/util/constants.js", + "sha256": "9ca1175c760e2ec50cf864464c54b5a2841d372254d372a654fe4a7db2705906", + "source": "const SERVICES=Object.freeze({EXEC_COMMAND:{path:\"/agc/edge/scs/scs-service/v1/eval\",method:\"POST\"},INFO_USAGE_STATISTICS:{path:\"/agc/edge/spms/v1/query/metric/scs-metric\",method:\"POST\"},SET_PASSWORD:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"POST\"},PASSWORD_CHANGE:{path:\"/agc/edge/scs/scs-service/v1/cache-password\",method:\"PUT\"},ENABLE_CACHE:{path:\"/agc/edge/cpms/project-service/v1/services/order\",method:\"POST\"},CACHE_INVOKE:{path:\"/agc/edge/scs/scs-service/v1/cache-invoke-address\",method:\"GET\"}}),ENUMS=Object.freeze({MONITOR_TYPES:{METRIC_STATISTICS:\"query_cache_metric_trend\",SLOW_KEY:\"query_cache_slow_key_trend\",HOT_KEY:\"query_cache_hot_key_trend\",BIG_KEY:\"query_cache_big_key_trend\"},EPOCH_TIMESTAMP:{MIN:1296e4,MAX:21588768e5}});export{SERVICES,ENUMS};" + }, + { + "packagePath": "commands/cloudcache/util/Validation.js", + "sha256": "8ae84156e6579e00258add710553f259af4bc12c5abfd0695d89fe9608827cef", + "source": "import{ENUMS}from\"./constants.js\";export function isValidTimestamp(e){const t=parseInt(e);return t>=ENUMS.EPOCH_TIMESTAMP.MIN&&t<=ENUMS.EPOCH_TIMESTAMP.MAX}export function validatePassword(e){const t=/^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[-~!@#%^*_=+?$&()|<>{}[\\]])[A-Za-z0-9-~!@#%^*_=+?$&()|<>{}[\\]]{8,32}$/;if(!t.test(e))throw new Error(\"Enter a password comprising 8 to 32 characters. It must start with a letter and contain at least one digit, one uppercase letter, one lowercase letter, and one special character (-~!@#%^*_=+?$&()| <>{}[]).)\");return t.test(e)}export async function checkCacheServiceEnabled(e){const t=e.storage.globalGet(\"serviceInfos\")||null;return!t||-1!==t.indexOf(\"cloudCache\")}export async function checkCacheServiceEnabledThrowError(e){if(!1===await checkCacheServiceEnabled(e))throw\"Please enable the Cloud Cache Service first by running the 'agcli cache enable --password ' command.\"}" + }, + { + "packagePath": "commands/cloudcache/cmd/infoUsageStatistics.js", + "sha256": "3f4e6735d3760ec937cc125545b4be0068e73760988b6866f739f8c8d2215ae3", + "source": "import{toLocaleDateString}from\"../../cloudstorage/util/helpers.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{CacheService}from\"../boundary/CacheService.js\";import{checkCacheServiceEnabledThrowError,isValidTimestamp}from\"../util/Validation.js\";async function infoUsageStatistics(e,t){try{validate(t);const i=await CacheService.getInfoOfUsageStatistics(e,t);if(void 0===i.metrics)throw new Error(i?.ret?.msg??\"The start time or end time is illegal\");if(Array.isArray(i.metrics)){const e=i.metrics.filter((e=>0!==e.count)).map((e=>({...e,date:toLocaleDateString(parseInt(e.timestamp)).replace(\"T\",\" \")})));e.length>0?TABLE(e):WARN(\"No record found!\")}else SUCCESS(i.metrics)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(void 0===e.startTime){const t=new Date;t.setHours(t.getHours()-24),e.startTime=Math.floor(t.getTime())}else if(!isValidTimestamp(e.startTime))throw new Error(\"Invalid start time\");if(void 0===e.endTime)e.endTime=parseInt(e.startTime)+864e5;else if(!isValidTimestamp(e.endTime))throw new Error(\"Invalid end time\");if(void 0!==e.startTime&&void 0!==e.endTime&&e.endTime-e.startTime>2592e5)throw new Error(\"The start and end date range can be up to 3 days.\")}export default function main(e){return{cmd:\"info\",desc:\"Show usage statistics of the Cloud Cache\",options:[{opt:\"--start-time \",desc:\"Start time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1},{opt:\"--end-time \",desc:\"End time of statistics. It must be a timestamp. If start-time and end-time are empty, statistics of last 1 day will be displayed.\",required:!1}],addHelpText:[[\"after\",\"\\nExample:\\n agcli cache info --start-time timestamp --end-time timestamp\"]],child:[],action(t){infoUsageStatistics(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkCacheServiceEnabledThrowError(e)}}}" + }, + { + "packagePath": "commands/cloudcache/api/getInfoOfUsageStatistics.js", + "sha256": "328e59a30c732d336e51def4de5880c4a3d564dc5125df767a89f9142f1cee6c", + "source": "import{SERVICES,ENUMS}from\"../util/constants.js\";async function getInfoOfUsageStatistics(e,t){const s={query:{views:ENUMS.MONITOR_TYPES.METRIC_STATISTICS,startTime:t.startTime,endTime:t.endTime}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.INFO_USAGE_STATISTICS,s)}export default getInfoOfUsageStatistics;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "Epoch timestamps are milliseconds; interval at most three days, per source cmd/infoUsageStatistics.js." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p16276124912475", + "title": "方式一" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p131976468508", + "title": "方式二" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p159471258125610", + "title": "方式三" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "title": "配置管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-overview-0000001367568657", + "title": "总览查看" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "title": "获取云缓存信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "title": "Java" + } + ], + "notes": [ + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "用户名:用于客户端访问云缓存时的用户名。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "使用云缓存", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "text": "您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。" + }, + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "提供了三种方式,可根据业务情况选择合适的方式:" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式一:使用原生的jedis客户端连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式二:使用Spring封装的RedisTemplate能力。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式一】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式二】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式三】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "renderedText": "指南\n云缓存\n使用云缓存\n使用云缓存\n更新时间: 2026-10-23 16:58\n获取云缓存信息\n\n在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。\n\n获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。\n\n获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。\n\n使用云缓存\n\n您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。\n\nNode.js\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\n\n const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;\nJava\n\n提供了三种方式,可根据业务情况选择合适的方式:\n\n方式一:使用原生的jedis客户端连接云缓存。\n方式二:使用Spring封装的RedisTemplate能力。\n方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。\n\n【方式一】\n\n在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}\n\n【方式二】\n\n在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n\n【方式三】\n\n在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0\n在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n配置管理\n总览查看\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n获取云缓存信息\n使用云缓存\nNode.js\nJava\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "status": "browser-read", + "tables": [], + "title": "使用云缓存" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "title": "Web CLI命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "title": "访问命令行工具" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "title": "查看用户名、内网地址" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "text": "云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码不能为空。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码必须以字母开头。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码长度在8到32位之间。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "小写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "大写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "数字(0-9)" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + } + ], + "renderedText": "配置管理\n更新时间: 2026-10-23 16:58\n\n云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。\n\n访问命令行工具\n\n云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。\n\n重置访问密码\n\n云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])\n\n查看用户名、内网地址\n\n云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n访问命令行工具\n重置访问密码\n查看用户名、内网地址\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "status": "browser-read", + "tables": [], + "title": "配置管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-usage-0000001316079964", + "title": "用量统计" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "本章节主要介绍Web CLI工具支持的命令列表。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当value值为空时,执行get命令返回nil。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "各个命令的详细语法请前往Redis官方网站查看。" + } + ], + "renderedText": "指南\n云缓存\nWeb CLI命令\nWeb CLI命令\n更新时间: 2026-10-23 16:58\n\n本章节主要介绍Web CLI工具支持的命令列表。\n\n说明\n当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。\n当value值为空时,执行get命令返回nil。\n各个命令的详细语法请前往Redis官方网站查看。\n\nKeys\n\n\t\n\nString\n\n\t\n\nList\n\n\t\n\nSet\n\n\t\n\nHash\n\n\n\n\nDEL\n\n\t\n\nAPPEND\n\n\t\n\nLINDEX\n\n\t\n\nSADD\n\n\t\n\nHDEL\n\n\n\n\nEXISTS\n\n\t\n\nDECR\n\n\t\n\nLLEN\n\n\t\n\nSCARD\n\n\t\n\nHEXISTS\n\n\n\n\nEXPIRE\n\n\t\n\nDECRBY\n\n\t\n\nLPOP\n\n\t\n\nSISMEMBER\n\n\t\n\nHGET\n\n\n\n\nPEXPIRE\n\n\t\n\nGET\n\n\t\n\nLPUSH\n\n\t\n\nSMEMBERS\n\n\t\n\nHGETALL\n\n\n\n\nTTL\n\n\t\n\nGETSET\n\n\t\n\nLRANGE\n\n\t\n\nSPOP\n\n\t\n\nHINCRBY\n\n\n\n\nTYPE\n\n\t\n\nINCR\n\n\t\n\nLREM\n\n\t\n\nSRANDMEMBER\n\n\t\n\nHLEN\n\n\n\n\n-\n\n\t\n\nINCRBY\n\n\t\n\nLSET\n\n\t\n\nSREM\n\n\t\n\nHKEYS\n\n\n\n\n-\n\n\t\n\nMGET\n\n\t\n\nLTRIM\n\n\t\n\n-\n\n\t\n\nHMGET\n\n\n\n\n-\n\n\t\n\nMSET\n\n\t\n\nRPOP\n\n\t\n\n-\n\n\t\n\nHMSET\n\n\n\n\n-\n\n\t\n\nMSETNX\n\n\t\n\nRPUSH\n\n\t\n\n-\n\n\t\n\nHSET\n\n\n\n\n-\n\n\t\n\nSET\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\nHVALS\n\n\n\n\n-\n\n\t\n\nSETEX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\n-\n\n\t\n\nSETNX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n用量统计\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Keys", + "String", + "List", + "Set", + "Hash" + ], + [ + "DEL", + "APPEND", + "LINDEX", + "SADD", + "HDEL" + ], + [ + "EXISTS", + "DECR", + "LLEN", + "SCARD", + "HEXISTS" + ], + [ + "EXPIRE", + "DECRBY", + "LPOP", + "SISMEMBER", + "HGET" + ], + [ + "PEXPIRE", + "GET", + "LPUSH", + "SMEMBERS", + "HGETALL" + ], + [ + "TTL", + "GETSET", + "LRANGE", + "SPOP", + "HINCRBY" + ], + [ + "TYPE", + "INCR", + "LREM", + "SRANDMEMBER", + "HLEN" + ], + [ + "-", + "INCRBY", + "LSET", + "SREM", + "HKEYS" + ], + [ + "-", + "MGET", + "LTRIM", + "-", + "HMGET" + ], + [ + "-", + "MSET", + "RPOP", + "-", + "HMSET" + ], + [ + "-", + "MSETNX", + "RPUSH", + "-", + "HSET" + ], + [ + "-", + "SET", + "-", + "-", + "HVALS" + ], + [ + "-", + "SETEX", + "-", + "-", + "-" + ], + [ + "-", + "SETNX", + "-", + "-", + "-" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729" + } + ], + "title": "Web CLI命令" + } + ] +} diff --git a/pkg/domain/reference/cloud-auth/client-token.json b/pkg/domain/reference/cloud-auth/client-token.json new file mode 100644 index 0000000..0ad547f --- /dev/null +++ b/pkg/domain/reference/cloud-auth/client-token.json @@ -0,0 +1,179 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section624414128367", + "text": "请求示例\nPOST /agc/apigw/oauth2/v1/token\nHost: connect-drcn.dbankcloud.cn\nContent-Type: application/json\n{\n \"useJwt\":0,\n \"grant_type\":\"client_credentials\",\n \"client_id\":\"26********20\",\n \"client_secret\":\"************************\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section18524194122113", + "text": "响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"access_token\": \"eyJhbGciOiJIUzU****************\", \n \"expires_in\": 172800\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "title": "验证码申请" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section125771341635", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section624414128367", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section129mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section18524194122113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section53163821", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section125771341635", + "text": "在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "text": "请求参数以JSON格式传入,包含参数如下。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section129mcpsimp", + "text": "返回值为JSON格式的字符串,包含参数如下。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n获取Token\n获取Token\n更新时间: 2026-10-22 11:25\n功能介绍\n\n在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\n\n请求参数以JSON格式传入,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\nuseJwt\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n是否使用自有账号凭据JWT(Json Web Token):\n\n1:使用JWT。\n0:不使用,默认为0。\n\n\n\ngrant_type\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n固定传入“client_credentials”。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,即获取客户端API授权中的“Client ID”。\n\n\n\n\nclient_secret\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端密钥,即获取客户端API授权中的“Client Secret”。\n\n请求示例\nPOST /agc/apigw/oauth2/v1/token\nHost: connect-drcn.dbankcloud.cn\nContent-Type: application/json\n{\n \"useJwt\":0,\n \"grant_type\":\"client_credentials\",\n \"client_id\":\"26********20\",\n \"client_secret\":\"************************\"\n}\n响应参数\n\n返回值为JSON格式的字符串,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\naccess_token\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n认证Token,用于API接口调用。\n\n此参数只在获取成功时返回。\n\n\n\n\nexpires_in\n\n\t\n\nO\n\n\t\n\nLong\n\n\t\n\naccess_token的有效期,单位为秒。您需要在过期时间到达时重新调用本接口获取新的access_token。\n\n有效期为48小时,如果在有效期内再次调用接口获取access_token时,新老access_token都是有效的。\n\n此参数只在获取成功时返回。\n\n响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"access_token\": \"eyJhbGciOiJIUzU****************\", \n \"expires_in\": 172800\n}\n调用示例\n// 获取access_token\n public static String getClientToken() throws IOException {\n AccessTokenReq accessTokenReq = new AccessTokenReq()\n .clientIdSet(CLIENT_ID)\n .clientSecretSet(CLIENT_SECRET)\n .grantTypeSet(\"client_credentials\")\n .useJwtSet(0);\n HttpClient client = HttpClients.createDefault();\n HttpPost httpPost = new HttpPost(HOST + \"/agc/apigw/oauth2/v1/token\");\n httpPost.setHeader(\"Accept\", \"*/*\");\n httpPost.setHeader(\"Content-Type\", \"application/json\");\n httpPost.setEntity(new StringEntity(JsonUtil.toJson(accessTokenReq), Charset.forName(\"UTF-8\")));\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n AccessTokenRsp.class).getAccessToken();\n }\nREST API\n验证码申请\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section6932219103913" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "useJwt", + "M", + "Integer", + "是否使用自有账号凭据JWT(Json Web Token): 1:使用JWT。 0:不使用,默认为0。" + ], + [ + "grant_type", + "M", + "String", + "固定传入“client_credentials”。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,即获取客户端API授权中的“Client ID”。" + ], + [ + "client_secret", + "M", + "String", + "客户端密钥,即获取客户端API授权中的“Client Secret”。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "access_token", + "O", + "String", + "认证Token,用于API接口调用。 此参数只在获取成功时返回。" + ], + [ + "expires_in", + "O", + "Long", + "access_token的有效期,单位为秒。您需要在过期时间到达时重新调用本接口获取新的access_token。 有效期为48小时,如果在有效期内再次调用接口获取access_token时,新老access_token都是有效的。 此参数只在获取成功时返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section129mcpsimp" + } + ], + "title": "获取Token", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/client-token.parameters.json b/pkg/domain/reference/cloud-auth/client-token.parameters.json new file mode 100644 index 0000000..b7235b0 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/client-token.parameters.json @@ -0,0 +1,41 @@ +[ + { + "name": "useJwt", + "type": "integer", + "required": true, + "description": "是否使用自有账号凭据JWT(Json Web Token): 1:使用JWT。 0:不使用,默认为0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "grant_type", + "type": "string", + "required": true, + "description": "固定传入“client_credentials”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body", + "enum": [ + "client_credentials" + ] + }, + { + "name": "client_id", + "type": "string", + "required": true, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body" + }, + { + "name": "client_secret", + "type": "string", + "required": true, + "description": "客户端密钥,即获取客户端API授权中的“Client Secret”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/client-token.rules.json b/pkg/domain/reference/cloud-auth/client-token.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/client-token.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/delete-user.json b/pkg/domain/reference/cloud-auth/delete-user.json new file mode 100644 index 0000000..ab779c5 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/delete-user.json @@ -0,0 +1,204 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section16673105721318", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-unlink\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section2570984140", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113", + "title": "登出" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693", + "title": "账号重认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section157942320138", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section497602210133", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section114731631191320", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section1636433517133", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section16673105721318", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section208022319143", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section2570984140", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section1311441410142", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section157942320138", + "text": "此接口用于用户进行账号注销操作。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n注销\n注销\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户进行账号注销操作。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-delete\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\naccess_token\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-unlink\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}\n调用示例\nJava\n /**\n * 注销请求\n * \n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param accessToken\n * @return 接口结果\n * @throws IOException 异常\n */\n public static AuthOperateRsp userDelete(String token, String clientId, String productId, String accessToken) \n throws IOException {\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-delete?productId=\" + productId);\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n httpPost.setHeader(\"access_token\", accessToken);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n AuthOperateRsp.class);\n }\n登出\n账号重认证\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-delete 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section497602210133" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section1636433517133" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "access_token", + "M", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section208022319143" + } + ], + "title": "注销", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/delete-user.parameters.json b/pkg/domain/reference/cloud-auth/delete-user.parameters.json new file mode 100644 index 0000000..7be148c --- /dev/null +++ b/pkg/domain/reference/cloud-auth/delete-user.parameters.json @@ -0,0 +1,34 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section1636433517133", + "in": "query" + } +] diff --git a/pkg/domain/reference/cloud-auth/delete-user.rules.json b/pkg/domain/reference/cloud-auth/delete-user.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/delete-user.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/export-users.json b/pkg/domain/reference/cloud-auth/export-users.json new file mode 100644 index 0000000..e5e07d8 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/export-users.json @@ -0,0 +1,283 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section126468199352", + "text": "请求示例\nPOST /api/auth-service/v1/server/user:export\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com\n{\n \"block\": 0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section173373185383", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n },\n \"totalBlock\": 1,\n \"users\": [{\n \"uid\": \"685584833111393408\",\n \"importUid\": \"99038248123456789\",\n \"displayName\": \"HelloWorld\",\n \"photoUrl\": \"https://developer.huawei.com/consumer/xxx.png\",\n \"email\": \"xxxx@huawei.com\",\n \"emailVerified\": true,\n \"phone\": \"+86-18260099999\",\n \"createTime\": \"1627027017000\",\n \"lastLoginTime\": \"1627027017000\",\n \"status\": 1,\n \"providers\": [{\n \"provider\": \"4\",\n \"providerUid\": \"9903824860586577777\",\n \"photoUrl\": \"https://weixin.qq.com/xxx.png\",\n \"displayName\": \"HelloWorld\",\n \"openId\": \"123455\"\n }\n ]\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-0000001055443186", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "title": "获取服务端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892", + "title": "导入用户" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271", + "title": "验证用户凭据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section899515213431", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section16294334331", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section126468199352", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section17360508366", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section173373185383", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section20338152013394", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section15408512141113", + "text": "此接口用于导出认证服务中的用户信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section899515213431", + "text": "接口调用者的角色:管理员、APP管理员、开发。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section899515213431", + "text": "接口调用次数限制:20个请求/client_id/秒" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "text": "Service Account方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "text": "API客户端方式" + } + ], + "renderedText": "API参考\n认证服务\nServer\nREST API\n导出用户\n导出用户\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于导出认证服务中的用户信息。\n\n使用约束\n接口调用者的角色:管理员、APP管理员、开发。\n接口调用次数限制:20个请求/client_id/秒\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为认证服务\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/auth-service/v1/server/user:export\n\n中国站点的domain:connect-api.cloud.huawei.com\n\n德国站点的domain:connect-api-dre.cloud.huawei.com\n\n新加坡站点的domain:connect-api-dra.cloud.huawei.com\n\n俄罗斯站点的domain:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n说明\n\n本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。\n\nService Account方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。\n\nAPI客户端方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nblock\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n当前存储块号。不填默认是0。第1次调用时,block设置为0。服务端会返回totalBlock。后面采用循环调用,遍历导出block块里面的用户。\n\n请求示例\nPOST /api/auth-service/v1/server/user:export\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com\n{\n \"block\": 0\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nM\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ntotalBlock\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n数据存储的总块数。\n\n\n\n\nusers\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nJSONArray字符串,格式为[{\"uid\":\"string\",\"importUid\":\"string\",\"displayName\":\"string\",\"photoUrl\":\"string\",\"email\":\"string\",\"emailVerified\":true,\"phone\":\"string\",\"createTime\":\"string\",\"lastLoginTime\":\"string\",\"status\":0,\"providers\":[{\"provider\":\"string\",\"providerUid\":\"string\",\"photoUrl\":\"string\",\"displayName\":\"string\",\"openId\":\"string\"}]}]\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n },\n \"totalBlock\": 1,\n \"users\": [{\n \"uid\": \"685584833111393408\",\n \"importUid\": \"99038248123456789\",\n \"displayName\": \"HelloWorld\",\n \"photoUrl\": \"https://developer.huawei.com/consumer/xxx.png\",\n \"email\": \"xxxx@huawei.com\",\n \"emailVerified\": true,\n \"phone\": \"+86-18260099999\",\n \"createTime\": \"1627027017000\",\n \"lastLoginTime\": \"1627027017000\",\n \"status\": 1,\n \"providers\": [{\n \"provider\": \"4\",\n \"providerUid\": \"9903824860586577777\",\n \"photoUrl\": \"https://weixin.qq.com/xxx.png\",\n \"displayName\": \"HelloWorld\",\n \"openId\": \"123455\"\n }\n ]\n }\n ]\n}\n调用示例\nJava\n /**\n * 导出用户\n * 第1次调用block设置为0。会返回totalBlock。后面采用循环调用,遍历导出block块里面的用户\n * int totalBlock = exportUserByServer(\"xxxxx\", \"xxxxx\", \"xxxxx\", 0);\n * for (int block = 1; block < totalBlock; block++) {\n * exportUserByServer(\"xxxxx\", \"xxxxx\", \"xxxxx\", block);\n * }\n *\n * @param token access_token, 获取方式见请求参数说明。\n * @param productId 项目ID, 获取方式见请求参数说明。\n * @param clientId 客户端ID,获取方式见请求参数说明。\n * @param block 块号\n * @return 总共的块数\n */\n public static int exportUserByServer(String token, String productId, String clientId, Integer block) {\n HttpPost post = null;\n CloseableHttpClient httpClient = null;\n int totalBlock = 0;\n try {\n /** 新建POST请求 */\n post = new HttpPost(\"https://connect-api.cloud.huawei.com/api/auth-service/v1/server/user:export\");\n\n\n /** 设置Header认证信息 */\n post.setHeader(\"productId\", productId);\n post.setHeader(\"Authorization\", \"Bearer \" + token);\n post.setHeader(\"client_id\", clientId);\n\n\n /** 组装请求Body,使用JSON格式携带查询信息 */\n StringEntity entity = new StringEntity(String.format(\"{\\\"block\\\":%d}\", block), Charset.forName(\"UTF-8\"));\n entity.setContentEncoding(\"UTF-8\");\n entity.setContentType(\"application/json\");\n /** 设置请求Body */\n post.setEntity(entity);\n /** 发送请求 */\n httpClient = HttpClients.createDefault();\n HttpResponse response = httpClient.execute(post);\n /** 处理返回参数 */\n int statusCode = response.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(response.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n JSONArray jsonArr = object.getJSONArray(\"users\");\n for (int i = 0; i < jsonArr.size(); i++) {\n JSONObject jsonObject = jsonArr.getJSONObject(i);\n System.out.println(jsonObject);\n }\n totalBlock = object.getInteger(\"totalBlock\");\n }\n } catch (Exception e) {\n } finally {\n try {\n if (Objects.nonNull(post)) {\n post.releaseConnection();\n }\n if (Objects.nonNull(httpClient)) {\n httpClient.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return totalBlock;\n }\n导入用户\n验证用户凭据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->华为认证服务" + ], + [ + "接口URL", + "https://{domain}/api/auth-service/v1/server/user:export 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section17667171510253" + }, + { + "authenticationBranch": "Service Account方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124" + }, + { + "authenticationBranch": "API客户端方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "block", + "O", + "String", + "当前存储块号。不填默认是0。第1次调用时,block设置为0。服务端会返回totalBlock。后面采用循环调用,遍历导出block块里面的用户。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section16294334331" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "totalBlock", + "M", + "Integer", + "数据存储的总块数。" + ], + [ + "users", + "M", + "String", + "JSONArray字符串,格式为[{\"uid\":\"string\",\"importUid\":\"string\",\"displayName\":\"string\",\"photoUrl\":\"string\",\"email\":\"string\",\"emailVerified\":true,\"phone\":\"string\",\"createTime\":\"string\",\"lastLoginTime\":\"string\",\"status\":0,\"providers\":[{\"provider\":\"string\",\"providerUid\":\"string\",\"photoUrl\":\"string\",\"displayName\":\"string\",\"openId\":\"string\"}]}]" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section17360508366" + } + ], + "title": "导出用户", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture", + "unresolvedRules": [ + "block is labelled String but examples use integer; users and ret response tables say JSON strings while examples use array/object. Both wire shapes are preserved; no conversion is assumed." + ] +} diff --git a/pkg/domain/reference/cloud-auth/export-users.parameters.json b/pkg/domain/reference/cloud-auth/export-users.parameters.json new file mode 100644 index 0000000..b4cbaba --- /dev/null +++ b/pkg/domain/reference/cloud-auth/export-users.parameters.json @@ -0,0 +1,34 @@ +[ + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "in": "header" + }, + { + "name": "block", + "type": "", + "required": false, + "description": "当前存储块号。不填默认是0。第1次调用时,block设置为0。服务端会返回totalBlock。后面采用循环调用,遍历导出block块里面的用户。 Documented String/example integer conflict; accepted without coercion.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section16294334331", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/export-users.rules.json b/pkg/domain/reference/cloud-auth/export-users.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/export-users.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/import-users.json b/pkg/domain/reference/cloud-auth/import-users.json new file mode 100644 index 0000000..e4938b7 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/import-users.json @@ -0,0 +1,418 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section111611358426", + "text": "请求示例\nPOST /api/auth-service/v1/server/user:import\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com\n{\n \"users\": [{\n \"importUid\": \"99038248123456789\",\n \"displayName\": \"HelloWorld\",\n \"photoUrl\": \"https://developer.huawei.com/consumer/xxx.png\",\n \"email\": \"xxxx@huawei.com\",\n \"emailVerified\": true,\n \"phone\": \"+86-18260099999\",\n \"createTime\": \"1627027017000\",\n \"lastLoginTime\": \"1627027017000\",\n \"providers\": [{\n \"provider\": \"4\",\n \"providerUid\": \"9903824860586577777\",\n \"photoUrl\": \"https://weixin.qq.com/xxx.png\",\n \"displayName\": \"HelloWorld\",\n \"openId\": \"123456\"\n }\n ]\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section4608111864818", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n },\n \"importedUsers\": [{\n \"importUid\": \"99038248123456789\",\n \"uid\": \"685584833111393408\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-0000001055443186", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "title": "获取服务端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#ZH-CN_TOPIC_0000002769572687__p256675512208", + "title": "ImportUserUserByServer" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#ZH-CN_TOPIC_0000002769572687__p1990503014243", + "title": "ProviderByServer" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-errorcode-0000001142701050", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686", + "title": "导出用户" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section899515213431", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section1969817010483", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section15408512141113", + "text": "此接口用于将准备好的用户信息导入到认证服务的用户数据中。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section899515213431", + "text": "接口调用者的角色:管理员、APP管理员、开发。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section899515213431", + "text": "接口调用次数限制:20个请求/client_id/秒" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "text": "Service Account方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "text": "API客户端方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "text": "ImportUserUserByServer" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "text": "ProviderByServer" + } + ], + "renderedText": "API参考\n认证服务\nServer\nREST API\n导入用户\n导入用户\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于将准备好的用户信息导入到认证服务的用户数据中。\n\n使用约束\n接口调用者的角色:管理员、APP管理员、开发。\n接口调用次数限制:20个请求/client_id/秒\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为认证服务\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/auth-service/v1/server/user:import\n\n中国站点的domain:connect-api.cloud.huawei.com\n\n德国站点的domain:connect-api-dre.cloud.huawei.com\n\n新加坡站点的domain:connect-api-dra.cloud.huawei.com\n\n俄罗斯站点的domain:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n说明\n\n本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。\n\nService Account方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。\n\nAPI客户端方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nusers\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n第三方的认证信息。\n\nImportUserUserByServer\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nimportUid\n\n\t\n\nM\n\n\t\n\nString(1024)\n\n\t\n\n用户ID,唯一标识。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString(1024)\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString(2048)\n\n\t\n\n头像地址。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString(512)\n\n\t\n\n用户邮箱地址。\n\n第三方的认证信息providers中的providerId为12的时候不能为空。\n\n\n\n\nemailVerified\n\n\t\n\nO\n\n\t\n\nBoolean\n\n\t\n\n邮箱是否需要验证,值为true或者false。\n\n第三方的认证信息providers中的providerId为12的时候不能为空。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString(32)\n\n\t\n\n手机号。格式: +国家码-手机号,示例+86-18260096275。\n\n第三方的认证信息providers中的providerId为11的时候不能为空。\n\n\n\n\ncreateTime\n\n\t\n\nM\n\n\t\n\nString(20)\n\n\t\n\n创建时间,距离1970年1月1日毫秒数。\n\n\n\n\nlastLoginTime\n\n\t\n\nO\n\n\t\n\nString(20)\n\n\t\n\n上次登入时间,距离1970年1月1日的毫秒数。\n\n\n\n\npasswordHash\n\n\t\n\nO\n\n\t\n\nString(8192)\n\n\t\n\n明文密码经过PBKDF2WithSHA256后的结果,迭代次数10000,盐值对应passwordSalt。\n\n\n\n\npasswordSalt\n\n\t\n\nO\n\n\t\n\nString(8192)\n\n\t\n\n密码算法的盐值。\n\n\n\n\nproviders\n\n\t\n\nM\n\n\t\n\nList(32)\n\n\t\n\n第三方的认证信息。\n\nProviderByServer\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证方式类型:\n\n0:匿名账号\n1:华为账号\n2: FACEBOOK*\n3. TWITTER*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:GOOGLE*\n9: GOOGLE_PLAY_GAME*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n18:支付宝账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\nproviderUid\n\n\t\n\nM\n\n\t\n\nString(1024)\n\n\t\n\n用户唯一标识,由三方系统分配。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString(2048)\n\n\t\n\n头像地址。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString(1024)\n\n\t\n\n用户昵称。\n\n\n\n\nopenId\n\n\t\n\nO\n\n\t\n\nString(1024)\n\n\t\n\n发送者唯一标识,例如微信openId。\n\n请求示例\nPOST /api/auth-service/v1/server/user:import\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com\n{\n \"users\": [{\n \"importUid\": \"99038248123456789\",\n \"displayName\": \"HelloWorld\",\n \"photoUrl\": \"https://developer.huawei.com/consumer/xxx.png\",\n \"email\": \"xxxx@huawei.com\",\n \"emailVerified\": true,\n \"phone\": \"+86-18260099999\",\n \"createTime\": \"1627027017000\",\n \"lastLoginTime\": \"1627027017000\",\n \"providers\": [{\n \"provider\": \"4\",\n \"providerUid\": \"9903824860586577777\",\n \"photoUrl\": \"https://weixin.qq.com/xxx.png\",\n \"displayName\": \"HelloWorld\",\n \"openId\": \"123456\"\n }\n ]\n }\n ]\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nM\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n\n\n\nimportedUsers\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\nJSONArray字符串,格式为[{\"importUid\": \"string\", \"uid\": \"string\"}],importUid为入参里面的importUid,uid为认证服务新生成的用户ID。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n },\n \"importedUsers\": [{\n \"importUid\": \"99038248123456789\",\n \"uid\": \"685584833111393408\"\n }\n ]\n}\n调用示例\nJava\n /**\n * 导入用户\n *\n * @param token access_token, 获取方式见请求参数说明。\n * @param productId 项目ID, 获取方式见请求参数说明。\n * @param clientId 客户端ID,获取方式见请求参数说明。\n */\n public static void importUserServer(String token, String productId, String clientId) {\n HttpPost post = null;\n CloseableHttpClient httpClient = null;\n try {\n /** 新建POST请求 */\n post = new HttpPost(\"https://connect-api.cloud.huawei.com/api/auth-service/v1/server/user:import\");\n\n\n /** 设置Header认证信息 */\n post.setHeader(\"productId\", productId);\n post.setHeader(\"client_id\", clientId);\n post.setHeader(\"Authorization\", \"Bearer \" + token);\n\n\n /** 组装请求Body,使用JSON格式携带信息 */\n Map map = new HashMap<>();\n List list = new ArrayList<>();\n ImportUserUserByServer user = buildImportUser();\n list.add(user);\n map.put(\"users\", list);\n\n\n String reqStr = JSON.toJSONString(map);\n StringEntity entity = new StringEntity(reqStr, Charset.forName(\"UTF-8\"));\n entity.setContentEncoding(\"UTF-8\");\n entity.setContentType(\"application/json\");\n /** 设置请求Body */\n post.setEntity(entity);\n /** 发送请求 */\n httpClient = HttpClients.createDefault();\n HttpResponse response = httpClient.execute(post);\n /** 处理返回参数 */\n int statusCode = response.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(response.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n JSONArray jsonArr = object.getJSONArray(\"importedUsers\");\n for (int i = 0; i < jsonArr.size(); i++) {\n JSONObject jsonObject = jsonArr.getJSONObject(i);\n System.out.println(\"uid:\" + jsonObject.getString(\"uid\"));\n System.out.println(\"importUid:\" + jsonObject.getString(\"importUid\"));\n }\n }\n } catch (Exception e) {\n } finally {\n try {\n if (Objects.nonNull(post)) {\n post.releaseConnection();\n }\n if (Objects.nonNull(httpClient)) {\n httpClient.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n\n\n private static ImportUserUserByServer buildImportUser() {\n ImportUserUserByServer importUser = new ImportUserUserByServer();\n /** 如果是从一个项目导出再导入,导出的数据可能没有importUid字段。可以将导出的数据的uid字段设置到importUid里面。 */\n importUser.setImportUid(\"99038248123456789\");\n importUser.setDisplayName(\"HelloWorld\");\n importUser.setPhotoUrl(\"https://developer.huawei.com/consumer/xxx.png\");\n importUser.setEmail(\"xxxx@huawei.com\");\n importUser.setEmailVerified(true);\n importUser.setPhone(\"+86-18260099999\");\n importUser.setCreateTime(String.valueOf(System.currentTimeMillis()));\n importUser.setLastLoginTime(String.valueOf(System.currentTimeMillis()));\n List providers = new ArrayList<>();\n ProviderByServer provider = new ProviderByServer();\n // 需要提前开启认证服务和对应的认证方式。示例代码中的4表示的是微信。\n provider.setProvider(\"4\");\n provider.setProviderUid(\"9903824860586577777\");\n provider.setPhotoUrl(\"https://weixin.qq.com/xxx.png\");\n provider.setDisplayName(\"HelloWorld\");\n provider.setOpenId(\"12345\");\n providers.add(provider);\n importUser.setProviders(providers);\n\n\n return importUser;\n }\nREST API\n导出用户\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->华为认证服务" + ], + [ + "接口URL", + "https://{domain}/api/auth-service/v1/server/user:import 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17667171510253" + }, + { + "authenticationBranch": "Service Account方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169" + }, + { + "authenticationBranch": "API客户端方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "users", + "M", + "List", + "第三方的认证信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "importUid", + "M", + "String(1024)", + "用户ID,唯一标识。" + ], + [ + "displayName", + "O", + "String(1024)", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String(2048)", + "头像地址。" + ], + [ + "email", + "O", + "String(512)", + "用户邮箱地址。 第三方的认证信息providers中的providerId为12的时候不能为空。" + ], + [ + "emailVerified", + "O", + "Boolean", + "邮箱是否需要验证,值为true或者false。 第三方的认证信息providers中的providerId为12的时候不能为空。" + ], + [ + "phone", + "O", + "String(32)", + "手机号。格式: +国家码-手机号,示例+86-18260096275。 第三方的认证信息providers中的providerId为11的时候不能为空。" + ], + [ + "createTime", + "M", + "String(20)", + "创建时间,距离1970年1月1日毫秒数。" + ], + [ + "lastLoginTime", + "O", + "String(20)", + "上次登入时间,距离1970年1月1日的毫秒数。" + ], + [ + "passwordHash", + "O", + "String(8192)", + "明文密码经过PBKDF2WithSHA256后的结果,迭代次数10000,盐值对应passwordSalt。" + ], + [ + "passwordSalt", + "O", + "String(8192)", + "密码算法的盐值。" + ], + [ + "providers", + "M", + "List(32)", + "第三方的认证信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "provider", + "M", + "String", + "认证方式类型: 0:匿名账号 1:华为账号 2: FACEBOOK* 3. TWITTER* 4:微信 5:华为游戏 6:QQ 7:微博 8:GOOGLE* 9: GOOGLE_PLAY_GAME* 10:自建账号 11:手机 12:邮箱 13:苹果账号 18:支付宝账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "providerUid", + "M", + "String(1024)", + "用户唯一标识,由三方系统分配。" + ], + [ + "photoUrl", + "O", + "String(2048)", + "头像地址。" + ], + [ + "displayName", + "O", + "String(1024)", + "用户昵称。" + ], + [ + "openId", + "O", + "String(1024)", + "发送者唯一标识,例如微信openId。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "importedUsers", + "O", + "String", + "JSONArray字符串,格式为[{\"importUid\": \"string\", \"uid\": \"string\"}],importUid为入参里面的importUid,uid为认证服务新生成的用户ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section1787523414439" + } + ], + "title": "导入用户", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/import-users.parameters.json b/pkg/domain/reference/cloud-auth/import-users.parameters.json new file mode 100644 index 0000000..b3c9ba4 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/import-users.parameters.json @@ -0,0 +1,182 @@ +[ + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "in": "header" + }, + { + "name": "users", + "type": "array", + "required": true, + "description": "第三方的认证信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "importUid", + "type": "string", + "required": true, + "description": "用户ID,唯一标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "displayName", + "type": "string", + "required": false, + "description": "用户昵称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "photoUrl", + "type": "string", + "required": false, + "description": "头像地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 2048 + }, + { + "name": "email", + "type": "string", + "required": false, + "description": "用户邮箱地址。 第三方的认证信息providers中的providerId为12的时候不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 512 + }, + { + "name": "emailVerified", + "type": "boolean", + "required": false, + "description": "邮箱是否需要验证,值为true或者false。 第三方的认证信息providers中的providerId为12的时候不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body" + }, + { + "name": "phone", + "type": "string", + "required": false, + "description": "手机号。格式: +国家码-手机号,示例+86-18260096275。 第三方的认证信息providers中的providerId为11的时候不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 32 + }, + { + "name": "createTime", + "type": "string", + "required": true, + "description": "创建时间,距离1970年1月1日毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 20 + }, + { + "name": "lastLoginTime", + "type": "string", + "required": false, + "description": "上次登入时间,距离1970年1月1日的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 20 + }, + { + "name": "passwordHash", + "type": "string", + "required": false, + "description": "明文密码经过PBKDF2WithSHA256后的结果,迭代次数10000,盐值对应passwordSalt。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 8192 + }, + { + "name": "passwordSalt", + "type": "string", + "required": false, + "description": "密码算法的盐值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 8192 + }, + { + "name": "providers", + "type": "array", + "required": true, + "description": "第三方的认证信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "itemsType": "object", + "maxItems": 32, + "itemsProperties": [ + { + "name": "provider", + "type": "string", + "required": true, + "description": "认证方式类型: 0:匿名账号 1:华为账号 2: FACEBOOK* 3. TWITTER* 4:微信 5:华为游戏 6:QQ 7:微博 8:GOOGLE* 9: GOOGLE_PLAY_GAME* 10:自建账号 11:手机 12:邮箱 13:苹果账号 18:支付宝账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body" + }, + { + "name": "providerUid", + "type": "string", + "required": true, + "description": "用户唯一标识,由三方系统分配。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "photoUrl", + "type": "string", + "required": false, + "description": "头像地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 2048 + }, + { + "name": "displayName", + "type": "string", + "required": false, + "description": "用户昵称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "openId", + "type": "string", + "required": false, + "description": "发送者唯一标识,例如微信openId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + } + ] + } + ] + } +] diff --git a/pkg/domain/reference/cloud-auth/import-users.rules.json b/pkg/domain/reference/cloud-auth/import-users.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/import-users.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/link-user.json b/pkg/domain/reference/cloud-auth/link-user.json new file mode 100644 index 0000000..a79e699 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/link-user.json @@ -0,0 +1,338 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section11562577914", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-phone-email\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section10666919296", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"providerUserInfo\": {\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section285341111444", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536", + "title": "修改密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000", + "title": "取消关联" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section626717532077", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section920310282085", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section588516374816", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section448216421586", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section11562577914", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section19490101317917", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section285341111444", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section10666919296", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section825251093", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section626717532077", + "text": "此接口用于用户进行账号关联操作。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n用户关联\n用户关联\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户进行账号关联操作。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-link\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\naccess_token\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方,取值及对应认证方式如下:\n\n0:匿名账号\n1:华为账号\n2:Facebook*\n3:Twitter*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:Google*\n9:Google Play Game*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\ntoken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n手机号码或者邮箱账号。\n\n\n\n\nextraData\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展字段,此处用于账号关联时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。\n\n\n\n\nautoCreateUser\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否自动创建用户,仅用于非托管账号:\n\n1:自动创建,默认为1。\n0:不自动创建。\n\n\n\nuseJwt\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否使用自有账号凭据JWT(Json Web Token):\n\n0:不使用,默认为0。\n1:使用。\n\n\n\nchannelId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。\n\n\n\n\naaId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n应用实例唯一编号。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-phone-email\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n\n\n\nproviderUserInfo\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n关联用户信息。\n\nProviderUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID,具有关联关系的账户共用一个uid。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方标识。\n\n\n\n\nopenId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\n\n\n\nextId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展ID。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"providerUserInfo\": {\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }\n}\n调用示例\nJava\n /**\n * 用户关联\n *\n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param accessToken\n * @param phone 用户账号\n * @return 接口结果\n * @throws IOException 异常\n */\n public static UserLinkRsp userLink(String token, String clientId, String productId, String accessToken, String phone)\n throws IOException {\n UserSigninReq userSigninReq =\n new UserSigninReq()\n .tokenSet(phone)\n// .tokenSet(\"+86-18112345678\")\n .providerSet(11)\n .extraDataSet(\"{\\\"password\\\":\\\"xxxxxxxx\\\"}\")\n .autoCreateUserSet(0);\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-link?productId=\" + productId);\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(userSigninReq), Charset.forName(\"UTF-8\")));\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n httpPost.setHeader(\"access_token\", accessToken);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n UserLinkRsp.class);\n }\n修改密码\n取消关联\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\nProviderUserInfo\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-link 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section920310282085" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section448216421586" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "access_token", + "M", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "provider", + "M", + "integer", + "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "token", + "M", + "String", + "手机号码或者邮箱账号。" + ], + [ + "extraData", + "O", + "String", + "扩展字段,此处用于账号关联时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。" + ], + [ + "autoCreateUser", + "O", + "integer", + "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。" + ], + [ + "useJwt", + "O", + "integer", + "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + ], + [ + "channelId", + "O", + "String", + "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + ], + [ + "aaId", + "O", + "String", + "应用实例唯一编号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "providerUserInfo", + "O", + "list", + "关联用户信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section19490101317917" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID,具有关联关系的账户共用一个uid。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方标识。" + ], + [ + "openId", + "O", + "String", + "第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ], + [ + "extId", + "O", + "String", + "扩展ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section285341111444" + } + ], + "title": "用户关联", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/link-user.parameters.json b/pkg/domain/reference/cloud-auth/link-user.parameters.json new file mode 100644 index 0000000..f432d5b --- /dev/null +++ b/pkg/domain/reference/cloud-auth/link-user.parameters.json @@ -0,0 +1,114 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section448216421586", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于账号关联时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/link-user.rules.json b/pkg/domain/reference/cloud-auth/link-user.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/link-user.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/reauthenticate.json b/pkg/domain/reference/cloud-auth/reauthenticate.json new file mode 100644 index 0000000..bfd2ebd --- /dev/null +++ b/pkg/domain/reference/cloud-auth/reauthenticate.json @@ -0,0 +1,431 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section113351734111511", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-reauthenticate\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section5222124471512", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section157561626184615", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section815913467460", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360", + "title": "注销" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section1648063401410", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section299275312148", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section887120211157", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section13279111311156", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section113351734111511", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section149991238161518", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section157561626184615", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section815913467460", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section5222124471512", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section142410497156", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section1648063401410", + "text": "此接口用于用户进行账号重认证操作。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n账号重认证\n账号重认证\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户进行账号重认证操作。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-reauthenticate\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\naccess_token\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方,取值及对应认证方式如下:\n\n0:匿名账号\n1:华为账号\n2:Facebook*\n3:Twitter*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:Google*\n9:Google Play Game*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\ntoken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n手机号码或者邮箱账号。\n\n\n\n\nextraData\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展字段,此处用于账号重认证时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。\n\n\n\n\nautoCreateUser\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否自动创建用户,仅用于非托管账号:\n\n0:不自动创建。\n1:自动创建,默认为1。\n\n\n\nuseJwt\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否使用自有账号凭据JWT(Json Web Token):\n\n0:不使用,默认为0。\n1:使用。\n\n\n\nchannelId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。\n\n\n\n\naaId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n应用实例唯一编号。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-reauthenticate\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n\n\n\naccessToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nrefreshToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nuserInfo\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n用户信息。\n\n\n\n\nproviders\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n第三方的认证信息。\n\nUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\nimportUid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n导入的用户ID,仅当存在导入用户时有值。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方标识。\n\n\n\n\nemailVerified\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n邮箱验证标示:\n\n0:邮箱未被验证。\n1:邮箱已被验证。\n\n\n\npasswordSetted\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n密码设置标示:\n\n0:未设置密码。\n1:已设置密码。\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\nProviderUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方标识。\n\n\n\n\nopenId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\n\n\n\nextId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展ID。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}\n调用示例\nJava\n /**\n * 账号重认证请求\n * \n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param accessToken\n * @param phone 账号\n * @return 接口结果\n * @throws IOException 异常\n */\n public static UserSignInRsp userReauthenticate(String token, String clientId, String productId, String accessToken, \n String phone) \n throws IOException {\n UserSigninReq userSigninReq =\n new UserSigninReq()\n .tokenSet(phone)\n .providerSet(11)\n .extraDataSet(\"{\\\"password\\\":\\\"xxxxxxxxx\\\"}\")\n .autoCreateUserSet(0);\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-reauthenticate?productId=\" + productId);\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(userSigninReq), Charset.forName(\"UTF-8\")));\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n httpPost.setHeader(\"access_token\", accessToken);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n UserSignInRsp.class);\n }\n注销\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\nUserInfo\nProviderUserInfo\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-reauthenticate 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section299275312148" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section13279111311156" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "access_token", + "M", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "provider", + "M", + "integer", + "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "token", + "M", + "String", + "手机号码或者邮箱账号。" + ], + [ + "extraData", + "O", + "String", + "扩展字段,此处用于账号重认证时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。" + ], + [ + "autoCreateUser", + "O", + "integer", + "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。" + ], + [ + "useJwt", + "O", + "integer", + "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + ], + [ + "channelId", + "O", + "String", + "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + ], + [ + "aaId", + "O", + "String", + "应用实例唯一编号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "accessToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "refreshToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "userInfo", + "O", + "list", + "用户信息。" + ], + [ + "providers", + "O", + "list", + "第三方的认证信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section149991238161518" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "importUid", + "O", + "String", + "导入的用户ID,仅当存在导入用户时有值。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方标识。" + ], + [ + "emailVerified", + "O", + "integer", + "邮箱验证标示: 0:邮箱未被验证。 1:邮箱已被验证。" + ], + [ + "passwordSetted", + "O", + "integer", + "密码设置标示: 0:未设置密码。 1:已设置密码。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section157561626184615" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方标识。" + ], + [ + "openId", + "O", + "String", + "第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ], + [ + "extId", + "O", + "String", + "扩展ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section815913467460" + } + ], + "title": "账号重认证", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/reauthenticate.parameters.json b/pkg/domain/reference/cloud-auth/reauthenticate.parameters.json new file mode 100644 index 0000000..a9aebca --- /dev/null +++ b/pkg/domain/reference/cloud-auth/reauthenticate.parameters.json @@ -0,0 +1,114 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section13279111311156", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于账号重认证时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/reauthenticate.rules.json b/pkg/domain/reference/cloud-auth/reauthenticate.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/reauthenticate.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/register.json b/pkg/domain/reference/cloud-auth/register.json new file mode 100644 index 0000000..a6cabe1 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/register.json @@ -0,0 +1,421 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1738615613269", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-register\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"phone\": \"string\",\n \"email\": \"string\",\n \"verifyCode\": \"string\",\n \"password\": \"string\",\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section12569102322611", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1967861214174", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section164071284365", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "title": "验证码申请" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348", + "title": "用户密码登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section388492742517", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section148016386253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section114414440257", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section3324145832711", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1738615613269", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section3817141172613", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1967861214174", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section164071284365", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section12569102322611", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section2051515473269", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section388492742517", + "text": "此接口用于用户注册。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n用户注册\n用户注册\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户注册。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-register\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号,包括国家码,以“+”开头,例如中国大陆的手机号以“+86”开头。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n电子邮箱。\n\n电子邮箱和手机号码二者必填一个。\n\n\n\n\nverifyCode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n验证码,传入手机号时必填。\n\n\n\n\npassword\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n登录密码。\n\n\n\n\nuseJwt\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否使用自有账号凭据JWT(Json Web Token):\n\n0:不使用,默认为0。\n1:使用。\n\n\n\nchannelId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。\n\n\n\n\naaId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n应用实例唯一编号。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-register\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"phone\": \"string\",\n \"email\": \"string\",\n \"verifyCode\": \"string\",\n \"password\": \"string\",\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}\n\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n\n\n\naccessToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\" },token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nrefreshToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\"},token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nuserInfo\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n用户信息。\n\n\n\n\nproviders\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n第三方的认证信息。\n\nUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\nimportUid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n导入的用户ID,仅当存在导入用户时有值。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n首次认证的第三方标识。\n\n\n\n\nemailVerified\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n邮箱验证标识:\n\n0:邮箱未被验证。\n1:邮箱已被验证。\n\n\n\npasswordSetted\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n密码设置标识:\n\n0:未设置密码。\n1:已设置密码。\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\nProviderUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n首次认证的第三方标识。\n\n\n\n\nopenId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\n\n\n\nextId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展ID。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}\n调用示例\nJava\n /**\n * 注册请求\n * \n * @param token access_token 认证凭据\n * @param clientId 客户端ID \n * @param productId 项目ID\n * @param phone 手机号,格式:“+国家码-18112345678”\n * @param verifyCode 验证码\n * @param password 密码\n * @return 接口结果\n * @throws IOException 异常\n */\n public static UserSignInRsp userRegister(String token, String clientId, String productId, String phone, \n String verifyCode, String password) throws IOException {\n RegisterUserReq registerUserReq = new RegisterUserReq();\n registerUserReq.setPhone(phone);\n registerUserReq.setVerifyCode(verifyCode);\n registerUserReq.setPassword(password);\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-register?productId=\" + productId);\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n\n\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(registerUserReq), Charset.forName(\"UTF-8\")));\n\n\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n UserSignInRsp.class);\n }\n\n验证码申请\n用户密码登录\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\nUserInfo\nProviderUserInfo\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-register 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section148016386253" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section3324145832711" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "phone", + "O", + "String", + "手机号,包括国家码,以“+”开头,例如中国大陆的手机号以“+86”开头。" + ], + [ + "email", + "O", + "String", + "电子邮箱。 电子邮箱和手机号码二者必填一个。" + ], + [ + "verifyCode", + "O", + "String", + "验证码,传入手机号时必填。" + ], + [ + "password", + "O", + "String", + "登录密码。" + ], + [ + "useJwt", + "O", + "integer", + "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + ], + [ + "channelId", + "O", + "String", + "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + ], + [ + "aaId", + "O", + "String", + "应用实例唯一编号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "accessToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\" },token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "refreshToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\"},token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "userInfo", + "O", + "list", + "用户信息。" + ], + [ + "providers", + "O", + "list", + "第三方的认证信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section3817141172613" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "importUid", + "O", + "String", + "导入的用户ID,仅当存在导入用户时有值。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "首次认证的第三方标识。" + ], + [ + "emailVerified", + "O", + "integer", + "邮箱验证标识: 0:邮箱未被验证。 1:邮箱已被验证。" + ], + [ + "passwordSetted", + "O", + "integer", + "密码设置标识: 0:未设置密码。 1:已设置密码。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1967861214174" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "首次认证的第三方标识。" + ], + [ + "openId", + "O", + "String", + "第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ], + [ + "extId", + "O", + "String", + "扩展ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section164071284365" + } + ], + "title": "用户注册", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/register.parameters.json b/pkg/domain/reference/cloud-auth/register.parameters.json new file mode 100644 index 0000000..474f4e6 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/register.parameters.json @@ -0,0 +1,86 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section3324145832711", + "in": "query" + }, + { + "name": "phone", + "type": "string", + "required": false, + "description": "手机号,包括国家码,以“+”开头,例如中国大陆的手机号以“+86”开头。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "email", + "type": "string", + "required": false, + "description": "电子邮箱。 电子邮箱和手机号码二者必填一个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "verifyCode", + "type": "string", + "required": false, + "description": "验证码,传入手机号时必填。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "password", + "type": "string", + "required": false, + "description": "登录密码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/register.rules.json b/pkg/domain/reference/cloud-auth/register.rules.json new file mode 100644 index 0000000..f014720 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/register.rules.json @@ -0,0 +1,24 @@ +[ + { + "id": "account_identity", + "kind": "at_least_one", + "fields": [ + "body.phone", + "body.email" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "message": "Supply a phone or email identity.", + "suggestion": "Provide phone with country code, or email." + }, + { + "id": "phone_verify_code", + "kind": "required_with", + "field": "body.verifyCode", + "fields": [ + "body.phone" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "message": "Phone registration requires verifyCode.", + "suggestion": "Obtain a test verification code before registering." + } +] diff --git a/pkg/domain/reference/cloud-auth/request-code.json b/pkg/domain/reference/cloud-auth/request-code.json new file mode 100644 index 0000000..34e8c83 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/request-code.json @@ -0,0 +1,257 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section283695632417", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/verify-code\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"phone\": \"string\",\n \"email\": \"string\",\n \"action\": 0,\n \"lang\": \"string\",\n \"sendInterval\": 0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section13104133872512", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"shortestInterval\": \"string\",\n \"validityPeriod\": \"string\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-verifycode-langtype-0000002563105507", + "title": "认证服务验证码语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "title": "用户注册" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section1641713619221", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section1279921119235", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section18104123742316", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section228117246513", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section283695632417", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section111502315254", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section13104133872512", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section1787114622614", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section1641713619221", + "text": "此接口用于用户注册、登录或者重置密码时验证码申请。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n验证码申请\n验证码申请\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户注册、登录或者重置密码时验证码申请。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/verify-code\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号。需包含国家码,以“+”开头,国家码和手机号之间以“-”连接,例如中国大陆手机号“+86-150xxxxxxxx”。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n电子邮箱。\n\n电子邮箱和手机号码二者必填一个。\n\n\n\n\naction\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n验证码行为,取值如下:\n\n1001:注册登录时申请验证码。\n1002:重置密码时申请验证码。\n\n\n\nlang\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n语言,格式为“zh_CN”。所有支持的语言类型请参考认证服务验证码语言类型。\n\n\n\n\nsendInterval\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n验证码发送间隔,30s到120s之间。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/verify-code\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"phone\": \"string\",\n \"email\": \"string\",\n \"action\": 0,\n \"lang\": \"string\",\n \"sendInterval\": 0\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n\n\n\nshortestInterval\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n发送下一条验证码最短间隔,单位秒。\n\n\n\n\nvalidityPeriod\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n验证码有效期,单位秒。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"shortestInterval\": \"string\",\n \"validityPeriod\": \"string\"\n}\n\n调用示例\nJava\n /**\n * 验证码申请\n *\n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param action action 验证码行为\n * @param sendInterval 发送间隔30s到120s之间,短于这个间隔不发送下一条验证码\n * @param phoneOrEmail 电子邮箱,与手机号码二选一\n * @return 申请验证码结果\n */\n public static GetVerifyCodeRsp getVerifyCode(String token, String clientId, String productId, Integer action, \n Integer sendInterval, String phoneOrEmail) throws IOException {\n GetVerifyCodeReq getVerifyCodeReq = new GetVerifyCodeReq();\n // 1001注册登录 1002重置密码\n getVerifyCodeReq.setAction(action);\n getVerifyCodeReq.setLang(\"zh_CN\");\n getVerifyCodeReq.setSendInterval(sendInterval);\n getVerifyCodeReq.setPhone(phoneOrEmail);\n // getVerifyCodeReq.setEmail(\"your email\");\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/verify-code?productId=\" + productId);\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(getVerifyCodeReq), Charset.forName(\"UTF-8\")));\n\n\n\n\n HttpResponse response = client.execute(httpPost);;\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n GetVerifyCodeRsp.class);\n }\n\n获取Token\n用户注册\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/verify-code 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section1279921119235" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section228117246513" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "phone", + "O", + "String", + "手机号。需包含国家码,以“+”开头,国家码和手机号之间以“-”连接,例如中国大陆手机号“+86-150xxxxxxxx”。" + ], + [ + "email", + "O", + "String", + "电子邮箱。 电子邮箱和手机号码二者必填一个。" + ], + [ + "action", + "O", + "integer", + "验证码行为,取值如下: 1001:注册登录时申请验证码。 1002:重置密码时申请验证码。" + ], + [ + "lang", + "O", + "String", + "语言,格式为“zh_CN”。所有支持的语言类型请参考认证服务验证码语言类型。" + ], + [ + "sendInterval", + "O", + "integer", + "验证码发送间隔,30s到120s之间。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "shortestInterval", + "O", + "String", + "发送下一条验证码最短间隔,单位秒。" + ], + [ + "validityPeriod", + "O", + "String", + "验证码有效期,单位秒。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section111502315254" + } + ], + "title": "验证码申请", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/request-code.parameters.json b/pkg/domain/reference/cloud-auth/request-code.parameters.json new file mode 100644 index 0000000..046f605 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/request-code.parameters.json @@ -0,0 +1,152 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section228117246513", + "in": "query" + }, + { + "name": "phone", + "type": "string", + "required": false, + "description": "手机号。需包含国家码,以“+”开头,国家码和手机号之间以“-”连接,例如中国大陆手机号“+86-150xxxxxxxx”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body" + }, + { + "name": "email", + "type": "string", + "required": false, + "description": "电子邮箱。 电子邮箱和手机号码二者必填一个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body" + }, + { + "name": "action", + "type": "integer", + "required": false, + "description": "验证码行为,取值如下: 1001:注册登录时申请验证码。 1002:重置密码时申请验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body", + "enum": [ + "1001", + "1002" + ] + }, + { + "name": "lang", + "type": "string", + "required": false, + "description": "语言,格式为“zh_CN”。所有支持的语言类型请参考认证服务验证码语言类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body", + "enum": [ + "am_ET", + "ar_EG", + "as_IN", + "az_AZ", + "be_BY", + "bg_BG", + "bn_BD", + "bo_CN", + "bs_BA", + "ca_ES", + "cs_CZ", + "da_DK", + "de_DE", + "el_GR", + "en_GB", + "en_US", + "es_ES", + "es_US", + "et_EE", + "eu_ES", + "fa_IR", + "fi_FI", + "fr_FR", + "gl_ES", + "gu_IN", + "iw_IL", + "hi_IN", + "hr_HR", + "hu_HU", + "in_ID", + "it_IT", + "ja_JP", + "jv_Latn", + "ka_GE", + "kk_KZ", + "km_KH", + "kn_IN", + "ko_KR", + "lo_LA", + "lt_LT", + "lv_LV", + "mai_IN", + "mi_NZ", + "mk_MK", + "ml_IN", + "mn_MN", + "mr_IN", + "ms_MY", + "my_MM", + "ne_NP", + "nl_NL", + "nb_NO", + "or_IN", + "pa_IN", + "pl_PL", + "pt_BR", + "pt_PT", + "ro_RO", + "ru_RU", + "si_LK", + "sk_SK", + "sl_SI", + "sr_latn", + "sv_SE", + "sw_KE", + "ta_IN", + "te_IN", + "th_TH", + "tl_PH", + "tr_TR", + "my_ZG", + "uk_UA", + "ur_PK", + "uz_UZ", + "vi_VN", + "zh_CN", + "zh_HK", + "zh_TW" + ] + }, + { + "name": "sendInterval", + "type": "integer", + "required": false, + "description": "验证码发送间隔,30s到120s之间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body", + "minimum": 30, + "maximum": 120 + } +] diff --git a/pkg/domain/reference/cloud-auth/request-code.rules.json b/pkg/domain/reference/cloud-auth/request-code.rules.json new file mode 100644 index 0000000..fb26371 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/request-code.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "account_identity", + "kind": "at_least_one", + "fields": [ + "body.phone", + "body.email" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "message": "Supply a phone or email identity.", + "suggestion": "Provide phone with country code, or email." + } +] diff --git a/pkg/domain/reference/cloud-auth/reset-password.json b/pkg/domain/reference/cloud-auth/reset-password.json new file mode 100644 index 0000000..c3899b7 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/reset-password.json @@ -0,0 +1,235 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section09651335237", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/reset-password\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"account\": \"string\",\n \"verifyCode\": \"string\",\n \"password\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section6261749530", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "title": "修改手机号或邮箱地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536", + "title": "修改密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section07571474217", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section79411463318", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section859791418310", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1226971914320", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section09651335237", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1771714415311", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section6261749530", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1424214565314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section07571474217", + "text": "此接口用于用户进行密码重置。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n重置密码\n重置密码\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户进行密码重置。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/reset-password\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方,取值及对应认证方式如下:\n\n0:匿名账号\n1:华为账号\n2:Facebook*\n3:Twitter*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:Google*\n9:Google Play Game*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\naccount\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户手机账号或者邮箱账号。\n\n\n\n\nverifyCode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n验证码。\n\n\n\n\npassword\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n新密码。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/reset-password\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"account\": \"string\",\n \"verifyCode\": \"string\",\n \"password\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}\n调用示例\nJava\n /**\n * 重置密码\n *\n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param phone 账号\n * @return 接口结果\n * @throws IOException 异常\n */\n public static AuthOperateRsp resetPassWord(String token, String clientId, String productId, String phone)\n throws IOException {\n ResetUserPasswordReq req =\n new ResetUserPasswordReq()\n .providerSet(11)\n .accountSet(phone)\n .verifyCodeSet(\"123456\")\n .passwordSet(\"xxxxxxxxxxxxxx\");\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/reset-password?productId=\" + productId);\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(req), Charset.forName(\"UTF-8\")));\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n AuthOperateRsp.class);\n }\n修改手机号或邮箱地址\n修改密码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/reset-password 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section79411463318" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1226971914320" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "account", + "O", + "String", + "用户手机账号或者邮箱账号。" + ], + [ + "verifyCode", + "O", + "String", + "验证码。" + ], + [ + "password", + "O", + "String", + "新密码。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1771714415311" + } + ], + "title": "重置密码", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/reset-password.parameters.json b/pkg/domain/reference/cloud-auth/reset-password.parameters.json new file mode 100644 index 0000000..42b6a0a --- /dev/null +++ b/pkg/domain/reference/cloud-auth/reset-password.parameters.json @@ -0,0 +1,74 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1226971914320", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": false, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "account", + "type": "string", + "required": false, + "description": "用户手机账号或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body" + }, + { + "name": "verifyCode", + "type": "string", + "required": false, + "description": "验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body" + }, + { + "name": "password", + "type": "string", + "required": false, + "description": "新密码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/reset-password.rules.json b/pkg/domain/reference/cloud-auth/reset-password.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/reset-password.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/revoke-token.json b/pkg/domain/reference/cloud-auth/revoke-token.json new file mode 100644 index 0000000..19f186e --- /dev/null +++ b/pkg/domain/reference/cloud-auth/revoke-token.json @@ -0,0 +1,264 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section44511818104915", + "text": "请求示例\nPOST /api/oauth2/third/v1/revoke-token?productId=7364********61998\nContent-Type: application/json\nclient_id: 680************560\nuid: 686203960465306368\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section102104589493", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-0000001055443186", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "title": "获取服务端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271", + "title": "验证用户凭据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-errorcode-0000001142701050", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section899515213431", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section5210132415489", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section31611049134819", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1696945244814", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section44511818104915", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section18647142414917", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section102104589493", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section4733144135016", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section15408512141113", + "text": "此接口用于撤销已经颁发的用户访问凭据。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section899515213431", + "text": "接口调用者的角色:管理员、APP管理员、开发。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section899515213431", + "text": "接口调用次数限制:500个请求/client_id/秒" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "text": "Service Account方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "text": "API客户端方式" + } + ], + "renderedText": "API参考\n认证服务\nServer\nREST API\n撤销用户凭据\n撤销用户凭据\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于撤销已经颁发的用户访问凭据。\n\n使用约束\n接口调用者的角色:管理员、APP管理员、开发。\n接口调用次数限制:500个请求/client_id/秒\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为认证服务\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/oauth2/third/v1/revoke-token?productId={productId}\n\n中国站点的domain:connect-api.cloud.huawei.com\n\n德国站点的domain:connect-api-dre.cloud.huawei.com\n\n新加坡站点的domain:connect-api-dra.cloud.huawei.com\n\n俄罗斯站点的domain:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n说明\n\n本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。\n\nService Account方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nuid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n待撤销凭据的用户。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。\n\nAPI客户端方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nuid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n待撤销凭据的用户。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n请求示例\nPOST /api/oauth2/third/v1/revoke-token?productId=7364********61998\nContent-Type: application/json\nclient_id: 680************560\nuid: 686203960465306368\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nM\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n }\n}\n调用示例\nJava\n /**\n * 撤销用户凭据\n *\n * @param productId 项目ID\n * @param uid 待撤销的token的用户ID\n * @param client_id clientID\n * @param clientToken clientToken\n */\n public static void revokeTokenServer(String productId, String uid, String client_id, String clientToken) {\n HttpPost post = null;\n CloseableHttpClient httpClient = null;\n try {\n /** 新建POST请求 */\n post = new HttpPost(\n \"https://connect-api.cloud.huawei.com/api/oauth2/third/v1/revoke-token?productId=\" + productId);\n\n\n /** 设置Header认证信息 */\n post.setHeader(\"uid\", uid);\n post.setHeader(\"client_id\", client_id);\n post.setHeader(\"Authorization\", \"Bearer \" + clientToken);\n /** 发送请求 */\n httpClient = HttpClients.createDefault();\n HttpResponse response = httpClient.execute(post);\n /** 处理返回参数 */\n int statusCode = response.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(response.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n String retCode = object.getJSONObject(\"ret\").getString(\"code\");\n System.out.println(retCode);\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (Objects.nonNull(post)) {\n post.releaseConnection();\n }\n if (Objects.nonNull(httpClient)) {\n httpClient.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n验证用户凭据\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nQuery\nHeader\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->华为认证服务" + ], + [ + "接口URL", + "https://{domain}/api/oauth2/third/v1/revoke-token?productId={productId} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section5210132415489" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1696945244814" + }, + { + "authenticationBranch": "Service Account方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "uid", + "M", + "String", + "待撤销凭据的用户。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019" + }, + { + "authenticationBranch": "API客户端方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "uid", + "M", + "String", + "待撤销凭据的用户。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section18647142414917" + } + ], + "title": "撤销用户凭据", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/revoke-token.parameters.json b/pkg/domain/reference/cloud-auth/revoke-token.parameters.json new file mode 100644 index 0000000..d679e15 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/revoke-token.parameters.json @@ -0,0 +1,34 @@ +[ + { + "name": "uid", + "type": "string", + "required": true, + "description": "待撤销凭据的用户。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1696945244814", + "in": "query" + } +] diff --git a/pkg/domain/reference/cloud-auth/revoke-token.rules.json b/pkg/domain/reference/cloud-auth/revoke-token.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/revoke-token.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/sign-in-code.json b/pkg/domain/reference/cloud-auth/sign-in-code.json new file mode 100644 index 0000000..9246456 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-in-code.json @@ -0,0 +1,421 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1174315565594", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-signin\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section15111121420017", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section193711249339", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section457718379333", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348", + "title": "用户密码登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "title": "修改手机号或邮箱地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section6320141155910", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section579902013599", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section114719318593", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section11159123655916", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1174315565594", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section148791851104", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section193711249339", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section457718379333", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section15111121420017", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section206153224018", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section6320141155910", + "text": "此接口用于用户使用验证码登录。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n用户验证码登录\n用户验证码登录\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户使用验证码登录。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方,取值及对应认证方式如下:\n\n0:匿名账号\n1:华为账号\n2:Facebook*\n3:Twitter*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:Google*\n9:Google Play Game*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\ntoken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n手机号码或者邮箱账号。\n\n\n\n\nextraData\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展字段,此处用于验证码登录时填写验证码,填写样例如 {\\\"verifyCode\\\":\\\"123456\\\"}。\n\n\n\n\nautoCreateUser\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否自动创建用户,仅用于非托管账号:\n\n1:自动创建,默认为1。\n0:不自动创建。\n\n\n\nuseJwt\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否使用自有账号凭据JWT(Json Web Token):\n\n0:不使用,默认为0。\n1:使用。\n\n\n\nchannelId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。\n\n\n\n\naaId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n应用实例唯一编号。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-signin\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n\n\n\naccessToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nrefreshToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\"},token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nuserInfo\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n用户信息。\n\n\n\n\nproviders\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n第三方的认证信息。\n\nUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\nimportUid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n导入的用户ID,仅当存在导入用户时有值。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方标识。\n\n\n\n\nemailVerified\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n邮箱验证标识:\n\n0:邮箱未被验证。\n1:邮箱已被验证。\n\n\n\npasswordSetted\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n密码设置标识:\n\n0:未设置密码。\n1:已设置密码。\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\nProviderUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方标识。\n\n\n\n\nopenId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\n\n\n\nextId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展ID。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}\n调用示例\nJava\n /**\n * 验证码登录请求\n *\n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param phoneOrEmail 登录手机号或邮箱\n * @return 接口结果\n * @throws IOException 异常\n */\n public static UserSignInRsp userSignInByVerifyCode(String token, String clientId, String productId,\n String phoneOrEmail) throws IOException {\n UserSigninReq userSigninReq =\n new UserSigninReq()\n .tokenSet(phoneOrEmail)\n .providerSet(11)\n .extraDataSet(\"{\\\"verifyCode\\\":\\\"123456\\\"}\")\n .autoCreateUserSet(0);\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin?productId=\" + productId);\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(userSigninReq), Charset.forName(\"UTF-8\")));\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n UserSignInRsp.class);\n }\n用户密码登录\n修改手机号或邮箱地址\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\nUserInfo\nProviderUserInfo\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section579902013599" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section11159123655916" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "provider", + "M", + "integer", + "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "token", + "M", + "String", + "手机号码或者邮箱账号。" + ], + [ + "extraData", + "O", + "String", + "扩展字段,此处用于验证码登录时填写验证码,填写样例如 {\\\"verifyCode\\\":\\\"123456\\\"}。" + ], + [ + "autoCreateUser", + "O", + "integer", + "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。" + ], + [ + "useJwt", + "O", + "integer", + "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + ], + [ + "channelId", + "O", + "String", + "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + ], + [ + "aaId", + "O", + "String", + "应用实例唯一编号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "accessToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "refreshToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\"},token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "userInfo", + "O", + "list", + "用户信息。" + ], + [ + "providers", + "O", + "list", + "第三方的认证信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section148791851104" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "importUid", + "O", + "String", + "导入的用户ID,仅当存在导入用户时有值。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方标识。" + ], + [ + "emailVerified", + "O", + "integer", + "邮箱验证标识: 0:邮箱未被验证。 1:邮箱已被验证。" + ], + [ + "passwordSetted", + "O", + "integer", + "密码设置标识: 0:未设置密码。 1:已设置密码。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section193711249339" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方标识。" + ], + [ + "openId", + "O", + "String", + "第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ], + [ + "extId", + "O", + "String", + "扩展ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section457718379333" + } + ], + "title": "用户验证码登录", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/sign-in-code.parameters.json b/pkg/domain/reference/cloud-auth/sign-in-code.parameters.json new file mode 100644 index 0000000..68c2271 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-in-code.parameters.json @@ -0,0 +1,106 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section11159123655916", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于验证码登录时填写验证码,填写样例如 {\\\"verifyCode\\\":\\\"123456\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/sign-in-code.rules.json b/pkg/domain/reference/cloud-auth/sign-in-code.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-in-code.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/sign-in-password.json b/pkg/domain/reference/cloud-auth/sign-in-password.json new file mode 100644 index 0000000..f46593f --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-in-password.json @@ -0,0 +1,421 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1540915720557", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-signin\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section17594122985616", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section13771971245", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section13380827172417", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "title": "用户注册" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685", + "title": "用户验证码登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section101905229559", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section2953936165511", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section2650544185517", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section8252421578", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1540915720557", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section13771971245", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section13380827172417", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section17594122985616", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section46891363565", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section101905229559", + "text": "此接口用于用户使用密码登录。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n用户密码登录\n用户密码登录\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户使用密码登录。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方,取值及对应认证方式如下:\n\n0:匿名账号\n1:华为账号\n2:Facebook*\n3:Twitter*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:Google*\n9:Google Play Game*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\ntoken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n手机号码或者邮箱账号。\n\n\n\n\nextraData\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。\n\n\n\n\nautoCreateUser\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否自动创建用户,仅用于非托管账号:\n\n0:不自动创建。\n1:自动创建,默认为1。\n\n\n\nuseJwt\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否使用自有账号凭据JWT(Json Web Token):\n\n0:不使用,默认为0。\n1:使用。\n\n\n\nchannelId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。\n\n\n\n\naaId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n应用实例唯一编号。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-signin\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 0,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}\n\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n\n\n\naccessToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\" },token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nrefreshToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\"},token为用户凭据,validPeriod为token有效时长,单位为秒。\n\n\n\n\nuserInfo\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n用户信息。\n\n\n\n\nproviders\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n第三方的认证信息。\n\nUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\nimportUid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n导入的用户ID,仅当存在导入用户时有值。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n首次认证的第三方标识。\n\n\n\n\nemailVerified\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n邮箱验证标识:\n\n0:邮箱未被验证。\n1:邮箱已被验证。\n\n\n\npasswordSetted\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n密码设置标识:\n\n0:未设置密码。\n1:已设置密码。\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\nProviderUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方标识。\n\n\n\n\nopenId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\n\n\n\nextId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展ID。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}\n调用示例\nJava\n /**\n * 登录请求\n * \n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param phoneOrEmail 登录手机号或邮箱\n * @return 接口结果\n * @throws IOException 异常\n */\n public static UserSignInRsp userSignInByPassWord(String token, String clientId, String productId, String phoneOrEmail)\n throws IOException {\n UserSigninReq userSigninReq =\n new UserSigninReq()\n .tokenSet(phoneOrEmail)\n .providerSet(11)\n .extraDataSet(\"{\\\"password\\\":\\\"xxxxxxxxx\\\"}\")\n .autoCreateUserSet(0);\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin?productId=\" + productId);\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(userSigninReq), Charset.forName(\"UTF-8\")));\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n UserSignInRsp.class);\n }\n用户注册\n用户验证码登录\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\nUserInfo\nProviderUserInfo\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section2953936165511" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section8252421578" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "provider", + "M", + "integer", + "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "token", + "M", + "String", + "手机号码或者邮箱账号。" + ], + [ + "extraData", + "O", + "String", + "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。" + ], + [ + "autoCreateUser", + "O", + "integer", + "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。" + ], + [ + "useJwt", + "O", + "integer", + "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。" + ], + [ + "channelId", + "O", + "String", + "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + ], + [ + "aaId", + "O", + "String", + "应用实例唯一编号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "accessToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\" },token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "refreshToken", + "O", + "String(100)", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": \"string\"},token为用户凭据,validPeriod为token有效时长,单位为秒。" + ], + [ + "userInfo", + "O", + "list", + "用户信息。" + ], + [ + "providers", + "O", + "list", + "第三方的认证信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "importUid", + "O", + "String", + "导入的用户ID,仅当存在导入用户时有值。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "首次认证的第三方标识。" + ], + [ + "emailVerified", + "O", + "integer", + "邮箱验证标识: 0:邮箱未被验证。 1:邮箱已被验证。" + ], + [ + "passwordSetted", + "O", + "integer", + "密码设置标识: 0:未设置密码。 1:已设置密码。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section13771971245" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方标识。" + ], + [ + "openId", + "O", + "String", + "第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ], + [ + "extId", + "O", + "String", + "扩展ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section13380827172417" + } + ], + "title": "用户密码登录", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/sign-in-password.parameters.json b/pkg/domain/reference/cloud-auth/sign-in-password.parameters.json new file mode 100644 index 0000000..ff79992 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-in-password.parameters.json @@ -0,0 +1,106 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section8252421578", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/sign-in-password.rules.json b/pkg/domain/reference/cloud-auth/sign-in-password.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-in-password.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/sign-out.json b/pkg/domain/reference/cloud-auth/sign-out.json new file mode 100644 index 0000000..eb2970d --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-out.json @@ -0,0 +1,227 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section74111224123", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-signout\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"refreshToken\": \"string\",\n \"accessToken\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section16969432171213", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000", + "title": "取消关联" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360", + "title": "注销" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section78501922161111", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section473164181114", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section105618509118", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section664965521111", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section74111224123", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section341152761217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section16969432171213", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section255353841214", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section78501922161111", + "text": "此接口用于用户进行登出操作。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n登出\n登出\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户进行登出操作。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signout\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nrefreshToken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n用于刷新accessToken。当accessToken过期后,需要使用refreshToken去获取新的accessToken。\n\n\n\n\naccessToken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-signout\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nHost: connect-drcn.dbankcloud.cn\n{\n \"refreshToken\": \"string\",\n \"accessToken\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}\n调用示例\nJava\n /**\n * \n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @return 接口结果\n * @throws IOException 异常\n */\n public static AuthOperateRsp signOut(String token, String clientId, String productId) throws IOException {\n UserSignoutReq req =\n new UserSignoutReq()\n .accessTokenSet(\"\")\n .refreshTokenSet(\"\");\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signout?productId=\" + productId);\n\n\n httpPost.setEntity(new StringEntity(JSON.toJSONString(req), Charset.forName(\"UTF-8\")));\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n AuthOperateRsp.class);\n }\n取消关联\n注销\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signout 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section473164181114" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section664965521111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "refreshToken", + "M", + "String", + "用于刷新accessToken。当accessToken过期后,需要使用refreshToken去获取新的accessToken。" + ], + [ + "accessToken", + "M", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section341152761217" + } + ], + "title": "登出", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/sign-out.parameters.json b/pkg/domain/reference/cloud-auth/sign-out.parameters.json new file mode 100644 index 0000000..d3b0438 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-out.parameters.json @@ -0,0 +1,42 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section664965521111", + "in": "query" + }, + { + "name": "refreshToken", + "type": "string", + "required": true, + "description": "用于刷新accessToken。当accessToken过期后,需要使用refreshToken去获取新的accessToken。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217", + "in": "body" + }, + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/sign-out.rules.json b/pkg/domain/reference/cloud-auth/sign-out.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/sign-out.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/unlink-user.json b/pkg/domain/reference/cloud-auth/unlink-user.json new file mode 100644 index 0000000..3fcfa7d --- /dev/null +++ b/pkg/domain/reference/cloud-auth/unlink-user.json @@ -0,0 +1,210 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section428984951019", + "text": "请求示例\nPOST /agc/apigw/oauth2/third/v1/user-unlink\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section85864061120", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381", + "title": "用户关联" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113", + "title": "登出" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section12806940893", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section99614119109", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section988292181015", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section428984951019", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section2803125411101", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section85864061120", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section69933641115", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section12806940893", + "text": "此接口用于用户取消账号关联。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n取消关联\n取消关联\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户取消账号关联。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-unlink\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nprovider\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n需要取消关联的provider认证方式。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\naccess_token\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。\n\n请求示例\nPOST /agc/apigw/oauth2/third/v1/user-unlink\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}\n调用示例\nJava\n /**\n *\n *\n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param accessToken\n * @param provider 账号授权提供方\n * @return 接口结果\n * @throws IOException 异常\n */\n public static AuthOperateRsp userUnLink(String token, String clientId, String productId, String accessToken,\n int provider) throws IOException {\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPost httpPost = new HttpPost(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-unlink?productId=\" + productId + \"&provider=\" + provider);\n\n\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPost.setHeader(\"client_id\", clientId);\n httpPost.setHeader(\"Authorization\", \"Bearer \" + token);\n httpPost.setHeader(\"access_token\", accessToken);\n\n\n HttpResponse response = client.execute(httpPost);\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n AuthOperateRsp.class);\n }\n用户关联\n登出\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-unlink 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section99614119109" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "provider", + "M", + "integer", + "需要取消关联的provider认证方式。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "access_token", + "M", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section2803125411101" + } + ], + "title": "取消关联", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/unlink-user.parameters.json b/pkg/domain/reference/cloud-auth/unlink-user.parameters.json new file mode 100644 index 0000000..5133f3e --- /dev/null +++ b/pkg/domain/reference/cloud-auth/unlink-user.parameters.json @@ -0,0 +1,58 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "需要取消关联的provider认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015", + "in": "query", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + } +] diff --git a/pkg/domain/reference/cloud-auth/unlink-user.rules.json b/pkg/domain/reference/cloud-auth/unlink-user.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/unlink-user.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/update-account.json b/pkg/domain/reference/cloud-auth/update-account.json new file mode 100644 index 0000000..46c305f --- /dev/null +++ b/pkg/domain/reference/cloud-auth/update-account.json @@ -0,0 +1,245 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section198301541416", + "text": "请求示例\nPUT /agc/apigw/oauth2/third/v1/user-phone-email\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n{\n \"lang\": \"string\",\n \"newPhone\": \"string\",\n \"newEmail\": \"string\",\n \"newVerifyCode\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section15776281927", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685", + "title": "用户验证码登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500", + "title": "重置密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1855181220116", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section24541218119", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section176544275112", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1454420327110", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section198301541416", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section203741521128", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section15776281927", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1251810241823", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1855181220116", + "text": "此接口用于用户修改手机号码或者邮箱地址。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n修改手机号或邮箱地址\n修改手机号或邮箱地址\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户修改手机号码或者邮箱地址。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS PUT\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-phone-email\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\naccess_token\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nlang\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n语言,格式为“zh_CN”。\n\n\n\n\nnewPhone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n新手机号。\n\n\n\n\nnewEmail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n新邮箱地址。\n\n新邮箱地址和新手机号必填一个且只能填一个,即一次只修改手机号或者只修改邮箱地址。\n\n\n\n\nnewVerifyCode\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n新验证码。\n\n请求示例\nPUT /agc/apigw/oauth2/third/v1/user-phone-email\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n{\n \"lang\": \"string\",\n \"newPhone\": \"string\",\n \"newEmail\": \"string\",\n \"newVerifyCode\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}\n调用示例\nJava\n /**\n * 修改手机号\n *\n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param accessToken\n * @param newPhone 新手机号\n * @return 接口结果\n * @throws IOException 异常\n */\n public static AuthOperateRsp modifyPhoneOrEmail(String token, String clientId, String productId, String accessToken,\n String newPhone) throws IOException {\n UpdateUserPhoneEmailReq req =\n new UpdateUserPhoneEmailReq()\n .newPhoneSet(newPhone)\n .newVerifyCodeSet(\"123456\")\n// .newEmailSet(\"when modify email\")\n .langSet(\"zh_CN\");\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPut httpPut = new HttpPut(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-phone-email?productId=\" + productId);\n\n\n httpPut.setEntity(new StringEntity(JSON.toJSONString(req), Charset.forName(\"UTF-8\")));\n\n\n httpPut.setHeader(\"Accept\", \"application/json\");\n httpPut.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPut.setHeader(\"client_id\", clientId);\n httpPut.setHeader(\"Authorization\", \"Bearer \" + token);\n httpPut.setHeader(\"access_token\", accessToken);\n\n\n HttpResponse response = client.execute(httpPut);\n\n\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n AuthOperateRsp.class);\n }\n用户验证码登录\n重置密码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-phone-email 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section24541218119" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1454420327110" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "access_token", + "M", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "lang", + "O", + "String", + "语言,格式为“zh_CN”。" + ], + [ + "newPhone", + "O", + "String", + "新手机号。" + ], + [ + "newEmail", + "O", + "String", + "新邮箱地址。 新邮箱地址和新手机号必填一个且只能填一个,即一次只修改手机号或者只修改邮箱地址。" + ], + [ + "newVerifyCode", + "M", + "String", + "新验证码。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section203741521128" + } + ], + "title": "修改手机号或邮箱地址", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/update-account.parameters.json b/pkg/domain/reference/cloud-auth/update-account.parameters.json new file mode 100644 index 0000000..ac73eb0 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/update-account.parameters.json @@ -0,0 +1,66 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1454420327110", + "in": "query" + }, + { + "name": "lang", + "type": "string", + "required": false, + "description": "语言,格式为“zh_CN”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + }, + { + "name": "newPhone", + "type": "string", + "required": false, + "description": "新手机号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + }, + { + "name": "newEmail", + "type": "string", + "required": false, + "description": "新邮箱地址。 新邮箱地址和新手机号必填一个且只能填一个,即一次只修改手机号或者只修改邮箱地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + }, + { + "name": "newVerifyCode", + "type": "string", + "required": true, + "description": "新验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/update-account.rules.json b/pkg/domain/reference/cloud-auth/update-account.rules.json new file mode 100644 index 0000000..69a4f9d --- /dev/null +++ b/pkg/domain/reference/cloud-auth/update-account.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "new_identity", + "kind": "at_least_one", + "fields": [ + "body.newPhone", + "body.newEmail" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "message": "Supply a new phone or email.", + "suggestion": "Specify newPhone or newEmail and its verification code." + } +] diff --git a/pkg/domain/reference/cloud-auth/update-password.json b/pkg/domain/reference/cloud-auth/update-password.json new file mode 100644 index 0000000..6e41d47 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/update-password.json @@ -0,0 +1,239 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section7827135610617", + "text": "请求示例\nPUT /agc/apigw/oauth2/third/v1/user-phone-email\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"verifyCode\": \"string\",\n \"newPassword\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section858013913720", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section141867136564", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500", + "title": "重置密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381", + "title": "用户关联" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section9501727242", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section79481932656", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section1699616391955", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section790812451959", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section7827135610617", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section1010020317720", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section858013913720", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section2107161611718", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section9501727242", + "text": "此接口用于用户进行密码修改。" + } + ], + "renderedText": "API参考\n认证服务\nREST API\n修改密码\n修改密码\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于用户进行密码修改。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS PUT\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-password\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\naccess_token\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方,取值及对应认证方式如下:\n\n0:匿名账号\n1:华为账号\n2:Facebook*\n3:Twitter*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:Google*\n9:Google Play Game*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\nverifyCode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n验证码。\n\n\n\n\nnewPassword\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n新密码。\n\n请求示例\nPUT /agc/apigw/oauth2/third/v1/user-phone-email\nContent-Type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\naccess_token: eyJhbGciOiJIUzU****************\nHost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"verifyCode\": \"string\",\n \"newPassword\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}\n调用示例\nJava\n /**\n * 修改密码\n *\n * @param token access_token 认证凭据\n * @param clientId 客户端ID\n * @param productId 项目ID\n * @param accessToken\n * @return 接口结果\n * @throws IOException 异常\n */\n public static AuthOperateRsp userPassword(String token, String clientId, String productId, String accessToken)\n throws IOException {\n UpdateUserPasswordReq req =\n new UpdateUserPasswordReq()\n .providerSet(11)\n .verifyCodeSet(\"123456\")\n .newPasswordSet(\"xxxxxxxx\");\n\n\n HttpClient client = HttpClients.createDefault();\n\n\n HttpPut httpPut = new HttpPut(\"https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-password?productId=\" + productId);\n\n\n httpPut.setEntity(new StringEntity(JSON.toJSONString(req), Charset.forName(\"UTF-8\")));\n\n\n httpPut.setHeader(\"Accept\", \"application/json\");\n httpPut.setHeader(\"Content-Type\", \"application/json;charset=utf-8\");\n httpPut.setHeader(\"client_id\", clientId);\n httpPut.setHeader(\"Authorization\", \"Bearer \" + token);\n httpPut.setHeader(\"access_token\", accessToken);\n\n\n HttpResponse response = client.execute(httpPut);\n\n\n return JSON.parseObject(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8),\n AuthOperateRsp.class);\n }\n重置密码\n用户关联\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-password 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-drcn.dbankcloud.cn”,则调用获取Token接口必须使用“https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section79481932656" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section790812451959" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "access_token", + "M", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "provider", + "O", + "integer", + "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "verifyCode", + "O", + "String", + "验证码。" + ], + [ + "newPassword", + "M", + "String", + "新密码。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section1010020317720" + } + ], + "title": "修改密码", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/update-password.parameters.json b/pkg/domain/reference/cloud-auth/update-password.parameters.json new file mode 100644 index 0000000..676728a --- /dev/null +++ b/pkg/domain/reference/cloud-auth/update-password.parameters.json @@ -0,0 +1,74 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section790812451959", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": false, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "verifyCode", + "type": "string", + "required": false, + "description": "验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "in": "body" + }, + { + "name": "newPassword", + "type": "string", + "required": true, + "description": "新密码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "in": "body" + } +] diff --git a/pkg/domain/reference/cloud-auth/update-password.rules.json b/pkg/domain/reference/cloud-auth/update-password.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/update-password.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/cloud-auth/verify-token.json b/pkg/domain/reference/cloud-auth/verify-token.json new file mode 100644 index 0000000..3763e24 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/verify-token.json @@ -0,0 +1,282 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section111611358426", + "text": "请求示例\nGET /api/oauth2/third/v1/verify-token?productId=7364********61998\nContent-Type: application/json\nclient_id: 680************560\naccessToken: eyJhbGciOi***KBC3JSnGx\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section4608111864818", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n },\n \"productId\": \"7364******98\",\n \"accessToken\": {\n \"token\": \"eyJhbGciOiJQUzI1NiIsImtpZCI6Ijhw******EF-8C2xT0VHwASTcPKgtcKBC3JSnGx\",\n \"validPeriod\": 3553\n },\n \"uid\": \"686203960465306368\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-0000001055443186", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "title": "获取服务端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686", + "title": "导出用户" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193", + "title": "撤销用户凭据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section899515213431", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section29031245171214", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1969817010483", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section15408512141113", + "text": "此接口用于验证已经颁发的用户凭据并且检查用户凭据是否已经撤销。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section899515213431", + "text": "接口调用者的角色:管理员、APP管理员、开发。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section899515213431", + "text": "接口调用次数限制:500个请求/client_id/秒" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "text": "Service Account方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "text": "API客户端方式" + } + ], + "renderedText": "API参考\n认证服务\nServer\nREST API\n验证用户凭据\n验证用户凭据\n更新时间: 2026-10-22 11:25\n功能介绍\n\n此接口用于验证已经颁发的用户凭据并且检查用户凭据是否已经撤销。\n\n使用约束\n接口调用者的角色:管理员、APP管理员、开发。\n接口调用次数限制:500个请求/client_id/秒\n接口原型\n\n承载协议\n\n\t\n\nHTTPS GET\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为认证服务\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/oauth2/third/v1/verify-token?productId={productId}\n\n中国站点的domain:connect-api.cloud.huawei.com\n\n德国站点的domain:connect-api-dre.cloud.huawei.com\n\n新加坡站点的domain:connect-api-dra.cloud.huawei.com\n\n俄罗斯站点的domain:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n说明\n\n本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端API授权。\n\nService Account方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\naccessToken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n用户凭据。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。\n\nAPI客户端方式\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\naccessToken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n用户凭据。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n请求示例\nGET /api/oauth2/third/v1/verify-token?productId=7364********61998\nContent-Type: application/json\nclient_id: 680************560\naccessToken: eyJhbGciOi***KBC3JSnGx\nAuthorization: Bearer ***\nHost: connect-api.cloud.huawei.com\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nM\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n项目ID。\n\n\n\n\naccessToken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nJSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长。单位为秒。\n\n\n\n\nuid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n用户ID,唯一标识。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n },\n \"productId\": \"7364******98\",\n \"accessToken\": {\n \"token\": \"eyJhbGciOiJQUzI1NiIsImtpZCI6Ijhw******EF-8C2xT0VHwASTcPKgtcKBC3JSnGx\",\n \"validPeriod\": 3553\n },\n \"uid\": \"686203960465306368\"\n}\n调用示例\nJava\n /**\n * 通过华为认证服务进行验证用户凭据是否有效\n *\n * @param client_id clientId\n * @param clientToken clientToken\n * @param accessToken 用户凭据\n * @param productId 项目ID\n * @return uid\n */\n public static String verifyTokenServer(String clientId, String clientToken, String accessToken, String productId) {\n HttpGet get =\n new HttpGet(\"https://connect-api.cloud.huawei.com/api/oauth2/third/v1/verify-token?productId=\" + productId);\n CloseableHttpClient httpClient = HttpClients.createDefault();\n get.setHeader(\"client_id\", clientId);\n get.setHeader(\"accessToken\", accessToken);\n get.setHeader(\"Authorization\", \"Bearer \" + clientToken);\n try {\n\n\n CloseableHttpResponse httpResponse = httpClient.execute(get);\n int statusCode = httpResponse.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n\n\n JSONObject object = JSON.parseObject(result);\n return object.getString(\"uid\");\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (Objects.nonNull(get)) {\n get.releaseConnection();\n }\n if (Objects.nonNull(httpClient)) {\n httpClient.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n return null;\n }\n导出用户\n撤销用户凭据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nQuery\nHeader\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->华为认证服务" + ], + [ + "接口URL", + "https://{domain}/api/oauth2/third/v1/verify-token?productId={productId} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section17667171510253" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section29031245171214" + }, + { + "authenticationBranch": "Service Account方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "accessToken", + "M", + "String", + "用户凭据。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124" + }, + { + "authenticationBranch": "API客户端方式", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "accessToken", + "M", + "String", + "用户凭据。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "productId", + "M", + "Integer", + "项目ID。" + ], + [ + "accessToken", + "M", + "String", + "JSON字符串,格式为{\"token\": \"string\", \"validPeriod\": xxx },token为用户凭据,validPeriod为token有效时长。单位为秒。" + ], + [ + "uid", + "M", + "String", + "用户ID,唯一标识。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1787523414439" + } + ], + "title": "验证用户凭据", + "updatedAt": "2026-10-22 11:25", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/cloud-auth/verify-token.parameters.json b/pkg/domain/reference/cloud-auth/verify-token.parameters.json new file mode 100644 index 0000000..78616c3 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/verify-token.parameters.json @@ -0,0 +1,34 @@ +[ + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "用户凭据。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section29031245171214", + "in": "query" + } +] diff --git a/pkg/domain/reference/cloud-auth/verify-token.rules.json b/pkg/domain/reference/cloud-auth/verify-token.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/cloud-auth/verify-token.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/clouddb/client-token.json b/pkg/domain/reference/clouddb/client-token.json new file mode 100644 index 0000000..c95f8c1 --- /dev/null +++ b/pkg/domain/reference/clouddb/client-token.json @@ -0,0 +1,241 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "title": "用户登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section125771341635", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section125771341635", + "text": "在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "请求参数以JSON格式传入,包含参数如下。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "请求示例" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "POST /agc/apigw/oauth2/v1/token Host: connect-drcn.dbankcloud.cn Content-Type: application/json { \"useJwt\":\"1\", \"grant_type\":\"client_credentials\", \"client_id\":\"26********20\", \"client_secret\":\"************************\" }" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "POST /agc/apigw/oauth2/v1/token" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "Host: connect-drcn.dbankcloud.cn" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "Content-Type: application/json" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "{" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "\"useJwt\":\"1\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "\"grant_type\":\"client_credentials\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "\"client_id\":\"26********20\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "\"client_secret\":\"************************\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "text": "}" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "text": "返回值为JSON格式的字符串,包含参数如下。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "text": "响应示例" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "text": "HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { \"access_token\": \"eyJhbGciOiJIUzU****************\", \"expires_in\": 172800 }" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "text": "HTTP/1.1 200 OK" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "text": "Content-Type: application/json; charset=utf-8" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "text": "\"access_token\": \"eyJhbGciOiJIUzU****************\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp", + "text": "\"expires_in\": 172800" + } + ], + "renderedText": "API参考\n云数据库 for Object\nREST API\n获取Token\n获取Token\n更新时间: 2026-10-22 11:41\n功能介绍\n\n在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\n\n请求参数以JSON格式传入,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nuseJwt\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n使用账号凭据JWT(Json Web Token),固定传入“1”。\n\n\n\n\ngrant_type\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n固定传入“client_credentials”。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,即获取客户端API授权中的“Client ID”。\n\n\n\n\nclient_secret\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端密钥,即获取客户端API授权中的“Client Secret”。\n\n请求示例\n\nPOST /agc/apigw/oauth2/v1/token\nHost: connect-drcn.dbankcloud.cn\nContent-Type: application/json\n{\n \"useJwt\":\"1\",\n \"grant_type\":\"client_credentials\",\n \"client_id\":\"26********20\",\n \"client_secret\":\"************************\"\n}\n响应参数\n\n返回值为JSON格式的字符串,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\naccess_token\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n认证Token,用于API接口调用。\n\n此参数只在获取成功时返回。\n\n\n\n\nexpires_in\n\n\t\n\nO\n\n\t\n\nLong\n\n\t\n\naccess_token的有效期,单位为秒。您需要在过期时间到达时重新调用本接口获取新的access_token。\n\n有效期为48小时,如果在有效期内再次调用接口获取access_token时,新老access_token都是有效的。\n\n此参数只在获取成功时返回。\n\n响应示例\n\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"access_token\": \"eyJhbGciOiJIUzU****************\",\n \"expires_in\": 172800\n}\nREST API\n用户登录\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\n响应参数\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/v1/token" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section6932219103913" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "useJwt", + "M", + "integer", + "使用账号凭据JWT(Json Web Token),固定传入“1”。" + ], + [ + "grant_type", + "M", + "String", + "固定传入“client_credentials”。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,即获取客户端API授权中的“Client ID”。" + ], + [ + "client_secret", + "M", + "String", + "客户端密钥,即获取客户端API授权中的“Client Secret”。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "access_token", + "O", + "String", + "认证Token,用于API接口调用。 此参数只在获取成功时返回。" + ], + [ + "expires_in", + "O", + "Long", + "access_token的有效期,单位为秒。您需要在过期时间到达时重新调用本接口获取新的access_token。 有效期为48小时,如果在有效期内再次调用接口获取access_token时,新老access_token都是有效的。 此参数只在获取成功时返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section129mcpsimp" + } + ], + "title": "获取Token", + "updatedAt": "2026-10-22 11:41", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/clouddb/client-token.parameters.json b/pkg/domain/reference/clouddb/client-token.parameters.json new file mode 100644 index 0000000..9c792a1 --- /dev/null +++ b/pkg/domain/reference/clouddb/client-token.parameters.json @@ -0,0 +1,41 @@ +[ + { + "name": "useJwt", + "type": "integer", + "required": true, + "description": "使用账号凭据JWT(Json Web Token),固定传入“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "grant_type", + "type": "string", + "required": true, + "description": "固定传入“client_credentials”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body", + "enum": [ + "client_credentials" + ] + }, + { + "name": "client_id", + "type": "string", + "required": true, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body" + }, + { + "name": "client_secret", + "type": "string", + "required": true, + "description": "客户端密钥,即获取客户端API授权中的“Client Secret”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body" + } +] diff --git a/pkg/domain/reference/clouddb/client-token.rules.json b/pkg/domain/reference/clouddb/client-token.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/clouddb/client-token.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/clouddb/create-object-type.json b/pkg/domain/reference/clouddb/create-object-type.json new file mode 100644 index 0000000..1104fdc --- /dev/null +++ b/pkg/domain/reference/clouddb/create-object-type.json @@ -0,0 +1,969 @@ +{ + "title": "create-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/createObjectTypes.js", + "sha256": "ea1a659108043e7a14df18953f4135e72e2479af6d6559b44c1e64e3ab7d1b85", + "source": "import{SERVICES}from\"../util/constants.js\";async function createObjectTypes(e,t){const s={body:t};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.CREATE_OBJECT_TYPE,s)}export default createObjectTypes;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "Creation is asynchronous; query process-status and independently read back schema before reporting completion." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/create-zone.json b/pkg/domain/reference/clouddb/create-zone.json new file mode 100644 index 0000000..94b21b0 --- /dev/null +++ b/pkg/domain/reference/clouddb/create-zone.json @@ -0,0 +1,967 @@ +{ + "title": "create-zone", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/createDbZone.js", + "sha256": "7ddeffb5a020d7fd51cded0e6ead185c9ad7adab772485647bf8a7af723d3fce", + "source": "import{SERVICES}from\"../util/constants.js\";async function createDbZone(e,t){const o={body:{cloudDBZoneName:t}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.CREATE_ZONE,o)}export default createDbZone;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/delete-data.json b/pkg/domain/reference/clouddb/delete-data.json new file mode 100644 index 0000000..b315d88 --- /dev/null +++ b/pkg/domain/reference/clouddb/delete-data.json @@ -0,0 +1,789 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section101441919542", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section19632115714018", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section177593293713", + "title": "ClientInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "title": "Schema" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "title": "OperatorData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#ZH-CN_TOPIC_0000002764927381__li89603794812", + "title": "导出对象类型步骤4" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section156861057163820", + "title": "Field" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "title": "FieldValue" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section19632115714018", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1851916379417", + "title": "ResponseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "title": "UpdateResponseMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "title": "更新数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-error-code-rest-0000001454149360", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section2891171218402", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section133291219184112", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1957882116421", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1664165216352", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section177593293713", + "title": "ClientInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "title": "Schema" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "title": "OperatorData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section156861057163820", + "title": "Field" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "title": "FieldValue" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1421455220168", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section19632115714018", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1851916379417", + "title": "ResponseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "title": "UpdateResponseMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section2891171218402", + "text": "该接口用于用户删除数据,根据您传入对象主键删除相应的数据,不会比对该对象其他属性与存储的数据是否一致,删除操作需要设置naturalbase_deleted字段为true,具体请参见SchemaField字段设置。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "删除数据时,删除字段的数据类型与SchemaField中的参数类型需保持一致。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "请求示例" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4 content-type: application/json client_id: 74************40 Authorization: Bearer *** productId: 99************83 access_token: *** host: connect-drcn.dbankcloud.cn { \"msgInfo\": { \"type\": 3, \"opStore\": { \"storeName\": \"cloudDBZone\" } }, \"clientInfo\": { \"appVer\": 1 }, \"schemas\": [ { \"n\": \"StudentInfo\", \"fs\": [ { \"n\": \"id\", \"t\": \"TYPE_INT32\" }, { \"n\": \"naturalbase_version\", \"t\": \"TYPE_LONG\" }, { \"n\": \"naturalbase_deleted\", \"t\": \"TYPE_BOOLEAN\" } ] } ], \"opData\": [ { \"os\": [ { \"fs\": [ { \"i\": 1 }, { \"l\": null }, { \"bl\": true } ] } ], \"t\": 1 } ] }" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "content-type: application/json" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "client_id: 74************40" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "Authorization: Bearer ***" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "productId: 99************83" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "access_token: ***" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "host: connect-drcn.dbankcloud.cn" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "{" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"msgInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"type\": 3," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"opStore\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"storeName\": \"cloudDBZone\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "}" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "}," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"clientInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"appVer\": 1" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"schemas\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"n\": \"StudentInfo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"fs\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"n\": \"id\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"t\": \"TYPE_INT32\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"n\": \"naturalbase_version\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"t\": \"TYPE_LONG\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"n\": \"naturalbase_deleted\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"t\": \"TYPE_BOOLEAN\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "]" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "]," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"opData\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"os\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"i\": 1" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"l\": null" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"bl\": true" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "text": "\"t\": 1" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "text": "响应示例" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "text": "{ \"msgInfo\": { \"id\": \"1\", \"type\": 3, \"opStore\": { \"storeName\": \"string\" } }, \"resInfo\": {}, \"updateResMsg\": { \"successRecCount\": 1 } }" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "text": "\"id\": \"1\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "text": "\"storeName\": \"string\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "text": "\"resInfo\": {}," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "text": "\"updateResMsg\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426", + "text": "\"successRecCount\": 1" + } + ], + "renderedText": "API参考\n云数据库 for Object\nREST API\n删除数据\n删除数据\n更新时间: 2026-10-22 11:41\n功能介绍\n\n该接口用于用户删除数据,根据您传入对象主键删除相应的数据,不会比对该对象其他属性与存储的数据是否一致,删除操作需要设置naturalbase_deleted字段为true,具体请参见SchemaField字段设置。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> CloudDB服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/clouddb/clouddbservice/sync/upsert\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\n_v\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,即获取客户端API授权中的“Client ID”。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${authorization_token}”。\n\nauthorization_token为获取Token中获取的access_token。\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\naccess_token\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nmsgInfo\n\n\t\n\nM\n\n\t\n\nMsgInfo\n\n\t\n\n消息的基本信息,具体请参见MsgInfo。\n\n\n\n\nclientInfo\n\n\t\n\nM\n\n\t\n\nClientInfo\n\n\t\n\n客户端的基本信息,具体请参见ClientInfo。\n\n\n\n\nschemas\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n对象类型信息。\n\n\n\n\nopData\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n更新数据的对象信息。\n\nClientInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nappVer\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。\n\nSchema\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n对象类型名称。\n\n\n\n\nfs\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n字段名称。删除字段时,该对象必须属于同一个对象类型,且只能传入一个SchemaField。\n\nSchemaField\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n字段名。删除操作时必须有如下两个字段,并遵循相关约束:\nlong类型的naturalbase_version字段:该字段不生效,可设置为任意值。\nboolean类型的naturalbase_deleted字段:需设置为固定值“true”。\n\n\n\nt\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n字段类型,取值包含如下字段类型:\n\n1:TYPE_BOOLEAN,布尔类型。\n2:TYPE_BYTE,byte类型。\n3:TYPE_SHORT,short类型。\n4:TYPE_INT32,int类型。\n5:TYPE_LONG,long类型。\n6:TYPE_FLOAT,float类型。\n7:TYPE_DOUBLE,double类型。\n8:TYPE_BYTE_ARRAY,byte数组类型。\n9:TYPE_STRING,String类型。\n10:TYPE_DATE,date类型。\n11:TYPE_TEXT,文本类型。\n12:TYPE_AUTO_INCREMENT_INT,int自增类型。\n13:TYPE_AUTO_INCREMENT_LONG,long自增类型。\nOperatorData\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nos\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。\n\n\n\n\nt\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n删除操作类型,入参为“1”。\n\nField\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nfs\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n单条对象信息。\n\n说明\n\n删除操作中包含主键、naturalbase_deleted的字段固定设置值为true。\n\nFieldValue\n说明\n\n删除数据时,删除字段的数据类型与SchemaField中的参数类型需保持一致。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nO\n\n\t\n\nboolean\n\n\t\n\n是否设置为null\n\n\n\n\nbl\n\n\t\n\nO\n\n\t\n\nboolean\n\n\t\n\nboolean类型值\n\n\n\n\nb\n\n\t\n\nO\n\n\t\n\nbyte\n\n\t\n\nbyte类型值\n\n\n\n\nst\n\n\t\n\nO\n\n\t\n\nshort\n\n\t\n\nshort类型值\n\n\n\n\ni\n\n\t\n\nO\n\n\t\n\nint\n\n\t\n\nint类型值\n\n\n\n\nl\n\n\t\n\nO\n\n\t\n\nlong\n\n\t\n\nlong类型值\n\n\n\n\nf\n\n\t\n\nO\n\n\t\n\nfloat\n\n\t\n\nfloat类型值\n\n\n\n\nd\n\n\t\n\nO\n\n\t\n\ndouble\n\n\t\n\ndouble类型值\n\n\n\n\nba\n\n\t\n\nO\n\n\t\n\nbyteArray\n\n\t\n\nbyteArray类型值\n\n\n\n\ns\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\nString类型值\n\n请求示例\n\n预定义一个存储区(cloudDBZone)、对象类型StudentInfo(id integer primary key, name string, age integer);\nPOST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4\ncontent-type: application/json\nclient_id: 74************40\nAuthorization: Bearer ***\nproductId: 99************83\naccess_token: ***\nhost: connect-drcn.dbankcloud.cn\n{\n \"msgInfo\": {\n \"type\": 3,\n \"opStore\": {\n \"storeName\": \"cloudDBZone\"\n }\n },\n \"clientInfo\": {\n \"appVer\": 1\n },\n \"schemas\": [\n {\n \"n\": \"StudentInfo\",\n \"fs\": [\n {\n \"n\": \"id\",\n \"t\": \"TYPE_INT32\"\n },\n {\n \"n\": \"naturalbase_version\",\n \"t\": \"TYPE_LONG\"\n },\n {\n \"n\": \"naturalbase_deleted\",\n \"t\": \"TYPE_BOOLEAN\"\n }\n ]\n }\n ],\n \"opData\": [\n {\n \"os\": [\n {\n \"fs\": [\n {\n \"i\": 1\n },\n {\n \"l\": null\n },\n {\n \"bl\": true\n }\n ]\n }\n ],\n \"t\": 1\n }\n ]\n}\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nmsgInfo\n\n\t\n\nO\n\n\t\n\nMsgInfo\n\n\t\n\n返回消息的基本信息。\n\n\n\n\nresInfo\n\n\t\n\nO\n\n\t\n\nResponseInfo\n\n\t\n\n返回响应的基本状态信息。\n\n\n\n\nupdateResMsg\n\n\t\n\nO\n\n\t\n\nUpdateResponseMessage\n\n\t\n\n返回响应的更新信息。\n\nMsgInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\ntype\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n更新请求,入参需为“3”。\n\n“3”:更新数据或删除数据请求。\n“5”:查询数据请求。\n\n\n\nopStore\n\n\t\n\nM\n\n\t\n\nJson\n\n\t\n\nJSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。\n\ncloudDBZone为存储区名。\nResponseInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nresCode\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n响应状态码。\n\n\n\n\nresInfo\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n响应描述信息。\n\nUpdateResponseMessage\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nsuccessRecCount\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n成功更新条数。\n\n响应示例\n\n{\n \"msgInfo\": {\n \"id\": \"1\",\n \"type\": 3,\n \"opStore\": {\n \"storeName\": \"string\"\n }\n },\n \"resInfo\": {},\n \"updateResMsg\": {\n \"successRecCount\": 1\n }\n}\n更新数据\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\nClientInfo\nSchema\nSchemaField\nOperatorData\nField\nFieldValue\n响应参数\nMsgInfo\nResponseInfo\nUpdateResponseMessage\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> CloudDB服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/clouddb/clouddbservice/sync/upsert" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section133291219184112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "_v", + "M", + "integer", + "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1664165216352" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,即获取客户端API授权中的“Client ID”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "access_token", + "O", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "msgInfo", + "M", + "MsgInfo", + "消息的基本信息,具体请参见MsgInfo。" + ], + [ + "clientInfo", + "M", + "ClientInfo", + "客户端的基本信息,具体请参见ClientInfo。" + ], + [ + "schemas", + "M", + "List", + "对象类型信息。" + ], + [ + "opData", + "M", + "List", + "更新数据的对象信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "appVer", + "M", + "integer", + "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section177593293713" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "M", + "String", + "对象类型名称。" + ], + [ + "fs", + "M", + "List", + "字段名称。删除字段时,该对象必须属于同一个对象类型,且只能传入一个SchemaField。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "M", + "String", + "字段名。删除操作时必须有如下两个字段,并遵循相关约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 boolean类型的naturalbase_deleted字段:需设置为固定值“true”。" + ], + [ + "t", + "M", + "String", + "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "os", + "M", + "List", + "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。" + ], + [ + "t", + "M", + "integer", + "删除操作类型,入参为“1”。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "fs", + "M", + "List", + "单条对象信息。 说明 删除操作中包含主键、naturalbase_deleted的字段固定设置值为true。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section156861057163820" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "O", + "boolean", + "是否设置为null" + ], + [ + "bl", + "O", + "boolean", + "boolean类型值" + ], + [ + "b", + "O", + "byte", + "byte类型值" + ], + [ + "st", + "O", + "short", + "short类型值" + ], + [ + "i", + "O", + "int", + "int类型值" + ], + [ + "l", + "O", + "long", + "long类型值" + ], + [ + "f", + "O", + "float", + "float类型值" + ], + [ + "d", + "O", + "double", + "double类型值" + ], + [ + "ba", + "O", + "byteArray", + "byteArray类型值" + ], + [ + "s", + "O", + "String", + "String类型值" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "msgInfo", + "O", + "MsgInfo", + "返回消息的基本信息。" + ], + [ + "resInfo", + "O", + "ResponseInfo", + "返回响应的基本状态信息。" + ], + [ + "updateResMsg", + "O", + "UpdateResponseMessage", + "返回响应的更新信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1421455220168" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "type", + "M", + "integer", + "更新请求,入参需为“3”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。" + ], + [ + "opStore", + "M", + "Json", + "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section19632115714018" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "resCode", + "O", + "integer", + "响应状态码。" + ], + [ + "resInfo", + "O", + "String", + "响应描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1851916379417" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "successRecCount", + "O", + "integer", + "成功更新条数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section06631914426" + } + ], + "title": "删除数据", + "updatedAt": "2026-10-22 11:41", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture", + "unresolvedRules": [ + "opStore is labelled Json/JSON字符串 in the table, but request examples use an object. The adapter uses the explicit example object; queryCond remains an encoded JSON string. SchemaField.t descriptions enumerate numeric codes while write examples use TYPE_* strings. Delete Schema.fs says one item but its example contains three; no conflicting one-item cap is imposed. FieldValue.ba is labelled byteArray without a wire example; preserve caller JSON rather than guessing base64 or array." + ] +} diff --git a/pkg/domain/reference/clouddb/delete-data.parameters.json b/pkg/domain/reference/clouddb/delete-data.parameters.json new file mode 100644 index 0000000..1347411 --- /dev/null +++ b/pkg/domain/reference/clouddb/delete-data.parameters.json @@ -0,0 +1,269 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "_v", + "type": "integer", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1664165216352", + "in": "query", + "enum": [ + "4" + ] + }, + { + "name": "msgInfo", + "type": "object", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "properties": [ + { + "name": "type", + "in": "body", + "type": "integer", + "required": true, + "enum": [ + "3" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714" + }, + { + "name": "opStore", + "in": "body", + "type": "object", + "required": true, + "properties": [ + { + "name": "storeName", + "in": "body", + "type": "string", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714" + } + ] + }, + { + "name": "clientInfo", + "type": "object", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "properties": [ + { + "name": "appVer", + "type": "integer", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section177593293713", + "in": "body" + } + ] + }, + { + "name": "schemas", + "type": "array", + "required": true, + "description": "对象类型信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "对象类型名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "in": "body" + }, + { + "name": "fs", + "type": "array", + "required": true, + "description": "字段名称。删除字段时,该对象必须属于同一个对象类型,且只能传入一个SchemaField。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "字段名。删除操作时必须有如下两个字段,并遵循相关约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 boolean类型的naturalbase_deleted字段:需设置为固定值“true”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "in": "body" + }, + { + "name": "t", + "type": "string", + "required": true, + "description": "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "in": "body" + } + ] + } + ] + }, + { + "name": "opData", + "type": "array", + "required": true, + "description": "更新数据的对象信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "os", + "type": "array", + "required": true, + "description": "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fs", + "type": "array", + "required": true, + "description": "单条对象信息。 说明 删除操作中包含主键、naturalbase_deleted的字段固定设置值为true。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section156861057163820", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "boolean", + "required": false, + "description": "是否设置为null", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "bl", + "type": "boolean", + "required": false, + "description": "boolean类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "b", + "type": "integer", + "required": false, + "description": "byte类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "st", + "type": "integer", + "required": false, + "description": "short类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "i", + "type": "integer", + "required": false, + "description": "int类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "l", + "type": "integer", + "required": false, + "description": "long类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "f", + "type": "number", + "required": false, + "description": "float类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "d", + "type": "number", + "required": false, + "description": "double类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "ba", + "type": "", + "required": false, + "description": "byteArray类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "s", + "type": "string", + "required": false, + "description": "String类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + } + ] + } + ], + "maxItems": 1 + }, + { + "name": "t", + "type": "integer", + "required": true, + "description": "删除操作类型,入参为“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "in": "body", + "enum": [ + "1" + ] + } + ] + } +] diff --git a/pkg/domain/reference/clouddb/delete-data.rules.json b/pkg/domain/reference/clouddb/delete-data.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/clouddb/delete-data.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/clouddb/delete-object-type.json b/pkg/domain/reference/clouddb/delete-object-type.json new file mode 100644 index 0000000..d4d50b8 --- /dev/null +++ b/pkg/domain/reference/clouddb/delete-object-type.json @@ -0,0 +1,967 @@ +{ + "title": "delete-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/deleteObjectType.js", + "sha256": "0dc982680e3c8f22812297ff1756b4c2d09403431b62afea4fc37feb9ed7f28c", + "source": "import{SERVICES}from\"../util/constants.js\";async function deleteObjectType(e,t){const o={body:{objectTypeName:t}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.DELETE_OBJECT_TYPE,o)}export default deleteObjectType;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/delete-zone.json b/pkg/domain/reference/clouddb/delete-zone.json new file mode 100644 index 0000000..cbf03f1 --- /dev/null +++ b/pkg/domain/reference/clouddb/delete-zone.json @@ -0,0 +1,967 @@ +{ + "title": "delete-zone", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/deleteDbZone.js", + "sha256": "f7b8304c7842f7aa0bacd64bdb9e9c33d3e1877347fe6436de8b2234a5552cc5", + "source": "import{SERVICES}from\"../util/constants.js\";async function deleteDbZone(e,t){const o={body:{cloudDBZoneName:t}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.DELETE_ZONE,o)}export default deleteDbZone;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/export-object-types.json b/pkg/domain/reference/clouddb/export-object-types.json new file mode 100644 index 0000000..f58c22c --- /dev/null +++ b/pkg/domain/reference/clouddb/export-object-types.json @@ -0,0 +1,969 @@ +{ + "title": "export-object-types", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/exportObjectTypes.js", + "sha256": "c948e8448fb56e8b7e07c6816d0a563e6eebac308b60ed79b2bca3841423497e", + "source": "import{SERVICES}from\"../util/constants.js\";async function exportObjectsTypes(e,t,s,o,a,r){const c={body:{schemaVersion:t,type:s,jsFileType:o,javaFileType:a,packageName:r}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.EXPORT_OBJECT_TYPE,c)}export default exportObjectsTypes;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "Non-JSON formats return source-encoded Base64; no local extraction or execution." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/get-object-type.json b/pkg/domain/reference/clouddb/get-object-type.json new file mode 100644 index 0000000..c5e7f95 --- /dev/null +++ b/pkg/domain/reference/clouddb/get-object-type.json @@ -0,0 +1,967 @@ +{ + "title": "get-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/getObjectTypeAPI.js", + "sha256": "9ae61bc4c73b5dbeb2f9f0b9df767020d2f90578d88c736c7c8c9257018d4ee2", + "source": "import{SERVICES}from\"../util/constants.js\";export default async function getObjectType(e,t){const o={query:{schemaVersion:t.schemaVersion,objectTypeName:t.objectTypeName}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.GET_OBJECT_TYPE,o)}" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/import-object-types.json b/pkg/domain/reference/clouddb/import-object-types.json new file mode 100644 index 0000000..37e453a --- /dev/null +++ b/pkg/domain/reference/clouddb/import-object-types.json @@ -0,0 +1,969 @@ +{ + "title": "import-object-types", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/importObjectTypes.js", + "sha256": "dd67764f12a0d2c49f2783996edc32f5a02ade91899f325d5c3f2e5c91500113", + "source": "import{SERVICES}from\"../util/constants.js\";async function importObjectTypes(e,t){const o={body:t};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.IMPORT_OBJECT_TYPE,o)}export default importObjectTypes;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "Raw JSON document, not a JSON string wrapper; only new object types may be imported; local size limit 20MB." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/list-zones.json b/pkg/domain/reference/clouddb/list-zones.json new file mode 100644 index 0000000..1c82ca9 --- /dev/null +++ b/pkg/domain/reference/clouddb/list-zones.json @@ -0,0 +1,967 @@ +{ + "title": "list-zones", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/listDbZone.js", + "sha256": "9f7e1cb28dd8e3fb6e551c105d3e70f3ddb26dd34027032402d87e59744bded6", + "source": "import{SERVICES}from\"../util/constants.js\";async function listDbZone(e){return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.LIST_ZONE,{})}export default listDbZone;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/process-status.json b/pkg/domain/reference/clouddb/process-status.json new file mode 100644 index 0000000..2845b5c --- /dev/null +++ b/pkg/domain/reference/clouddb/process-status.json @@ -0,0 +1,967 @@ +{ + "title": "process-status", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/checkProcessPertentage.js", + "sha256": "59dae0b7b528dfbdcba0cefd5694523f6fdc140f3fd1b626ba5b7574bee9c5bc", + "source": "import{SERVICES}from\"../util/constants.js\";async function checkProcessPercentage(e,t){const s={body:{processId:t}};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.PROCESS_PERCENTAGE,s)}export default checkProcessPercentage;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/query-data.json b/pkg/domain/reference/clouddb/query-data.json new file mode 100644 index 0000000..b4a1d70 --- /dev/null +++ b/pkg/domain/reference/clouddb/query-data.json @@ -0,0 +1,900 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section101441919542", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section448214662111", + "title": "ClientInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "title": "QueryRequestMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#ZH-CN_TOPIC_0000002764927381__li89603794812", + "title": "导出对象类型步骤4" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section15813132391810", + "title": "ResponseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1032114611816", + "title": "Schema" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section32691439191911", + "title": "OperatorData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section15908236202019", + "title": "QueryResponseMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section4778145911810", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section10292165113308", + "title": "Field" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section86139207207", + "title": "FieldValue" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "title": "AggregateQueryResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "title": "用户登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "title": "更新数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2891171218402", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section133291219184112", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1957882116421", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section88414213129", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section448214662111", + "title": "ClientInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "title": "QueryRequestMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section133978369500", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section15813132391810", + "title": "ResponseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1032114611816", + "title": "Schema" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section4778145911810", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section32691439191911", + "title": "OperatorData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section10292165113308", + "title": "Field" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section86139207207", + "title": "FieldValue" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section15908236202019", + "title": "QueryResponseMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "title": "AggregateQueryResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2891171218402", + "text": "该接口用于用户查询数据,云数据库提供了丰富的谓词查询,比如equalTo、notEqualTo、in等,通过单个或者多个链式过滤条件,您可以从云侧数据库查询到满足特定条件的对象,也可以通过限定查询返回数量谓词限定查询结果返回的数量,还可以支持聚合查询,例如查询平均值、最大值、最小值等。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "请求示例" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/query?_v=4 content-type: application/json client_id: 74************40 Authorization: Bearer *** productId: 24************51 access_token: ****** host: connect-drcn.dbankcloud.cn { \"msgInfo\": { \"type\": 5, \"opStore\": { \"storeName\": \"cloudDBZone\" } }, \"clientInfo\": { \"appVer\": 15 }, \"queryReqMsg\": { \"queryType\" : 0, \"queryTable\" : \"StudentInfo\", \"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"1\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\" } }" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/query?_v=4" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "content-type: application/json" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "client_id: 74************40" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "Authorization: Bearer ***" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "productId: 24************51" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "access_token: ******" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "host: connect-drcn.dbankcloud.cn" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "{" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"msgInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"type\": 5," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"opStore\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"storeName\": \"cloudDBZone\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "}" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "}," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"clientInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"appVer\": 15" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"queryReqMsg\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"queryType\" : 0," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"queryTable\" : \"StudentInfo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"1\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "{ \"queryReqMsg\": { \"queryType\" : 1, \"queryTable\" : \"StudentInfo\", \"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"Average\\\",\\\"fieldName\\\":\\\"age\\\"}]}\" } }" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"queryType\" : 1," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "text": "\"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"Average\\\",\\\"fieldName\\\":\\\"age\\\"}]}\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "响应示例" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "{ \"msgInfo\": { \"type\": 5, \"opStore\": { \"storeName\": \"cloudDBZone\" } }, \"resInfo\": {}, \"schemas\": [ { \"n\": \"StudentInfo\", \"fs\": [ { \"n\": \"id\", \"t\": 4 }, { \"n\": \"name\", \"t\": 9 }, { \"n\": \"age\", \"t\": 4 }, { \"n\": \"naturalbase_creator\", \"t\": 9 }, { \"n\": \"naturalbase_version\", \"t\": 5 } ] } ], \"opData\": [ { \"os\": [ { \"fs\": [ { \"i\": 0 }, { \"s\": \"string\" }, { \"i\": \"0\" }, { \"s\": \"string\" }, { \"l\": \"0\" } ] } ] } ], \"queryResMsg\": { \"aggQueryRes\": { \"isNull\": true } } }" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"resInfo\": {}," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"schemas\": [" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"n\": \"StudentInfo\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"fs\": [" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"n\": \"id\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"t\": 4" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"n\": \"name\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"t\": 9" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"n\": \"age\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"n\": \"naturalbase_creator\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"n\": \"naturalbase_version\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"t\": 5" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "]" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "]," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"opData\": [" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"os\": [" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"i\": 0" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"s\": \"string\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"i\": \"0\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"l\": \"0\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"queryResMsg\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"aggQueryRes\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015", + "text": "\"isNull\": true" + } + ], + "renderedText": "API参考\n云数据库 for Object\nREST API\n查询数据\n查询数据\n更新时间: 2026-10-22 11:41\n功能介绍\n\n该接口用于用户查询数据,云数据库提供了丰富的谓词查询,比如equalTo、notEqualTo、in等,通过单个或者多个链式过滤条件,您可以从云侧数据库查询到满足特定条件的对象,也可以通过限定查询返回数量谓词限定查询结果返回的数量,还可以支持聚合查询,例如查询平均值、最大值、最小值等。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> CloudDB服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/clouddb/clouddbservice/sync/query\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\n_v\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息。格式为“Authorization: Bearer ${client_token}”。\n\nclient_token为获取Token中获取的access_token。\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\naccess_token\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nmsgInfo\n\n\t\n\nM\n\n\t\n\nMsgInfo\n\n\t\n\n消息的基本信息,具体请参见MsgInfo。\n\n\n\n\nclientInfo\n\n\t\n\nM\n\n\t\n\nClientInfo\n\n\t\n\n客户端的基本信息,具体请参见ClientInfo。\n\n\n\n\nqueryReqMsg\n\n\t\n\nM\n\n\t\n\nQueryRequestMessage\n\n\t\n\n查询请求的基本信息,具体请参见QueryRequestMessage。\n\nMsgInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\ntype\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n查询请求。入参需为“5”。\n\n“3”:更新数据或删除数据请求。\n“5”:查询数据请求。\n\n\n\nopStore\n\n\t\n\nM\n\n\t\n\nJson\n\n\t\n\nJSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。\n\ncloudDBZone为存储区名。\nClientInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nappVer\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。\n\nQueryRequestMessage\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nqueryType\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n查询类型。涉及到的查询值类型如下:\n\n0:默认值,普通查询。\n1:AVG、Average,平均值查询。\n2:SUM,总和查询。\n3:MAX,最大值查询。\n4:MIN,最小值查询。\n5:COUNT,计数查询。\n\n\n\nqueryTable\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n查询的对象类型名称。\n\n\n\n\nqueryCond\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n查询条件。Json格式的字符串,例如:\"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"3\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\"\n\n说明\n\n当queryType不为0时,queryCond的conditionType参数必须设置为与queryType取值一致的查询条件,否则会导致接口返回错误。\n\n例如:queryType取值为2时,conditionType必须设置为SUM。\n\n请求示例\n\n预定义一个存储区(cloudDBZone)、对象类型StudentInfo(id integer primary key, name string, age integer);\nPOST agc/apigw/clouddb/clouddbservice/sync/query?_v=4\ncontent-type: application/json\nclient_id: 74************40\nAuthorization: Bearer ***\nproductId: 24************51\naccess_token: ******\nhost: connect-drcn.dbankcloud.cn\n{\n \"msgInfo\": {\n \"type\": 5,\n \"opStore\": {\n \"storeName\": \"cloudDBZone\"\n }\n },\n \"clientInfo\": {\n \"appVer\": 15\n },\n \"queryReqMsg\": {\n \"queryType\" : 0,\n \"queryTable\" : \"StudentInfo\",\n \"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"1\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\"\n }\n}\n聚合查询QueryRequestMessage请求消息体示例\n{\n \"queryReqMsg\": {\n \"queryType\" : 1,\n \"queryTable\" : \"StudentInfo\",\n \"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"Average\\\",\\\"fieldName\\\":\\\"age\\\"}]}\"\n }\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nmsgInfo\n\n\t\n\nO\n\n\t\n\nMsgInfo\n\n\t\n\n消息的基本信息,具体请参见MsgInfo。\n\n\n\n\nresInfo\n\n\t\n\nO\n\n\t\n\nResponseInfo\n\n\t\n\n返回响应的基本状态信息,具体请参见ResponseInfo。\n\n\n\n\nschemas\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n对象类型基本信息,具体请见Schema。\n\n\n\n\nopData\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n对象类型中数据信息,具体请见OperatorData。\n\n\n\n\nqueryResMsg\n\n\t\n\nO\n\n\t\n\nQueryResponseMessage\n\n\t\n\n聚合查询响应基本信息,具体请参见QueryResponseMessage。\n\nResponseInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nresCode\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n响应状态码。\n\n\n\n\nresInfo\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n响应描述信息。\n\nSchema\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n对象类型名称。\n\n\n\n\nfs\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n字段名称。\n\nSchemaField\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n字段名信息。\n\n\n\n\nt\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n字段类型,取值包含如下字段类型:\n\n1:TYPE_BOOLEAN,布尔类型。\n2:TYPE_BYTE,byte类型。\n3:TYPE_SHORT,short类型。\n4:TYPE_INT32,int类型。\n5:TYPE_LONG,long类型。\n6:TYPE_FLOAT,float类型。\n7:TYPE_DOUBLE,double类型。\n8:TYPE_BYTE_ARRAY,byte数组类型。\n9:TYPE_STRING,String类型。\n10:TYPE_DATE,date类型。\n11:TYPE_TEXT,文本类型。\n12:TYPE_AUTO_INCREMENT_INT,int自增类型。\n13:TYPE_AUTO_INCREMENT_LONG,long自增类型。\nOperatorData\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nos\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n数据对象信息。\n\nField\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nfs\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n单条数据对象信息。\n\nFieldValue\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nO\n\n\t\n\nboolean\n\n\t\n\n是否设置为null\n\n\n\n\nbl\n\n\t\n\nO\n\n\t\n\nboolean\n\n\t\n\nboolean类型值\n\n\n\n\nb\n\n\t\n\nO\n\n\t\n\nbyte\n\n\t\n\nbyte类型值\n\n\n\n\nst\n\n\t\n\nO\n\n\t\n\nshort\n\n\t\n\nshort类型值\n\n\n\n\ni\n\n\t\n\nO\n\n\t\n\nint\n\n\t\n\nint类型值\n\n\n\n\nl\n\n\t\n\nO\n\n\t\n\nlong\n\n\t\n\nlong类型值\n\n\n\n\nf\n\n\t\n\nO\n\n\t\n\nfloat\n\n\t\n\nfloat类型值\n\n\n\n\nd\n\n\t\n\nO\n\n\t\n\ndouble\n\n\t\n\ndouble类型值\n\n\n\n\nba\n\n\t\n\nO\n\n\t\n\nbyteArray\n\n\t\n\nbyteArray类型值\n\n\n\n\ns\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\nString类型值\n\nQueryResponseMessage\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nqueryType\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n查询类型,涉及到的查询值类型如下:\n\n0:默认值,普通查询。\n1:AVG、Average,平均值查询。\n2:SUM,总和查询。\n3:MAX,最大值查询。\n4:MIN,最小值查询。\n5:COUNT,计数查询。\n\n\n\naggQueryRes\n\n\t\n\nO\n\n\t\n\nAggregateQueryResult\n\n\t\n\n聚合查询结果信息。\n\nAggregateQueryResult\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nisNull\n\n\t\n\nO\n\n\t\n\nboolean\n\n\t\n\n聚合查询结果是否为空。\n\n\n\n\nlongRes\n\n\t\n\nO\n\n\t\n\nlong\n\n\t\n\n字段类型为int、long的MAX、MIN、SUM查询结果或COUNT查询结果。\n\n\n\n\ndoubleRes\n\n\t\n\nO\n\n\t\n\ndouble\n\n\t\n\n字段类型为double的MAX、MIN、Average、SUM查询结果。\n\n响应示例\n\n{\n \"msgInfo\": {\n \"type\": 5,\n \"opStore\": {\n \"storeName\": \"cloudDBZone\"\n }\n },\n \"resInfo\": {},\n \"schemas\": [\n {\n \"n\": \"StudentInfo\",\n \"fs\": [\n {\n \"n\": \"id\",\n \"t\": 4\n },\n {\n \"n\": \"name\",\n \"t\": 9\n },\n {\n \"n\": \"age\",\n \"t\": 4\n },\n {\n \"n\": \"naturalbase_creator\",\n \"t\": 9\n },\n {\n \"n\": \"naturalbase_version\",\n \"t\": 5\n }\n ]\n }\n ],\n \"opData\": [\n {\n \"os\": [\n {\n \"fs\": [\n {\n \"i\": 0\n },\n {\n \"s\": \"string\"\n },\n {\n \"i\": \"0\"\n },\n {\n \"s\": \"string\"\n },\n {\n \"l\": \"0\"\n }\n ]\n }\n ]\n }\n ],\n \"queryResMsg\": {\n \"aggQueryRes\": {\n \"isNull\": true\n }\n }\n}\n用户登录\n更新数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\nMsgInfo\nClientInfo\nQueryRequestMessage\n响应参数\nResponseInfo\nSchema\nSchemaField\nOperatorData\nField\nFieldValue\nQueryResponseMessage\nAggregateQueryResult\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> CloudDB服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/clouddb/clouddbservice/sync/query" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section133291219184112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "_v", + "M", + "integer", + "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section88414213129" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息。格式为“Authorization: Bearer ${client_token}”。 client_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "access_token", + "O", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "msgInfo", + "M", + "MsgInfo", + "消息的基本信息,具体请参见MsgInfo。" + ], + [ + "clientInfo", + "M", + "ClientInfo", + "客户端的基本信息,具体请参见ClientInfo。" + ], + [ + "queryReqMsg", + "M", + "QueryRequestMessage", + "查询请求的基本信息,具体请参见QueryRequestMessage。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "type", + "M", + "integer", + "查询请求。入参需为“5”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。" + ], + [ + "opStore", + "M", + "Json", + "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "appVer", + "M", + "integer", + "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section448214662111" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "queryType", + "M", + "integer", + "查询类型。涉及到的查询值类型如下: 0:默认值,普通查询。 1:AVG、Average,平均值查询。 2:SUM,总和查询。 3:MAX,最大值查询。 4:MIN,最小值查询。 5:COUNT,计数查询。" + ], + [ + "queryTable", + "M", + "String", + "查询的对象类型名称。" + ], + [ + "queryCond", + "M", + "String", + "查询条件。Json格式的字符串,例如:\"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"3\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\" 说明 当queryType不为0时,queryCond的conditionType参数必须设置为与queryType取值一致的查询条件,否则会导致接口返回错误。 例如:queryType取值为2时,conditionType必须设置为SUM。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "msgInfo", + "O", + "MsgInfo", + "消息的基本信息,具体请参见MsgInfo。" + ], + [ + "resInfo", + "O", + "ResponseInfo", + "返回响应的基本状态信息,具体请参见ResponseInfo。" + ], + [ + "schemas", + "O", + "list", + "对象类型基本信息,具体请见Schema。" + ], + [ + "opData", + "O", + "list", + "对象类型中数据信息,具体请见OperatorData。" + ], + [ + "queryResMsg", + "O", + "QueryResponseMessage", + "聚合查询响应基本信息,具体请参见QueryResponseMessage。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section133978369500" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "resCode", + "O", + "integer", + "响应状态码。" + ], + [ + "resInfo", + "O", + "String", + "响应描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section15813132391810" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "O", + "String", + "对象类型名称。" + ], + [ + "fs", + "O", + "List", + "字段名称。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1032114611816" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "O", + "String", + "字段名信息。" + ], + [ + "t", + "O", + "String", + "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section4778145911810" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "os", + "O", + "List", + "数据对象信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section32691439191911" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "fs", + "O", + "List", + "单条数据对象信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section10292165113308" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "O", + "boolean", + "是否设置为null" + ], + [ + "bl", + "O", + "boolean", + "boolean类型值" + ], + [ + "b", + "O", + "byte", + "byte类型值" + ], + [ + "st", + "O", + "short", + "short类型值" + ], + [ + "i", + "O", + "int", + "int类型值" + ], + [ + "l", + "O", + "long", + "long类型值" + ], + [ + "f", + "O", + "float", + "float类型值" + ], + [ + "d", + "O", + "double", + "double类型值" + ], + [ + "ba", + "O", + "byteArray", + "byteArray类型值" + ], + [ + "s", + "O", + "String", + "String类型值" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section86139207207" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "queryType", + "O", + "integer", + "查询类型,涉及到的查询值类型如下: 0:默认值,普通查询。 1:AVG、Average,平均值查询。 2:SUM,总和查询。 3:MAX,最大值查询。 4:MIN,最小值查询。 5:COUNT,计数查询。" + ], + [ + "aggQueryRes", + "O", + "AggregateQueryResult", + "聚合查询结果信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section15908236202019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "isNull", + "O", + "boolean", + "聚合查询结果是否为空。" + ], + [ + "longRes", + "O", + "long", + "字段类型为int、long的MAX、MIN、SUM查询结果或COUNT查询结果。" + ], + [ + "doubleRes", + "O", + "double", + "字段类型为double的MAX、MIN、Average、SUM查询结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section138011958202015" + } + ], + "title": "查询数据", + "updatedAt": "2026-10-22 11:41", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture", + "unresolvedRules": [ + "opStore is labelled Json/JSON字符串 in the table, but request examples use an object. The adapter uses the explicit example object; queryCond remains an encoded JSON string. SchemaField.t descriptions enumerate numeric codes while write examples use TYPE_* strings. Delete Schema.fs says one item but its example contains three; no conflicting one-item cap is imposed. FieldValue.ba is labelled byteArray without a wire example; preserve caller JSON rather than guessing base64 or array." + ] +} diff --git a/pkg/domain/reference/clouddb/query-data.parameters.json b/pkg/domain/reference/clouddb/query-data.parameters.json new file mode 100644 index 0000000..75d579d --- /dev/null +++ b/pkg/domain/reference/clouddb/query-data.parameters.json @@ -0,0 +1,171 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息。格式为“Authorization: Bearer ${client_token}”。 client_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "_v", + "type": "integer", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section88414213129", + "in": "query", + "enum": [ + "4" + ] + }, + { + "name": "msgInfo", + "type": "object", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "in": "body", + "properties": [ + { + "name": "type", + "type": "integer", + "required": true, + "description": "查询请求。入参需为“5”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "in": "body", + "enum": [ + "5" + ] + }, + { + "name": "opStore", + "type": "object", + "required": true, + "description": "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "in": "body", + "properties": [ + { + "name": "storeName", + "in": "body", + "type": "string", + "required": true + } + ] + } + ] + }, + { + "name": "clientInfo", + "type": "object", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "in": "body", + "properties": [ + { + "name": "appVer", + "type": "integer", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section448214662111", + "in": "body" + } + ] + }, + { + "name": "queryReqMsg", + "type": "object", + "required": true, + "description": "查询请求的基本信息,具体请参见QueryRequestMessage。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "in": "body", + "properties": [ + { + "name": "queryType", + "type": "integer", + "required": true, + "description": "查询类型。涉及到的查询值类型如下: 0:默认值,普通查询。 1:AVG、Average,平均值查询。 2:SUM,总和查询。 3:MAX,最大值查询。 4:MIN,最小值查询。 5:COUNT,计数查询。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5" + ] + }, + { + "name": "queryTable", + "type": "string", + "required": true, + "description": "查询的对象类型名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "in": "body" + }, + { + "name": "queryCond", + "type": "string", + "required": true, + "description": "查询条件。Json格式的字符串,例如:\"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"3\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\" 说明 当queryType不为0时,queryCond的conditionType参数必须设置为与queryType取值一致的查询条件,否则会导致接口返回错误。 例如:queryType取值为2时,conditionType必须设置为SUM。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "in": "body", + "encodedJson": { + "type": "object", + "properties": [ + { + "name": "queryConditions", + "in": "body", + "type": "array", + "required": true, + "itemsType": "object", + "itemsProperties": [ + { + "name": "conditionType", + "in": "body", + "type": "string", + "required": true + }, + { + "name": "fieldName", + "in": "body", + "type": "string" + }, + { + "name": "value", + "in": "body" + } + ] + } + ] + } + } + ] + } +] diff --git a/pkg/domain/reference/clouddb/query-data.rules.json b/pkg/domain/reference/clouddb/query-data.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/clouddb/query-data.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/clouddb/schema-versions.json b/pkg/domain/reference/clouddb/schema-versions.json new file mode 100644 index 0000000..7864525 --- /dev/null +++ b/pkg/domain/reference/clouddb/schema-versions.json @@ -0,0 +1,967 @@ +{ + "title": "schema-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/getSchemeVersions.js", + "sha256": "be6c97e63679a25e9f888c4edd8ddb5617cfb8978dd9eb7c3b2707d3c3cba5ee", + "source": "import{SERVICES}from\"../util/constants.js\";async function getSchemeVersions(e){return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.GET_SCHEME_VERSIONS)}export default getSchemeVersions;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/clouddb/sign-in.json b/pkg/domain/reference/clouddb/sign-in.json new file mode 100644 index 0000000..890c572 --- /dev/null +++ b/pkg/domain/reference/clouddb/sign-in.json @@ -0,0 +1,580 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-error-code-rest-0000001454149360", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1967861214174", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "title": "查询数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section2592122834211", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section868716114420", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section4817102184517", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section8252421578", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section101441919542", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1967861214174", + "title": "UserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "title": "ProviderUserInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section2592122834211", + "text": "该接口用于用户使用账号密码登录。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "POST agc/apigw/oauth2/third/v1/user-signin content-type: application/json productId: 99************83 client_id: 680************560 Authorization: Bearer *** host: connect-drcn.dbankcloud.cn { \"provider\": 0, \"token\": \"string\", \"extraData\": \"string\", \"autoCreateUser\": 0, \"useJwt\": 1, \"channelId\": \"string\", \"aaId\": \"string\" }" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "POST agc/apigw/oauth2/third/v1/user-signin" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "content-type: application/json" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "productId: 99************83" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "client_id: 680************560" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "Authorization: Bearer ***" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "host: connect-drcn.dbankcloud.cn" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "{" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "\"provider\": 0," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "\"token\": \"string\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "\"extraData\": \"string\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "\"autoCreateUser\": 0," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "\"useJwt\": 1," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "\"channelId\": \"string\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "\"aaId\": \"string\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "text": "}" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "{ \"ret\": { \"code\": 0, \"msg\": \"string\" }, \"accessToken\": { \"token\": \"string\", \"validPeriod\": 0 }, \"refreshToken\": { \"token\": \"string\", \"validPeriod\": 0 }, \"userInfo\": { \"uid\": \"string\", \"importUid\": \"string\", \"displayName\": \"string\", \"photoUrl\": \"string\", \"provider\": 0, \"emailVerified\": 0, \"passwordSetted\": 0, \"email\": \"string\", \"phone\": \"string\" }, \"providers\": [{ \"uid\": \"string\", \"displayName\": \"string\", \"photoUrl\": \"string\", \"provider\": 0, \"openId\": \"string\", \"email\": \"string\", \"phone\": \"string\", \"extId\": \"string\" }] }" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"ret\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"code\": 0," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"msg\": \"string\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "}," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"accessToken\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"validPeriod\": 0" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"refreshToken\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"userInfo\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"uid\": \"string\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"importUid\": \"string\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"displayName\": \"string\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"photoUrl\": \"string\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"emailVerified\": 0," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"passwordSetted\": 0," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"email\": \"string\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"phone\": \"string\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"providers\": [{" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"openId\": \"string\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"phone\": \"string\"," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "\"extId\": \"string\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365", + "text": "}]" + } + ], + "renderedText": "API参考\n云数据库 for Object\nREST API\n用户登录\n用户登录\n更新时间: 2026-10-22 11:41\n功能介绍\n\n该接口用于用户使用账号密码登录。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> 华为认证服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考获取客户端API授权。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息。格式为“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nprovider\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n账号授权提供方,取值及对应认证方式如下:\n\n0:匿名账号\n1:华为账号\n2:Facebook*\n3:Twitter*\n4:微信\n5:华为游戏\n6:QQ\n7:微博\n8:Google*\n9:Google Play Game*\n10:自建账号\n11:手机\n12:邮箱\n13:苹果账号\n说明\n\n*星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。\n\n\n\n\ntoken\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n手机号码或者邮箱账号。\n\n\n\n\nextraData\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。\n\n\n\n\nautoCreateUser\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n是否自动创建用户,仅用于非托管账号。\n\n0:不自动创建用户。\n1:默认值,自动创建用户。\n\n\n\nuseJwt\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n使用账号凭据JWT(Json Web Token),固定传入“1”。\n\n\n\n\nchannelId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。\n\n\n\n\naaId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n应用实例唯一编号。\n\n请求示例\nPOST agc/apigw/oauth2/third/v1/user-signin\ncontent-type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nhost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 1,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}\n响应参数\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n包含返回码及描述信息的JSON字符串。格式为{\"code\":retcode, \"msg\": \"description\"}。\n\nretcode为返回码。\ndescription为返回码描述信息。返回码请参见错误码。\n\n\n\naccessToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串。格式为{\"token\": \"string\", \"validPeriod\": \"string\" }。\n\ntoken为用户凭据。\nvalidPeriod为token有效时长,单位为秒。\n\n\n\nrefreshToken\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\nJSON字符串。格式为{\"token\": \"string\", \"validPeriod\": \"string\"}。\n\ntoken为用户凭据。\nvalidPeriod为token有效时长,单位为秒。\n\n\n\nuserInfo\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n用户信息。\n\n\n\n\nproviders\n\n\t\n\nO\n\n\t\n\nlist\n\n\t\n\n第三方的认证信息。\n\nUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\nimportUid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n导入的用户ID,仅当存在导入用户时有值。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n首次认证的第三方标识。\n\n\n\n\nemailVerified\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n邮箱验证标识:\n\n0:邮箱未被验证。\n1:邮箱已被验证。\n\n\n\npasswordSetted\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n密码设置标识:\n\n0:未设置密码。\n1:已设置密码。\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\nProviderUserInfo\n\n参数\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n描述\n\n\n\n\nuid\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户ID。\n\n\n\n\ndisplayName\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n用户昵称。\n\n\n\n\nphotoUrl\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n头像地址。\n\n\n\n\nprovider\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n首次认证的第三方标识。\n\n\n\n\nopenId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。\n\n\n\n\nemail\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n邮箱地址。\n\n\n\n\nphone\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n手机号码。\n\n\n\n\nextId\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n扩展ID。\n\n响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}\n获取Token\n查询数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\n响应参数\nUserInfo\nProviderUserInfo\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> 华为认证服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/oauth2/third/v1/user-signin" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section868716114420" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section8252421578" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考获取客户端API授权。" + ], + [ + "Authorization", + "M", + "String", + "认证信息。格式为“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "provider", + "M", + "integer", + "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。" + ], + [ + "token", + "M", + "String", + "手机号码或者邮箱账号。" + ], + [ + "extraData", + "O", + "String", + "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。" + ], + [ + "autoCreateUser", + "O", + "integer", + "是否自动创建用户,仅用于非托管账号。 0:不自动创建用户。 1:默认值,自动创建用户。" + ], + [ + "useJwt", + "M", + "integer", + "使用账号凭据JWT(Json Web Token),固定传入“1”。" + ], + [ + "channelId", + "O", + "String", + "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。" + ], + [ + "aaId", + "O", + "String", + "应用实例唯一编号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "ret", + "O", + "String(100)", + "包含返回码及描述信息的JSON字符串。格式为{\"code\":retcode, \"msg\": \"description\"}。 retcode为返回码。 description为返回码描述信息。返回码请参见错误码。" + ], + [ + "accessToken", + "O", + "String(100)", + "JSON字符串。格式为{\"token\": \"string\", \"validPeriod\": \"string\" }。 token为用户凭据。 validPeriod为token有效时长,单位为秒。" + ], + [ + "refreshToken", + "O", + "String(100)", + "JSON字符串。格式为{\"token\": \"string\", \"validPeriod\": \"string\"}。 token为用户凭据。 validPeriod为token有效时长,单位为秒。" + ], + [ + "userInfo", + "O", + "list", + "用户信息。" + ], + [ + "providers", + "O", + "list", + "第三方的认证信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section101441919542" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "importUid", + "O", + "String", + "导入的用户ID,仅当存在导入用户时有值。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "首次认证的第三方标识。" + ], + [ + "emailVerified", + "O", + "integer", + "邮箱验证标识: 0:邮箱未被验证。 1:邮箱已被验证。" + ], + [ + "passwordSetted", + "O", + "integer", + "密码设置标识: 0:未设置密码。 1:已设置密码。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1967861214174" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "uid", + "O", + "String", + "用户ID。" + ], + [ + "displayName", + "O", + "String", + "用户昵称。" + ], + [ + "photoUrl", + "O", + "String", + "头像地址。" + ], + [ + "provider", + "O", + "integer", + "首次认证的第三方标识。" + ], + [ + "openId", + "O", + "String", + "第三方用户标识,第三方SDK授权后即可获得。只有微信、QQ与华为游戏账号认证方式涉及。" + ], + [ + "email", + "O", + "String", + "邮箱地址。" + ], + [ + "phone", + "O", + "String", + "手机号码。" + ], + [ + "extId", + "O", + "String", + "扩展ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section164071284365" + } + ], + "title": "用户登录", + "updatedAt": "2026-10-22 11:41", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/clouddb/sign-in.parameters.json b/pkg/domain/reference/clouddb/sign-in.parameters.json new file mode 100644 index 0000000..2952cae --- /dev/null +++ b/pkg/domain/reference/clouddb/sign-in.parameters.json @@ -0,0 +1,106 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息。格式为“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section8252421578", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号。 0:不自动创建用户。 1:默认值,自动创建用户。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": true, + "description": "使用账号凭据JWT(Json Web Token),固定传入“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + } +] diff --git a/pkg/domain/reference/clouddb/sign-in.rules.json b/pkg/domain/reference/clouddb/sign-in.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/clouddb/sign-in.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/clouddb/update-data.json b/pkg/domain/reference/clouddb/update-data.json new file mode 100644 index 0000000..0b70e2a --- /dev/null +++ b/pkg/domain/reference/clouddb/update-data.json @@ -0,0 +1,809 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section101441919542", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section10559951122313", + "title": "ClientInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "title": "Schema" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "title": "OperatorData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#ZH-CN_TOPIC_0000002764927381__li89603794812", + "title": "导出对象类型步骤4" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section101441056257", + "title": "Field" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "title": "FieldValue" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section346211104269", + "title": "ResponseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "title": "UpdateResponseMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "title": "查询数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "title": "删除数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section2891171218402", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section133291219184112", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1957882116421", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1475695062212", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "title": "MsgInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section10559951122313", + "title": "ClientInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "title": "Schema" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "title": "SchemaField" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "title": "OperatorData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section101441056257", + "title": "Field" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "title": "FieldValue" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section187591160308", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section346211104269", + "title": "ResponseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "title": "UpdateResponseMessage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section2891171218402", + "text": "该接口用于用户更新数据,支持数据的新增和更新。更新数据时,如果在CloudDBZone已经存在主键值相同的对象,则更新已有的对象;如果不存在,则写入一个新的对象。更新操作需要设置naturalbase_deleted字段为false,具体请参见SchemaField字段设置。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "更新数据时,更新字段的数据类型与SchemaField中的参数类型需保持一致。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "请求示例" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4 content-type: application/json client_id: 74************40 Authorization: Bearer *** productId: 99************83 access_token: *** host: connect-drcn.dbankcloud.cn { \"msgInfo\": { \"type\": 3, \"opStore\": { \"storeName\": \"cloudDBZone\" } }, \"clientInfo\": { \"appVer\": 1 }, \"schemas\": [ { \"n\": \"StudentInfo\", \"fs\": [ { \"n\": \"id\", \"t\": \"TYPE_INT32\" }, { \"n\": \"name\", \"t\": \"TYPE_STRING\" }, { \"n\": \"age\", \"t\": \"TYPE_INT32\" }, { \"n\": \"naturalbase_version\", \"t\": \"TYPE_LONG\" }, { \"n\": \"naturalbase_deleted\", \"t\": \"TYPE_BOOLEAN\" } ] } ], \"opData\": [ { \"os\": [ { \"fs\": [ { \"i\": 1 }, { \"s\": \"string\" }, { \"i\": 18 }, { \"l\": null }, { \"bl\": false } ] } ], \"t\": 1 } ] }" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "content-type: application/json" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "client_id: 74************40" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "Authorization: Bearer ***" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "productId: 99************83" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "access_token: ***" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "host: connect-drcn.dbankcloud.cn" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "{" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"msgInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"type\": 3," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"opStore\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"storeName\": \"cloudDBZone\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "}" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "}," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"clientInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"appVer\": 1" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"schemas\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"n\": \"StudentInfo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"fs\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"n\": \"id\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"t\": \"TYPE_INT32\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"n\": \"name\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"t\": \"TYPE_STRING\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"n\": \"age\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"n\": \"naturalbase_version\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"t\": \"TYPE_LONG\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"n\": \"naturalbase_deleted\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"t\": \"TYPE_BOOLEAN\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "]" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "]," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"opData\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"os\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"i\": 1" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"s\": \"string\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"i\": 18" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"l\": null" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"bl\": false" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "text": "\"t\": 1" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "text": "响应示例" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "text": "{ \"msgInfo\": { \"type\": 3, \"opStore\": { \"storeName\": \"String\" } }, \"resInfo\": {}, \"updateResMsg\": { \"successRecCount\": 1 } }" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "text": "\"storeName\": \"String\"" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "text": "\"resInfo\": {}," + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "text": "\"updateResMsg\": {" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611", + "text": "\"successRecCount\": 1" + } + ], + "renderedText": "API参考\n云数据库 for Object\nREST API\n更新数据\n更新数据\n更新时间: 2026-10-22 11:41\n功能介绍\n\n该接口用于用户更新数据,支持数据的新增和更新。更新数据时,如果在CloudDBZone已经存在主键值相同的对象,则更新已有的对象;如果不存在,则写入一个新的对象。更新操作需要设置naturalbase_deleted字段为false,具体请参见SchemaField字段设置。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n应用客户端 -> CloudDB服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-drcn.dbankcloud.cn/agc/apigw/clouddb/clouddbservice/sync/upsert\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nQuery\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\n_v\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。\n\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,即获取客户端API授权中的“Client ID”。\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${authorization_token}”。\n\nauthorization_token为获取Token中获取的access_token。\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\naccess_token\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nmsgInfo\n\n\t\n\nM\n\n\t\n\nMsgInfo\n\n\t\n\n消息的基本信息,具体请参见MsgInfo。\n\n\n\n\nclientInfo\n\n\t\n\nM\n\n\t\n\nClientInfo\n\n\t\n\n客户端的基本信息,具体请参见ClientInfo。\n\n\n\n\nschemas\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n表对象信息,具体请参见Schema。\n\n\n\n\nopData\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n更新数据对象信息,具体请参见OperatorData。\n\nMsgInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\ntype\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n更新请求,入参需为“3”。\n\n“3”:更新数据或删除数据请求。\n“5”:查询数据请求。\n\n\n\nopStore\n\n\t\n\nM\n\n\t\n\nJson\n\n\t\n\nJSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。\n\ncloudDBZone为存储区名。\nClientInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nappVer\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。\n\nSchema\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n对象类型名称。\n\n\n\n\nfs\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n字段名称。更新字段时,该字段必须属于同一个对象类型,否则会导致更新失败。\n\nSchemaField\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n字段名。更新操作时必须有如下两个字段,并遵循如下约束:\n\nlong类型的naturalbase_version字段:该字段不生效,可设置为任意值。\n布尔类型的naturalbase_deleted字段:需设置为固定值“false”。\n\n\n\nt\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n字段类型,取值包含如下字段类型:\n\n1:TYPE_BOOLEAN,布尔类型。\n2:TYPE_BYTE,byte类型。\n3:TYPE_SHORT,short类型。\n4:TYPE_INT32,int类型。\n5:TYPE_LONG,long类型。\n6:TYPE_FLOAT,float类型。\n7:TYPE_DOUBLE,double类型。\n8:TYPE_BYTE_ARRAY,byte数组类型。\n9:TYPE_STRING,String类型。\n10:TYPE_DATE,date类型。\n11:TYPE_TEXT,文本类型。\n12:TYPE_AUTO_INCREMENT_INT,int自增类型。\n13:TYPE_AUTO_INCREMENT_LONG,long自增类型。\nOperatorData\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nos\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。\n\n\n\n\nt\n\n\t\n\nM\n\n\t\n\ninteger\n\n\t\n\n更新操作类型,入参为“1”。\n\nField\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nfs\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n单条对象信息。\n\n说明\n\n更新操作包含naturalbase_deleted的字段固定设置值为false。\n\nFieldValue\n说明\n\n更新数据时,更新字段的数据类型与SchemaField中的参数类型需保持一致。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nn\n\n\t\n\nO\n\n\t\n\nboolean\n\n\t\n\n是否设置为null\n\n\n\n\nbl\n\n\t\n\nO\n\n\t\n\nboolean\n\n\t\n\nboolean类型值\n\n\n\n\nb\n\n\t\n\nO\n\n\t\n\nbyte\n\n\t\n\nbyte类型值\n\n\n\n\nst\n\n\t\n\nO\n\n\t\n\nshort\n\n\t\n\nshort类型值\n\n\n\n\ni\n\n\t\n\nO\n\n\t\n\nint\n\n\t\n\nint类型值\n\n\n\n\nl\n\n\t\n\nO\n\n\t\n\nlong\n\n\t\n\nlong类型值\n\n\n\n\nf\n\n\t\n\nO\n\n\t\n\nfloat\n\n\t\n\nfloat类型值\n\n\n\n\nd\n\n\t\n\nO\n\n\t\n\ndouble\n\n\t\n\ndouble类型值\n\n\n\n\nba\n\n\t\n\nO\n\n\t\n\nbyteArray\n\n\t\n\nbyteArray类型值\n\n\n\n\ns\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\nString类型值\n\n请求示例\n\n预定义一个存储区(cloudDBZone)、对象类型StudentInfo(id integer primary key, name string, age integer);\nPOST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4\ncontent-type: application/json\nclient_id: 74************40\nAuthorization: Bearer ***\nproductId: 99************83\naccess_token: ***\nhost: connect-drcn.dbankcloud.cn\n{\n \"msgInfo\": {\n \"type\": 3,\n \"opStore\": {\n \"storeName\": \"cloudDBZone\"\n }\n },\n \"clientInfo\": {\n \"appVer\": 1\n },\n \"schemas\": [\n {\n \"n\": \"StudentInfo\",\n \"fs\": [\n {\n \"n\": \"id\",\n \"t\": \"TYPE_INT32\"\n },\n {\n \"n\": \"name\",\n \"t\": \"TYPE_STRING\"\n },\n {\n \"n\": \"age\",\n \"t\": \"TYPE_INT32\"\n },\n {\n \"n\": \"naturalbase_version\",\n \"t\": \"TYPE_LONG\"\n },\n {\n \"n\": \"naturalbase_deleted\",\n \"t\": \"TYPE_BOOLEAN\"\n }\n ]\n }\n ],\n \"opData\": [\n {\n \"os\": [\n {\n \"fs\": [\n {\n \"i\": 1\n },\n {\n \"s\": \"string\"\n },\n {\n \"i\": 18\n },\n {\n \"l\": null\n },\n {\n \"bl\": false\n }\n ]\n }\n ],\n \"t\": 1\n }\n ]\n}\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nmsgInfo\n\n\t\n\nO\n\n\t\n\nMsgInfo\n\n\t\n\n返回消息的基本信息。\n\n\n\n\nresInfo\n\n\t\n\nO\n\n\t\n\nResponseInfo\n\n\t\n\n返回响应的基本状态信息。\n\n\n\n\nupdateResMsg\n\n\t\n\nO\n\n\t\n\nUpdateResponseMessage\n\n\t\n\n返回响应的更新信息。\n\nResponseInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nresCode\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n响应状态码。\n\n\n\n\nresInfo\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n响应描述信息。\n\nUpdateResponseMessage\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数类型\n\n\t\n\n参数说明\n\n\n\n\nsuccessRecCount\n\n\t\n\nO\n\n\t\n\ninteger\n\n\t\n\n成功更新条数。\n\n响应示例\n\n{\n \"msgInfo\": {\n \"type\": 3,\n \"opStore\": {\n \"storeName\": \"String\"\n }\n },\n \"resInfo\": {},\n \"updateResMsg\": {\n \"successRecCount\": 1\n }\n}\n查询数据\n删除数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nQuery\nHeader\nBody\nMsgInfo\nClientInfo\nSchema\nSchemaField\nOperatorData\nField\nFieldValue\n响应参数\nResponseInfo\nUpdateResponseMessage\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "应用客户端 -> CloudDB服务器" + ], + [ + "接口URL", + "https://connect-drcn.dbankcloud.cn/agc/apigw/clouddb/clouddbservice/sync/upsert" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section133291219184112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "_v", + "M", + "integer", + "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1475695062212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,即获取客户端API授权中的“Client ID”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "access_token", + "O", + "String", + "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "msgInfo", + "M", + "MsgInfo", + "消息的基本信息,具体请参见MsgInfo。" + ], + [ + "clientInfo", + "M", + "ClientInfo", + "客户端的基本信息,具体请参见ClientInfo。" + ], + [ + "schemas", + "M", + "List", + "表对象信息,具体请参见Schema。" + ], + [ + "opData", + "M", + "List", + "更新数据对象信息,具体请参见OperatorData。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "type", + "M", + "integer", + "更新请求,入参需为“3”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。" + ], + [ + "opStore", + "M", + "Json", + "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "appVer", + "M", + "integer", + "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section10559951122313" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "M", + "String", + "对象类型名称。" + ], + [ + "fs", + "M", + "List", + "字段名称。更新字段时,该字段必须属于同一个对象类型,否则会导致更新失败。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "M", + "String", + "字段名。更新操作时必须有如下两个字段,并遵循如下约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 布尔类型的naturalbase_deleted字段:需设置为固定值“false”。" + ], + [ + "t", + "M", + "String", + "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "os", + "M", + "List", + "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。" + ], + [ + "t", + "M", + "integer", + "更新操作类型,入参为“1”。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "fs", + "M", + "List", + "单条对象信息。 说明 更新操作包含naturalbase_deleted的字段固定设置值为false。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section101441056257" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "n", + "O", + "boolean", + "是否设置为null" + ], + [ + "bl", + "O", + "boolean", + "boolean类型值" + ], + [ + "b", + "O", + "byte", + "byte类型值" + ], + [ + "st", + "O", + "short", + "short类型值" + ], + [ + "i", + "O", + "int", + "int类型值" + ], + [ + "l", + "O", + "long", + "long类型值" + ], + [ + "f", + "O", + "float", + "float类型值" + ], + [ + "d", + "O", + "double", + "double类型值" + ], + [ + "ba", + "O", + "byteArray", + "byteArray类型值" + ], + [ + "s", + "O", + "String", + "String类型值" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "msgInfo", + "O", + "MsgInfo", + "返回消息的基本信息。" + ], + [ + "resInfo", + "O", + "ResponseInfo", + "返回响应的基本状态信息。" + ], + [ + "updateResMsg", + "O", + "UpdateResponseMessage", + "返回响应的更新信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section187591160308" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "resCode", + "O", + "integer", + "响应状态码。" + ], + [ + "resInfo", + "O", + "String", + "响应描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section346211104269" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "参数类型", + "参数说明" + ], + [ + "successRecCount", + "O", + "integer", + "成功更新条数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1996242232611" + } + ], + "title": "更新数据", + "updatedAt": "2026-10-22 11:41", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture", + "unresolvedRules": [ + "opStore is labelled Json/JSON字符串 in the table, but request examples use an object. The adapter uses the explicit example object; queryCond remains an encoded JSON string. SchemaField.t descriptions enumerate numeric codes while write examples use TYPE_* strings. Delete Schema.fs says one item but its example contains three; no conflicting one-item cap is imposed. FieldValue.ba is labelled byteArray without a wire example; preserve caller JSON rather than guessing base64 or array." + ] +} diff --git a/pkg/domain/reference/clouddb/update-data.parameters.json b/pkg/domain/reference/clouddb/update-data.parameters.json new file mode 100644 index 0000000..1ff693d --- /dev/null +++ b/pkg/domain/reference/clouddb/update-data.parameters.json @@ -0,0 +1,271 @@ +[ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "_v", + "type": "integer", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1475695062212", + "in": "query", + "enum": [ + "4" + ] + }, + { + "name": "msgInfo", + "type": "object", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "properties": [ + { + "name": "type", + "type": "integer", + "required": true, + "description": "更新请求,入参需为“3”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "in": "body", + "enum": [ + "3" + ] + }, + { + "name": "opStore", + "type": "object", + "required": true, + "description": "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "in": "body", + "properties": [ + { + "name": "storeName", + "in": "body", + "type": "string", + "required": true + } + ] + } + ] + }, + { + "name": "clientInfo", + "type": "object", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "properties": [ + { + "name": "appVer", + "type": "integer", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section10559951122313", + "in": "body" + } + ] + }, + { + "name": "schemas", + "type": "array", + "required": true, + "description": "表对象信息,具体请参见Schema。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "对象类型名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "in": "body" + }, + { + "name": "fs", + "type": "array", + "required": true, + "description": "字段名称。更新字段时,该字段必须属于同一个对象类型,否则会导致更新失败。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "字段名。更新操作时必须有如下两个字段,并遵循如下约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 布尔类型的naturalbase_deleted字段:需设置为固定值“false”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "in": "body" + }, + { + "name": "t", + "type": "string", + "required": true, + "description": "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "in": "body" + } + ] + } + ] + }, + { + "name": "opData", + "type": "array", + "required": true, + "description": "更新数据对象信息,具体请参见OperatorData。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "os", + "type": "array", + "required": true, + "description": "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fs", + "type": "array", + "required": true, + "description": "单条对象信息。 说明 更新操作包含naturalbase_deleted的字段固定设置值为false。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section101441056257", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "boolean", + "required": false, + "description": "是否设置为null", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "bl", + "type": "boolean", + "required": false, + "description": "boolean类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "b", + "type": "integer", + "required": false, + "description": "byte类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "st", + "type": "integer", + "required": false, + "description": "short类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "i", + "type": "integer", + "required": false, + "description": "int类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "l", + "type": "integer", + "required": false, + "description": "long类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "f", + "type": "number", + "required": false, + "description": "float类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "d", + "type": "number", + "required": false, + "description": "double类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "ba", + "type": "", + "required": false, + "description": "byteArray类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "s", + "type": "string", + "required": false, + "description": "String类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + } + ] + } + ], + "maxItems": 1 + }, + { + "name": "t", + "type": "integer", + "required": true, + "description": "更新操作类型,入参为“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "in": "body", + "enum": [ + "1" + ] + } + ] + } +] diff --git a/pkg/domain/reference/clouddb/update-data.rules.json b/pkg/domain/reference/clouddb/update-data.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/clouddb/update-data.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/clouddb/update-object-type.json b/pkg/domain/reference/clouddb/update-object-type.json new file mode 100644 index 0000000..63f1ef3 --- /dev/null +++ b/pkg/domain/reference/clouddb/update-object-type.json @@ -0,0 +1,969 @@ +{ + "title": "update-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/clouddb/util/constants.js", + "sha256": "25011c99703831640c6e5d6e849f82d439e77c44e46a150911088eaaa98981cc", + "source": "const SERVICES=Object.freeze({GET_SCHEME_VERSIONS:{path:\"/agc/edge/clouddb/clouddbservice/v1/schemaVersion\",method:\"GET\"},EXPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportObjectType\",method:\"POST\"},GET_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"POST\"},MODIFY_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"PUT\"},DELETE_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/objectType\",method:\"DELETE\"},VIEW_OBJECT_TYPE:{path:\"/api/clouddb/clouddbservice/v1/objectType\",method:\"GET\"},CREATE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"POST\"},PRODUCT_INFO:{path:\"/agc/edge/clouddb/clouddbservice/v1/trs/productInfo\",method:\"POST\"},LIST_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"GET\"},DELETE_ZONE:{path:\"/agc/edge/clouddb/clouddbservice/v1/naturalStore\",method:\"DELETE\"},IMPORT_OBJECT_TYPE:{path:\"/agc/edge/clouddb/clouddbservice/v1/importObjectType\",method:\"POST\"},EXPORT_DATA_POST:{path:\"/agc/edge/clouddb/clouddbservice/v1/exportFile\",method:\"POST\"},EXPORT_DATA_EXIST:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/storage/existService\",method:\"POST\"},LIST_FILES:{path:\"/agc/edge/WiseCloudStorageService/agc-nsp-portal/file/listFiles\",method:\"POST\"},IMPORT_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/importFile\",method:\"POST\"},ADD_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},MODIFY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"POST\"},GET_RULES:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"GET\"},DELETE_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"DELETE\"},PUBLISH_RULE:{path:\"/agc/edge/clouddb/clouddbservice/v1/securityRules\",method:\"POST\"},VERIFY_RULE:{path:\"/api/clouddb/clouddbservice/v1/securityRules/verify\",method:\"POST\"},FETCH_USAGE:{path:\"/agc/edge/ass/subscribe-service/v1/subscriber/quota\",method:\"GET\"},PROCESS_PERCENTAGE:{path:\"/agc/edge/clouddb/clouddbservice/v1/processPercentage\",method:\"POST\"},QUERY_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v2/objects/queries\",method:\"POST\"},DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/object\",method:\"DELETE\"},MULTIPLE_DELETE_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v3/syncObjects\",method:\"DELETE\"},MULTIPLE_UPDATE_DATA:{path:\"/api/clouddb/clouddbservice/v3/syncObjects\",method:\"POST\"},CLEAR_DATA:{path:\"/agc/edge/clouddb/clouddbservice/v1/allObjects\",method:\"DELETE\"}}),PROCESS_ID=\"processId\";export{SERVICES,PROCESS_ID};" + }, + { + "packagePath": "commands/clouddb/model/PermissionRole.js", + "sha256": "50b65faca8924004dfe8df3715ecc0670cb686b88924eccc828b9bc32cb84e86", + "source": "export var PermissionRole;!function(r){r.World=\"World\",r.Authenticated=\"Authenticated\",r.Creator=\"Creator\",r.Administrator=\"Administrator\"}(PermissionRole||(PermissionRole={}));" + }, + { + "packagePath": "commands/clouddb/model/PermissionRight.js", + "sha256": "4f6223939df6e5de3319b969134ab5d22d3a2f50dda57b498957d72e22269453", + "source": "export var PermissionRight;!function(e){e.Read=\"Read\",e.Upsert=\"Upsert\",e.Delete=\"Delete\"}(PermissionRight||(PermissionRight={}));" + }, + { + "packagePath": "commands/clouddb/model/ObjectField.js", + "sha256": "65dbc188940a469bff93d6bdc03555d8ba8e9b0863ea009fc53c051f96ae126a", + "source": "import{ObjectFieldType}from\"./ObjectFieldType.js\";export class ObjectField{constructor(e,i){this.fieldName=e,this.fieldType=i,this.belongPrimaryKey=!1,this.notNull=!1,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0}setPrimary(e){this.belongPrimaryKey=e,e&&(this.notNull=e,this.isNeedEncrypt=!1,this.isSensitive=!1,this.defaultValue=void 0)}setNotNull(e){this.notNull=e,e&&(this.isNeedEncrypt=!1,this.isSensitive=!1)}setEncrypted(e){this.isNeedEncrypt=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isSensitive=!1,this.defaultValue=void 0)}setSensitive(e){this.isSensitive=e,e&&(this.notNull=!1,this.belongPrimaryKey=!1,this.isNeedEncrypt=!1,this.defaultValue=void 0)}canSetDefaultValue(){return!this.isNeedEncrypt&&!this.isSensitive&&!this.belongPrimaryKey&&this.fieldType!==ObjectFieldType.Date&&this.fieldType!==ObjectFieldType.LongAutoIncrement&&this.fieldType!==ObjectFieldType.IntAutoIncrement&&this.fieldType!==ObjectFieldType.ByteArray}}" + }, + { + "packagePath": "commands/clouddb/model/ObjectIndexField.js", + "sha256": "c9449d37fe3e0cd340393ab04db0738ceefce4f18fd18a69160a0c05b7a53e73", + "source": "import{IndexFieldSortOrder}from\"./IndexFieldSortOrder.js\";export class ObjectIndexField{constructor(e){this.fieldName=e,this.sortType=IndexFieldSortOrder.ASC}}" + }, + { + "packagePath": "commands/clouddb/cmd/createObject.js", + "sha256": "fbe3378a02fe562943096c33115d9f0964bc0410f0a9abcb02002a9224924f55", + "source": "import createObjectTypes from\"../api/createObjectTypes.js\";import{ObjectScheme}from\"../model/ObjectScheme.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createObject(e,t){try{validate(t);let c=new ObjectScheme;await objectIndexSelector(0,c);let a=await createObjectTypes(e,{objectType:{...c,objectTypeName:t.name}});if(void 0===a[PROCESS_ID])throw a;const o=await ProcessService.checkProcessFinished(e,a[PROCESS_ID]);if(!0===o.error)throw o.failedReason;SUCCESS(`The object named ${t.name} created successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>32)throw\"The zone name should contains maximum of 32 characters!\";if(!new RegExp(\"^[A-Za-z](?!sqlite)[A-Za-z0-9_]{0,30}[A-Za-z0-9]$\").test(e.name))throw\"Only digits, letters, and underscores () are allowed. The name must start with a letter but cannot start with sqlite or end with an underscore.\"}export default function main(e){return{cmd:\"create-object\",desc:\"Create a database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db create-object --name person\"]],child:[],action:t=>createObject(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/modifyObject.js", + "sha256": "508d2365190022b47dc9204ab51b17e926d1654d64b1b538ff24a6b97b494b19", + "source": "import{ObjectTypeService}from\"../boundary/ObjectTypeService.js\";import{objectIndexSelector}from\"../boundary/inquirer/ObjectIndexSelector.js\";import{checkDBServiceEnabled}from\"../util/validation.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import modifyObjectTypes from\"../api/modifyObjectTypes.js\";import{PROCESS_ID}from\"../util/constants.js\";import{OPTION,setMandatory}from\"../option/option.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";async function modifyObject(e,o){try{const t=await ObjectTypeService.getObjectScheme(e,o.name);if(void 0===t)return;const c={...t};await objectIndexSelector(0,t);let i=await modifyObjectTypes(e,{objectType:{...t,objectTypeName:o.name},originObjectType:c});if(void 0===i[PROCESS_ID])throw i;const r=await ProcessService.checkProcessFinished(e,i[PROCESS_ID]);if(!0===r.error)throw r.failedReason;SUCCESS(`The object named ${o.name} modified successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}export default function main(e){return{cmd:\"modify-object\",desc:\"Modify database object to Cloud DB.\",options:[setMandatory(OPTION.CloudDBObjectName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db modify-object --name person\"]],child:[],action:o=>modifyObject(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/createZone.js", + "sha256": "692da8c876d3f6aa76fc060e635355b5af45ad440aa5474387b8b5e3ade08071", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function createZone(e,o){try{validate(o);const t=await ZoneService.createZone(e,o);if(void 0===t[PROCESS_ID])throw t;const a=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===a.error)throw new Error(a.failedReason);SUCCESS(`The zone named ${o.name} added successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){if(e.name.length>20)throw new Error(\"The zone name should contains maximum of 20 characters!\");if(!new RegExp(\"^[A-Za-z][A-Za-z0-9]{0,19}(?createZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/cmd/deleteZone.js", + "sha256": "70d7fa910171cb340c7b9528836f0a8ca47f5b2afc7b28d97f3090cbaeb8d7b0", + "source": "import{checkDBServiceEnabled}from\"../util/validation.js\";import{ZoneService}from\"../boundary/ZoneService.js\";import{ProcessService}from\"../boundary/ProcessService.js\";import{PROCESS_ID}from\"../util/constants.js\";import{checkIsLogin,checkSelectedProject}from\"../../common/util/validation.js\";import{OPTION,setMandatory}from\"../option/option.js\";async function deleteZone(e,o){validate(o);try{let t=await ZoneService.deleteZone(e,o);if(void 0===t[PROCESS_ID])throw t;const n=await ProcessService.checkProcessFinished(e,t[PROCESS_ID]);if(!0===n.error)throw n.failedReason;SUCCESS(`The zone named ${o.name} deleted successfully.`)}catch(e){ERROR(e.message||JSON.stringify(e))}}function validate(e){e.name.length>20&&ERROR(\"The zone name should contains maximum of 20 characters!\")}export default function main(e){return{cmd:\"delete-zone\",desc:\"Delete a zone from Cloud DB.\",options:[setMandatory(OPTION.CloudDBZoneName.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli db delete-zone --name zoneName\"]],child:[],action:o=>deleteZone(e,o),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkDBServiceEnabled(e)}}}" + }, + { + "packagePath": "commands/clouddb/api/modifyObjectTypes.js", + "sha256": "cf9cabb7a85e87c94ed7d3008c784d70f33bab8f1008052e21700d9f04b69620", + "source": "import{SERVICES}from\"../util/constants.js\";async function modifyObjectTypes(e,t){const o={body:t};return await e.RequestService.sendRequestWithCookie(e.storage.getProjectEdgeBaseUrl(),SERVICES.MODIFY_OBJECT_TYPE,o)}export default modifyObjectTypes;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "modules/request/RequestService.js", + "sha256": "c066cb24b967096e36230dddcc83342a11aa9a41fcaaffa1546a5124d0e18aa6", + "source": "import storage from\"../storage/index.js\";import{edgeRequest}from\"./edge.js\";import{buildCloudError}from\"./Errors.js\";export class RequestService{static async sendRequest(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers}})}catch(r){return this.processNetWorkError(r)}}static async sendRequestWithCookie(r,e,t){try{return await edgeRequest({url:`${r}${e.path}`,method:e.method,data:t?.body,params:t?.query,headers:{...t?.headers,projectId:storage.getProjectId(),agcTeamId:storage.getTeamId(),Cookie:`authInfo=${storage.get(\"authInfo\")};csrfToken=${storage.get(\"csrfToken\")};`,\"X-HD-CSRF\":storage.get(\"csrfToken\")}})}catch(r){if(r&&r.response&&r.response.status&&404===r.response.status){const r=storage.get(\"region\");if(null!==r&&\"CN\"!==r)throw\"This service is only active in China region. Enter 'agcli project region select' to select a region.\"}throw this.processNetWorkError(r)}}static processNetWorkError(r){if(r&&r.response&&r.response.status){if(r.response.data&&r.response.data.info)return r.response.data.info;switch(r.response.status){case 401:return buildCloudError(\"ERR_SERVER_AUTH\");case 403:return buildCloudError(\"ERR_SERVER_PERMISSION\");case 404:return buildCloudError(\"ERR_SERVER_NOT_FOUND\");case 407:return buildCloudError(\"ERR_SERVER_SCOPE\");case 408:return buildCloudError(\"ERR_SERVER_TIMEOUT\");case 413:return buildCloudError(\"ERR_SERVER_REQUEST_ENTITY_TOO_LARGE\");case 502:return buildCloudError(\"ERR_SERVER_BAD_GATEWAY\");default:return buildCloudError(r)}}return\"ETIMEDOUT\"===r.code?buildCloudError(\"ERR_SERVER_TIMEOUT\"):buildCloudError(r)}}" + } + ], + "notes": [ + "originObjectType must be the exact prior definition; this is not a patch or a migration of existing data." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + } + ] +} diff --git a/pkg/domain/reference/comments/com-getreviewinfo-harmonyos.json b/pkg/domain/reference/comments/com-getreviewinfo-harmonyos.json new file mode 100644 index 0000000..9f9fde6 --- /dev/null +++ b/pkg/domain/reference/comments/com-getreviewinfo-harmonyos.json @@ -0,0 +1,289 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1388mcpsimp", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/marketing-api/v2/reviews/manage/dev/reviews/200d2d5161f942928d75c553d2bde4ec?appId=80082088208008208820&page=1&limit=100 \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer ***" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1471mcpsimp", + "text": "响应示例\n{ \n \"rtnCode\": 0, \n \"rtnDesc\": \"success\", \n \"review\": { \n \"content\": \"用户评论详情......\", \n \"reviewId\": \"123456789101112\", \n \"appVersion\": \"1.0.1\", \n \"phoneType\": \"HUAWEI Pura 70\", \n \"rating\": 4, \n \"likes\": 0, \n \"replies\": 4, \n \"dateline\": 1752113554485, \n \"auditState\": 3, \n \"devReplyContent\": \"开发者回复详情......\", \n \"countryCode\": \"CN\" \n }, \n \"replyList\": [ \n { \n \"lang\": \"zh-Hans\", \n \"appId\": \"80082088208008208820\", \n \"reviewId\": \"123456789101112\", \n \"devReplyContent\": \"回复详情1......\", \n \"replyTime\": 1752113555486, \n \"countryCode\": \"CN\", \n \"toReplyId\": \"3012806395925626880\" \n }, \n { \n \"lang\": \"zh-Hans\", \n \"appId\": \"80082088208008208820\", \n \"reviewId\": \"123456789101112\", \n \"devReplyContent\": \"回复详情2......\", \n \"replyTime\": 1752113556487, \n \"countryCode\": \"CN\", \n \"toReplyId\": \"3011640589267431424\" \n } \n ], \n \"hasNext\": 1, \n \"total\": 2 \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-commentapi-0000001115868340", + "title": "Comments API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-harmonyos-0000002470067188", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/platform-introduction-0000002306078829#section4713137951", + "title": "授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976", + "title": "查询应用评论列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-reviewinfo-0000002470893980", + "title": "ReviewInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-replyinfo-0000002503933923", + "title": "ReplyInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976", + "title": "查询应用评论列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974", + "title": "回复评论和回复" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1221mcpsimp", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1224mcpsimp", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1230mcpsimp", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1269mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1271mcpsimp", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1349mcpsimp", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1388mcpsimp", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1391mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1471mcpsimp", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1474mcpsimp", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1221mcpsimp", + "text": "开发者查询对应鸿蒙应用下的单个评论详情及评论下的回复列表。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1224mcpsimp", + "text": "接口调用者已进行过应用推广引擎平台账户登录操作。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1224mcpsimp", + "text": "接口调用者的角色:账号持有者以及经账号持有者授权了“管理评论”或“查看评论”的团队成员角色。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/marketing-api/v2/reviews/manage/dev/reviews/{reviewId}?appId={appId} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1230mcpsimp" + }, + { + "location": "path", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "reviewId", + "M", + "String", + "评论ID,可从查询应用评论列表接口中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1271mcpsimp" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ], + [ + "page", + "O", + "Integer", + "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + ], + [ + "limit", + "O", + "Integer", + "每页请求数目,最大100条每页,默认20条。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1349mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。" + ], + [ + "rtnDesc", + "M", + "String", + "返回码描述信息。" + ], + [ + "review", + "O", + "ReviewInfo", + "评论详情。" + ], + [ + "replyList", + "O", + "ReplyInfo", + "评论下的回复列表。" + ], + [ + "hasNext", + "O", + "Long", + "是否有下一页,取值范围: 0:否 1:是" + ], + [ + "total", + "O", + "Long", + "总记录数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1391mcpsimp" + } + ], + "title": "查询单个评论详情", + "updatedAt": "2026-04-29 19:20", + "checkedAt": "2026-10-07T02:57:09.424Z", + "family": "comments", + "endpoint": "com-getreviewinfo-harmonyos" +} diff --git a/pkg/domain/reference/comments/com-getreviewinfo-harmonyos.parameters.json b/pkg/domain/reference/comments/com-getreviewinfo-harmonyos.parameters.json new file mode 100644 index 0000000..e8c3f12 --- /dev/null +++ b/pkg/domain/reference/comments/com-getreviewinfo-harmonyos.parameters.json @@ -0,0 +1,35 @@ +[ + { + "name": "reviewId", + "in": "path", + "type": "string", + "required": true, + "description": "评论ID,可从查询应用评论列表接口中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1271mcpsimp" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp" + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839#ZH-CN_TOPIC_0000002504053839__title1301mcpsimp", + "maximum": 100 + } +] diff --git a/pkg/domain/reference/comments/com-getreviewinfo.json b/pkg/domain/reference/comments/com-getreviewinfo.json new file mode 100644 index 0000000..4002930 --- /dev/null +++ b/pkg/domain/reference/comments/com-getreviewinfo.json @@ -0,0 +1,252 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section19934722144316", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/reviews/v1/manage/dev/reviews/9f43c56228854d66a65921938199c0ce?appid=300148173\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1977011318413", + "text": "响应示例\n{\n \"ret\": {\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\"\n },\n \"data\": {\n \"review\": {\n \"content\": \"Comment content......\",\n \"reviewId\": \"9f43c56228854d66a65921938199c0ce\",\n \"apkVersion\": \"10.5.3\",\n \"phoneType\": \"HONOR8-LITE\",\n \"rating\": 3,\n \"likes\": 0,\n \"replies\": 2,\n \"dateline\": 1590564388000,\n \"auditState\": \"3\",\n \"devReplyContent\": \"Reply content......\",\n \"countryCode\": \"CN\"\n },\n \"replyList\": [\n {\n \"lang\": \"zh_CN\",\n \"appId\": \"C300148173\",\n \"reviewId\": \"9f43c56228854d66a65921938199c0ce\",\n \"devReplyContent\": \"Reply to replay content......\",\n \"countryCode\": \"CN\",\n \"toReplyId\": \"8ae4bb4b338d4c6791e8ef797ac691a3\"\n },\n {\n \"lang\": \"zh_CN\",\n \"appId\": \"C300148173\",\n \"reviewId\": \"9f43c56228854d66a65921938199c0ce\",\n \"devReplyContent\": \"Reply content......\",\n \"countryCode\": \"CN\"\n\n\n }\n ],\n \"hasNext\": 0,\n \"total\": 2\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-commentapi-0000001115868340", + "title": "Comments API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-api-0000002502827151", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-cbresult-0000001162468141", + "title": "CommentBaseResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-gdrrdata-0000001116028250", + "title": "GetDevReviewRspData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139", + "title": "查询评论列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117", + "title": "回复评论和回复" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section11985185416211", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section3861044135212", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section39301550194610", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1977011318413", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section11985185416211", + "text": "获取单个评论详情。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/reviews/v1/manage/dev/reviews/{reviewId}?appId={appId}&page={page}&limit={limit} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section2862142512223" + }, + { + "location": "path", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "reviewId", + "M", + "String", + "评论ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section3861044135212" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ], + [ + "page", + "O", + "Integer", + "请求页码,默认1。" + ], + [ + "limit", + "O", + "Integer", + "每页请求数目,最大100条每页,默认20条。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section39301550194610" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "CommentBaseResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "data", + "M", + "GetDevReviewRspData", + "返回评论列表详情。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section4770825143714" + } + ], + "title": "查询单个评论详情", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:56:39.782Z", + "family": "comments", + "endpoint": "com-getreviewinfo" +} diff --git a/pkg/domain/reference/comments/com-getreviewinfo.parameters.json b/pkg/domain/reference/comments/com-getreviewinfo.parameters.json new file mode 100644 index 0000000..cdab505 --- /dev/null +++ b/pkg/domain/reference/comments/com-getreviewinfo.parameters.json @@ -0,0 +1,35 @@ +[ + { + "name": "reviewId", + "in": "path", + "type": "string", + "required": true, + "description": "评论ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section3861044135212" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313" + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求页码,默认1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248#section1268762644313", + "maximum": 100 + } +] diff --git a/pkg/domain/reference/comments/com-rating-harmonyos.json b/pkg/domain/reference/comments/com-rating-harmonyos.json new file mode 100644 index 0000000..5a61018 --- /dev/null +++ b/pkg/domain/reference/comments/com-rating-harmonyos.json @@ -0,0 +1,302 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title303mcpsimp", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/marketing-api/v2/reviews/manage/dev/ratings?appid=100051813&beginTime=1730578852123&endTime=1730578952123&countries=CN \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer ***" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title386mcpsimp", + "text": "响应示例\n{ \n \"rtnCode\": 0, \n \"rtnDesc\": \"success\", \n \"score\": [ \n { \n \"countryCode\": \"CN\", \n \"averageScore\": 3.4, \n \"totalRatings\": 5, \n \"oneStarTimes\": 1, \n \"twoStarTimes\": 1, \n \"threeStarTimes\": 0, \n \"fourStarTimes\": 1, \n \"fiveStarTimes\": 2 \n } \n ], \n \"appRatings\": [ \n { \n \"reviewId\": \"1234567891011121314\", \n \"appVersion\": \"3.0.0\", \n \"phoneType\": \"Mate70 Pro\", \n \"rating\": 4, \n \"dateline\": 1730578912345, \n \"countryCode\": \"CN\" \n } \n ], \n \"hasNext\": 0, \n \"total\": 1 \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-commentapi-0000001115868340", + "title": "Comments API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-harmonyos-0000002470067188", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/platform-introduction-0000002306078829#section4713137951", + "title": "授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110)", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-ratingstat-0000002471053976", + "title": "RatingStat" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-apprating-0000002504053841", + "title": "AppRating" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974", + "title": "回复评论和回复" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-data-harmonyos-0000002470893978", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title103mcpsimp", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title106mcpsimp", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title112mcpsimp", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title151mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title264mcpsimp", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title303mcpsimp", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title306mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title386mcpsimp", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title389mcpsimp", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title103mcpsimp", + "text": "开发者查询对应鸿蒙应用下的评分列表。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title106mcpsimp", + "text": "接口调用者已进行过应用推广引擎平台账户登录操作。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title106mcpsimp", + "text": "接口调用者的角色:账号持有者以及经账号持有者授权了“管理评论”或“查看评论”的团队成员角色。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/marketing-api/v2/reviews/manage/dev/ratings?appId={appId}&beginTime={beginTime}&endTime={endTime}&countries={countries} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title112mcpsimp" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ], + [ + "beginTime", + "M", + "Long", + "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + ], + [ + "endTime", + "M", + "Long", + "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 说明 beginTime和endTime之间不能超过6个月的跨度。" + ], + [ + "countries", + "M", + "String", + "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + ], + [ + "ratings", + "O", + "String", + "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”,则查询所有评分为5的评论。 如果传递参数“4,5”,则查询所有评分为4和5的评论。" + ], + [ + "appVersions", + "O", + "String", + "应用版本(例:a.b.c),为应用市场中应用显示的版本号。 该参数不设置时,默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + ], + [ + "sort", + "O", + "Integer", + "排序方式,默认值:0。 0:BYTIME,按时间降序排序。 1:BYSCOREDESC,按分数降序排序。 2:BYSCOREASC,按分数升序排序。" + ], + [ + "page", + "O", + "Integer", + "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + ], + [ + "limit", + "O", + "Integer", + "每页请求数目,最大100条。每页默认50条。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title264mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。" + ], + [ + "rtnDesc", + "M", + "String", + "返回码描述信息。" + ], + [ + "score", + "M", + "RatingStat", + "综合评分列表。按国家区分的汇总结果,包括应用的综合评分、应用总评分数量和各评分等级的数量。" + ], + [ + "appRatings", + "M", + "AppRating", + "应用评分列表。评分的详细信息,包含评论ID、应用版本号、手机型号、评分、评分发表时间和ISO国家码。" + ], + [ + "hasNext", + "M", + "Long", + "是否有下一页,取值范围: 0:否 1:是" + ], + [ + "total", + "M", + "Long", + "总记录数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title306mcpsimp" + } + ], + "title": "查询应用评分列表", + "updatedAt": "2026-04-29 19:20", + "checkedAt": "2026-10-07T02:57:13.089Z", + "family": "comments", + "endpoint": "com-rating-harmonyos" +} diff --git a/pkg/domain/reference/comments/com-rating-harmonyos.parameters.json b/pkg/domain/reference/comments/com-rating-harmonyos.parameters.json new file mode 100644 index 0000000..80f2808 --- /dev/null +++ b/pkg/domain/reference/comments/com-rating-harmonyos.parameters.json @@ -0,0 +1,82 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp" + }, + { + "name": "beginTime", + "in": "query", + "type": "integer", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "format": "int64" + }, + { + "name": "endTime", + "in": "query", + "type": "integer", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 说明 beginTime和endTime之间不能超过6个月的跨度。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "format": "int64" + }, + { + "name": "countries", + "in": "query", + "type": "string", + "required": true, + "description": "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp" + }, + { + "name": "ratings", + "in": "query", + "type": "string", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”,则查询所有评分为5的评论。 如果传递参数“4,5”,则查询所有评分为4和5的评论。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp" + }, + { + "name": "appVersions", + "in": "query", + "type": "string", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。 该参数不设置时,默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp" + }, + { + "name": "sort", + "in": "query", + "type": "integer", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间降序排序。 1:BYSCOREDESC,按分数降序排序。 2:BYSCOREASC,按分数升序排序。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "enum": [ + "0", + "1", + "2" + ] + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "每页请求数目,最大100条。每页默认50条。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-harmonyos-0000002503933921#ZH-CN_TOPIC_0000002503933921__title153mcpsimp", + "maximum": 100 + } +] diff --git a/pkg/domain/reference/comments/com-rating.json b/pkg/domain/reference/comments/com-rating.json new file mode 100644 index 0000000..6a47af7 --- /dev/null +++ b/pkg/domain/reference/comments/com-rating.json @@ -0,0 +1,269 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section19934722144316", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/reviews/v1/manage/dev/ratings?appId=400461029&beginTime=1619798400000&endTime=1622476800000&countries=CN\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1977011318413", + "text": "响应示例\n{\n \"ret\": {\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\"\n },\n \"data\": {\n \"score\": [\n {\n \"country\": \"CN\",\n \"averageScore\": 3.609,\n \"totalRatings\": 23,\n \"fiveStarTimes\": 0,\n \"fourStarTimes\": 20,\n \"threeStarTimes\": 0,\n \"twoStarTimes\": 0,\n \"oneStarTimes\": 3\n }\n ],\n \"appRatings\": [\n {\n \"reviewId\": \"da44edb0272d465d95b7762d85f65b1f\",\n \"apkVersion\": \"1.0.1\",\n \"phoneType\": \"荣耀8青春版,HONOR8-LITE\",\n \"rating\": 4,\n \"dateline\": 1621456690064,\n \"countryCode\": \"CN\"\n },\n {\n \"reviewId\": \"321f6b4e9bba42ca8eba3431541a9f3e\",\n \"apkVersion\": \"1.0.2\",\n \"phoneType\": \"null,null\",\n \"rating\": 4,\n \"dateline\": 1621189961464,\n \"countryCode\": \"CN\"\n }\n ],\n \"hasNext\": 0,\n \"total\": 2\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-commentapi-0000001115868340", + "title": "Comments API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-api-0000002502827151", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-cbresult-0000001162468141", + "title": "CommentBaseResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-gdarrdata-0000001134972868", + "title": "GetDevAppRatingRspData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117", + "title": "回复评论和回复" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-data-0000001115868342", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section11985185416211", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section39301550194610", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1977011318413", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section11985185416211", + "text": "开发者查询对应应用下的评分列表及综合评分。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/reviews/v1/manage/dev/ratings?appId={appId}&beginTime={beginTime}&endTime={endTime}&countries={countries}&apkVersions={apkVersions}&rating={rating}&sort={sort}&page={page}&limit={limit} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section2862142512223" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ], + [ + "beginTime", + "M", + "Long", + "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + ], + [ + "endTime", + "M", + "Long", + "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 beginTime和endTime不能超过6个月的跨度。" + ], + [ + "countries", + "M", + "String", + "ISO国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + ], + [ + "apkVersions", + "O", + "String", + "应用版本(例:a.b.c),为应用市场中应用显示的版本号。该参数不设置时默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + ], + [ + "ratings", + "O", + "String", + "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”为查询所有评分为5的评论。 如果传递参数“4,5”为查询所有评分为4和5的评论。" + ], + [ + "sort", + "O", + "Integer", + "排序方式,默认值:0。 0:BYTIME,按时间排序。 1:BYSCOREDESC,按分数降序。 2:BYSCOREASC,按分数排序。" + ], + [ + "page", + "O", + "Integer", + "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + ], + [ + "limit", + "O", + "Integer", + "每页请求数目,最大100条每页,默认50条。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section39301550194610" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "CommentBaseResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "data", + "M", + "GetDevAppRatingRspData", + "返回综合评分列表和应用评分列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section4770825143714" + } + ], + "title": "查询应用评分", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:57:11.483Z", + "family": "comments", + "endpoint": "com-rating" +} diff --git a/pkg/domain/reference/comments/com-rating.parameters.json b/pkg/domain/reference/comments/com-rating.parameters.json new file mode 100644 index 0000000..72a7858 --- /dev/null +++ b/pkg/domain/reference/comments/com-rating.parameters.json @@ -0,0 +1,82 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313" + }, + { + "name": "beginTime", + "in": "query", + "type": "integer", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "format": "int64" + }, + { + "name": "endTime", + "in": "query", + "type": "integer", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 beginTime和endTime不能超过6个月的跨度。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "format": "int64" + }, + { + "name": "countries", + "in": "query", + "type": "string", + "required": true, + "description": "ISO国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313" + }, + { + "name": "apkVersions", + "in": "query", + "type": "string", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。该参数不设置时默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313" + }, + { + "name": "ratings", + "in": "query", + "type": "string", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”为查询所有评分为5的评论。 如果传递参数“4,5”为查询所有评分为4和5的评论。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313" + }, + { + "name": "sort", + "in": "query", + "type": "integer", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间排序。 1:BYSCOREDESC,按分数降序。 2:BYSCOREASC,按分数排序。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "enum": [ + "0", + "1", + "2" + ] + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "每页请求数目,最大100条每页,默认50条。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426#section1268762644313", + "maximum": 100 + } +] diff --git a/pkg/domain/reference/comments/com-reviewreply-harmonyos.json b/pkg/domain/reference/comments/com-reviewreply-harmonyos.json new file mode 100644 index 0000000..a8dfd17 --- /dev/null +++ b/pkg/domain/reference/comments/com-reviewreply-harmonyos.json @@ -0,0 +1,228 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title661mcpsimp", + "text": "请求示例\nPOST https://connect-api.cloud.huawei.com/api/marketing-api/v2/reviews/manage/dev/reviews \nclient_id: *** \nAuthorization: Bearer *** \nContent-Type: application/json \n{ \n \"lang\": \"zh\", \n \"appId\": \"11111\", \n \"reviewId\": \"9f43c56228854d66a65921938199c0ce\", \n \"devReplyContent\": \"Reply content......\", \n \"countryCode\": \"CN\" \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title701mcpsimp", + "text": "响应示例\n{ \n \"rtnCode\": 0, \n \"rtnDesc\": \"string\" \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/platform-introduction-0000002306078829#section4713137951", + "title": "授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title492mcpsimp", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title495mcpsimp", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title501mcpsimp", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title540mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title622mcpsimp", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title661mcpsimp", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title664mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title701mcpsimp", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title704mcpsimp", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title492mcpsimp", + "text": "开发者在自己的鸿蒙应用下回复用户的评论,并支持继续回复用户的回复。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title495mcpsimp", + "text": "接口调用者已进行过应用推广引擎平台账户登录操作。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title495mcpsimp", + "text": "接口调用者的角色:账号持有者以及经账号持有者授权了“管理评论”或“查看评论”的团队成员角色。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/marketing-api/v2/reviews/manage/dev/reviews 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title501mcpsimp" + }, + { + "location": "body", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "lang", + "M", + "String", + "语言,支持: zh:中文 en:英文 bo:藏语 ug:维吾尔语" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ], + [ + "reviewId", + "M", + "Long", + "评论ID。" + ], + [ + "devReplyContent", + "M", + "String", + "回复内容。" + ], + [ + "countryCode", + "M", + "String", + "ISO标准国家码。" + ], + [ + "toReplyId", + "O", + "String", + "回复ID。 说明 非必传参数,传递这个参数说明回复的是用户的回复。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title622mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。" + ], + [ + "rtnDesc", + "M", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title664mcpsimp" + } + ], + "title": "回复评论和回复", + "updatedAt": "2026-07-30 11:38", + "checkedAt": "2026-10-07T02:57:15.378Z", + "family": "comments", + "endpoint": "com-reviewreply-harmonyos" +} diff --git a/pkg/domain/reference/comments/com-reviewreply-harmonyos.parameters.json b/pkg/domain/reference/comments/com-reviewreply-harmonyos.parameters.json new file mode 100644 index 0000000..42d1588 --- /dev/null +++ b/pkg/domain/reference/comments/com-reviewreply-harmonyos.parameters.json @@ -0,0 +1,57 @@ +[ + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,支持: zh:中文 en:英文 bo:藏语 ug:维吾尔语", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "enum": [ + "zh", + "en", + "bo", + "ug" + ] + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp" + }, + { + "name": "reviewId", + "in": "body", + "type": "integer", + "required": true, + "description": "评论ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp", + "format": "int64" + }, + { + "name": "devReplyContent", + "in": "body", + "type": "string", + "required": true, + "description": "回复内容。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp" + }, + { + "name": "countryCode", + "in": "body", + "type": "string", + "required": true, + "description": "ISO标准国家码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp" + }, + { + "name": "toReplyId", + "in": "body", + "type": "string", + "required": false, + "description": "回复ID。 说明 非必传参数,传递这个参数说明回复的是用户的回复。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-harmonyos-0000002471053974#ZH-CN_TOPIC_0000002471053974__title542mcpsimp" + } +] diff --git a/pkg/domain/reference/comments/com-reviewreply.json b/pkg/domain/reference/comments/com-reviewreply.json new file mode 100644 index 0000000..b9caa66 --- /dev/null +++ b/pkg/domain/reference/comments/com-reviewreply.json @@ -0,0 +1,257 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section19934722144316", + "text": "请求示例\nPOST https://connect-api.cloud.huawei.com/api/reviews/v1/manage/dev/reviews\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nrequestId: xxxxxxx\n\n\n\n\n{\n \"lang\": \"zh_CN\",\n \"appId\": \"300148173\",\n \"reviewId\": \"9f43c56228854d66a65921938199c0ce\",\n \"devReplyContent\": \"Reply content......\",\n \"countryCode\": \"CN\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section1977011318413", + "text": "响应示例\n{\n \"ret\": {\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-commentapi-0000001115868340", + "title": "Comments API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-api-0000002502827151", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-cbresult-0000001162468141", + "title": "CommentBaseResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248", + "title": "查询单个评论详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-rating-0000001133889426", + "title": "查询应用评分" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section11985185416211", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section62259187482", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section1977011318413", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section11985185416211", + "text": "开发者在自己的应用下回复用户的评论,并继续回复用户的回复。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/reviews/v1/manage/dev/reviews 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "requestId", + "M", + "String(header)", + "请求ID,最大长度64个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section62259187482" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String", + "语言(例:zh_CN),由语言(采用ISO-639-1标准)和国家/地区代码(参考国家码)中间加下划线\"_\"组成。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ], + [ + "reviewId", + "M", + "String", + "评论ID。" + ], + [ + "devReplyContent", + "M", + "String", + "回复内容。" + ], + [ + "countryCode", + "M", + "String", + "ISO标准国家码,取值请参考国家码。" + ], + [ + "toReplyId", + "O", + "String", + "回复ID(非必传参数,传递这个参数说明回复的是用户的回复)。" + ], + [ + "updateReplyId", + "O", + "String", + "回复ID(非必传参数,传递这个参数说明是对回复的修改)。 toReplyId和updateReplyId不能同时传递。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "CommentBaseResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section4770825143714" + } + ], + "title": "回复评论和回复", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:57:14.451Z", + "family": "comments", + "endpoint": "com-reviewreply" +} diff --git a/pkg/domain/reference/comments/com-reviewreply.parameters.json b/pkg/domain/reference/comments/com-reviewreply.parameters.json new file mode 100644 index 0000000..9e5868c --- /dev/null +++ b/pkg/domain/reference/comments/com-reviewreply.parameters.json @@ -0,0 +1,67 @@ +[ + { + "name": "requestId", + "in": "header", + "type": "string", + "required": true, + "description": "请求ID,最大长度64个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section62259187482", + "maxLength": 64 + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言(例:zh_CN),由语言(采用ISO-639-1标准)和国家/地区代码(参考国家码)中间加下划线\"_\"组成。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + }, + { + "name": "reviewId", + "in": "body", + "type": "string", + "required": true, + "description": "评论ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + }, + { + "name": "devReplyContent", + "in": "body", + "type": "string", + "required": true, + "description": "回复内容。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + }, + { + "name": "countryCode", + "in": "body", + "type": "string", + "required": true, + "description": "ISO标准国家码,取值请参考国家码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + }, + { + "name": "toReplyId", + "in": "body", + "type": "string", + "required": false, + "description": "回复ID(非必传参数,传递这个参数说明回复的是用户的回复)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + }, + { + "name": "updateReplyId", + "in": "body", + "type": "string", + "required": false, + "description": "回复ID(非必传参数,传递这个参数说明是对回复的修改)。 toReplyId和updateReplyId不能同时传递。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488" + } +] diff --git a/pkg/domain/reference/comments/com-reviewreply.rules.json b/pkg/domain/reference/comments/com-reviewreply.rules.json new file mode 100644 index 0000000..2b77631 --- /dev/null +++ b/pkg/domain/reference/comments/com-reviewreply.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "reply-target-exclusive", + "kind": "at_most_one", + "fields": [ + "body.toReplyId", + "body.updateReplyId" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-reviewreply-0000001162548117#section739714276488", + "message": "toReplyId and updateReplyId cannot both be supplied.", + "suggestion": "Choose whether to reply to a user reply or modify an existing developer reply, and provide only its corresponding ID." + } +] diff --git a/pkg/domain/reference/comments/comapi-getreviews-harmonyos.json b/pkg/domain/reference/comments/comapi-getreviews-harmonyos.json new file mode 100644 index 0000000..48c67c0 --- /dev/null +++ b/pkg/domain/reference/comments/comapi-getreviews-harmonyos.json @@ -0,0 +1,310 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1142mcpsimp", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/marketing-api/v2/reviews/manage/dev/reviews?appid=100051813&beginTime=1730578852123&endTime=1730578952123&countries=CN \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer ***" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1214mcpsimp", + "text": "响应示例\n{ \n \"rtnCode\": 0, \n \"rtnDesc\": \"success\", \n \"data\": [ \n { \n \"content\": \"Comment content......\", \n \"reviewId\": \"1234567891011121314\", \n \"appVersion\": \"3.0.0\", \n \"phoneType\": \"Mate70 Pro\", \n \"rating\": 3, \n \"likes\": 0, \n \"replies\": 0, \n \"dateline\": 1730578912345, \n \"auditState\": 3, \n \"devReplyContent\": \"ReplyContent......\", \n \"countryCode\": \"CN\" \n } \n ], \n \"hasNext\": 0, \n \"total\": 1 \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-commentapi-0000001115868340", + "title": "Comments API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-harmonyos-0000002470067188", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/platform-introduction-0000002306078829#section4713137951", + "title": "授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110)", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-replyinfo-0000002503933923", + "title": "ReviewInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-harmonyos-0000002470067188", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-harmonyos-0000002504053839", + "title": "查询单个评论详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title908mcpsimp", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title911mcpsimp", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title917mcpsimp", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title956mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1103mcpsimp", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1142mcpsimp", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1145mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1214mcpsimp", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1217mcpsimp", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title908mcpsimp", + "text": "开发者查询对应鸿蒙应用下的评论列表。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title911mcpsimp", + "text": "接口调用者已进行过应用推广引擎平台账户登录操作。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title911mcpsimp", + "text": "接口调用者的角色:账号持有者以及经账号持有者授权了“管理评论”或“查看评论”的团队成员角色。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/marketing-api/v2/reviews/manage/dev/reviews?appId={appId}&beginTime={beginTime}&endTime={endTime}&countries={countries} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title917mcpsimp" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ], + [ + "content", + "O", + "String", + "评论内容的关键词,支持模糊匹配。" + ], + [ + "beginTime", + "M", + "Long", + "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + ], + [ + "endTime", + "M", + "Long", + "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 说明 beginTime和endTime之间不能超过6个月的跨度。" + ], + [ + "countries", + "M", + "String", + "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + ], + [ + "ratings", + "O", + "String", + "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”,则查询所有评分为5的评论。 如果传递参数“4,5”,则查询所有评分为4和5的评论。" + ], + [ + "appVersions", + "O", + "String", + "应用版本(例:a.b.c),为应用市场中应用显示的版本号。 该参数不设置时,默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + ], + [ + "devReplyStates", + "O", + "String", + "答复状态,该参数不设置时默认查询所有答复状态的评论内容。 0:未答复,用户提交评论后的状态。 1:已答复,开发者已针对该评论发表了答复。 6:用户追加回复开发者,用户针对开发者的答复内容进行了追加回复。 3:答复内容被回复,开发者针对用户追加的回复进行了答复。 可以查询多个答复状态的评论数据,多个答复状态之间使用英文逗号分隔。" + ], + [ + "langs", + "O", + "String", + "语言(例:zh),采用ISO-639-1标准。 该参数不设置时默认查询所有语言类型的评论内容,否则请设置具体语言,查询多个语言的评论内容时使用英文逗号分隔。" + ], + [ + "sort", + "O", + "Integer", + "排序方式,默认值:0。 0:BYTIME,按时间降序排序。 1:BYSCOREDESC,按分数降序排序。 2:BYSCOREASC,按分数升序排序。" + ], + [ + "page", + "O", + "Integer", + "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + ], + [ + "limit", + "O", + "Integer", + "每页请求数目,最大100条每页,默认20条。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1103mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。" + ], + [ + "rtnDesc", + "M", + "String", + "返回码描述信息。" + ], + [ + "data", + "M", + "ReviewInfo", + "评论列表详情。" + ], + [ + "hasNext", + "M", + "Long", + "是否有下一页,取值范围: 0:否 1:是" + ], + [ + "total", + "M", + "Long", + "总记录数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title1145mcpsimp" + } + ], + "title": "查询应用评论列表", + "updatedAt": "2026-04-29 19:20", + "checkedAt": "2026-10-07T02:57:18.274Z", + "family": "comments", + "endpoint": "comapi-getreviews-harmonyos" +} diff --git a/pkg/domain/reference/comments/comapi-getreviews-harmonyos.parameters.json b/pkg/domain/reference/comments/comapi-getreviews-harmonyos.parameters.json new file mode 100644 index 0000000..ae6ff84 --- /dev/null +++ b/pkg/domain/reference/comments/comapi-getreviews-harmonyos.parameters.json @@ -0,0 +1,106 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "content", + "in": "query", + "type": "string", + "required": false, + "description": "评论内容的关键词,支持模糊匹配。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "beginTime", + "in": "query", + "type": "integer", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "format": "int64" + }, + { + "name": "endTime", + "in": "query", + "type": "integer", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 说明 beginTime和endTime之间不能超过6个月的跨度。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "format": "int64" + }, + { + "name": "countries", + "in": "query", + "type": "string", + "required": true, + "description": "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "ratings", + "in": "query", + "type": "string", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”,则查询所有评分为5的评论。 如果传递参数“4,5”,则查询所有评分为4和5的评论。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "appVersions", + "in": "query", + "type": "string", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。 该参数不设置时,默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "devReplyStates", + "in": "query", + "type": "string", + "required": false, + "description": "答复状态,该参数不设置时默认查询所有答复状态的评论内容。 0:未答复,用户提交评论后的状态。 1:已答复,开发者已针对该评论发表了答复。 6:用户追加回复开发者,用户针对开发者的答复内容进行了追加回复。 3:答复内容被回复,开发者针对用户追加的回复进行了答复。 可以查询多个答复状态的评论数据,多个答复状态之间使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "langs", + "in": "query", + "type": "string", + "required": false, + "description": "语言(例:zh),采用ISO-639-1标准。 该参数不设置时默认查询所有语言类型的评论内容,否则请设置具体语言,查询多个语言的评论内容时使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "sort", + "in": "query", + "type": "integer", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间降序排序。 1:BYSCOREDESC,按分数降序排序。 2:BYSCOREASC,按分数升序排序。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "enum": [ + "0", + "1", + "2" + ] + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-harmonyos-0000002470893976#ZH-CN_TOPIC_0000002470893976__title958mcpsimp", + "maximum": 100 + } +] diff --git a/pkg/domain/reference/comments/comapi-getreviews.json b/pkg/domain/reference/comments/comapi-getreviews.json new file mode 100644 index 0000000..7bb35e4 --- /dev/null +++ b/pkg/domain/reference/comments/comapi-getreviews.json @@ -0,0 +1,297 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section157915456533", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/reviews/v1/manage/dev/reviews?appid=100051813&beginTime=1590578852123&endTime=1590578952123&countries=CN\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section1977011318413", + "text": "响应示例\n{\n \"ret\": {\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\"\n },\n \"data\": {\n \"reviewList\": [\n {\n \"content\": \"Comment content......\",\n \"reviewId\": \"89c5a05cf28d4c6f93aea2badb24fddb\",\n \"apkVersion\": \"10.5.3\",\n \"phoneType\": \"HONOR8-LITE\",\n \"rating\": 3,\n \"likes\": 0,\n \"replies\": 0,\n \"dateline\": 1590578852123,\n \"auditState\": \"3\",\n \"devReplyContent\": null,\n \"countryCode\": \"CN\"\n },\n {\n \"content\": \"Comment content......\",\n \"reviewId\": \"9f43c56228854d66a65921938199c0ce\",\n \"apkVersion\": \"10.5.3\",\n \"phoneType\": \"HONOR8-LITE\",\n \"rating\": 3,\n \"likes\": 0,\n \"replies\": 2,\n \"dateline\": 1590564388000,\n \"auditState\": \"3\",\n \"devReplyContent\": \"Reply 0086138******48: Reply content......\",\n \"countryCode\": \"CN\"\n }\n ],\n \"hasNext\": 0,\n \"total\": 2\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-commentapi-0000001115868340", + "title": "Comments API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-api-0000002502827151", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-cbresult-0000001162468141", + "title": "CommentBaseResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-qdrrdata-0000001162468143", + "title": "QueryDevReviewsRspData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comment-api-0000002502827151", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-com-getreviewinfo-0000001116028248", + "title": "查询单个评论详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section11985185416211", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section183741724913", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section157915456533", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section1977011318413", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section11985185416211", + "text": "开发者查询对应应用下的评论列表。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->应用市场服务端" + ], + [ + "接口URL", + "https://{domain}/api/reviews/v1/manage/dev/reviews?appId={appId}&beginTime={beginTime}&endTime={endTime}&countries={countries} 中国站点的domain:connect-api.cloud.huawei.com 德国站点的domain:connect-api-dre.cloud.huawei.com 新加坡站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section2862142512223" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ], + [ + "content", + "O", + "String", + "评论内容的关键词,支持模糊匹配。" + ], + [ + "beginTime", + "M", + "Long", + "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。" + ], + [ + "endTime", + "M", + "Long", + "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 beginTime和endTime不能超过6个月的跨度。" + ], + [ + "countries", + "M", + "String", + "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。" + ], + [ + "ratings", + "O", + "String", + "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”为查询所有评分为5的评论。 如果传递参数“4,5”为查询所有评分为4和5的评论。" + ], + [ + "apkVersions", + "O", + "String", + "应用版本(例:a.b.c),为应用市场中应用显示的版本号。该参数不设置时默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。" + ], + [ + "auditStates", + "O", + "String", + "已废弃。 审核状态,该参数不设置时默认查询所有审核状态的评论内容。" + ], + [ + "devReplyStates", + "O", + "String", + "答复状态,该参数不设置时默认查询所有答复状态的评论内容。 0:未答复,用户提交评论后的状态。 1:已答复,开发者已针对该评论发表了答复。 6:用户追加回复开发者,用户针对开发者的答复内容进行了追加回复。 3:答复内容被回复,开发者针对用户追加的回复进行了答复。 可以查询多个答复状态的评论数据,多个答复状态之间使用英文逗号分隔。" + ], + [ + "langs", + "O", + "String", + "语言(例:zh_CN),由语言(采用ISO-639-1标准)和国家/地区代码(参考国家码)中间加下划线\"_\"组成。 该参数不设置时默认查询所有语言类型的评论内容,否则请设置具体语言,查询多个语言的评论内容时使用英文逗号分隔。" + ], + [ + "sort", + "O", + "Integer", + "排序方式,默认值:0。 0:BYTIME,按时间排序。 1:BYSCOREDESC,按分数降序。 2:BYSCOREASC,按分数排序。" + ], + [ + "page", + "O", + "Integer", + "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。" + ], + [ + "limit", + "O", + "Integer", + "每页请求数目,最大100条每页,默认20条。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section183741724913" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "CommentBaseResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "data", + "M", + "QueryDevReviewsRspData", + "返回评论列表详情。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section4770825143714" + } + ], + "title": "查询评论列表", + "updatedAt": "2025-10-24 16:14", + "checkedAt": "2026-10-07T02:57:17.010Z", + "family": "comments", + "endpoint": "comapi-getreviews" +} diff --git a/pkg/domain/reference/comments/comapi-getreviews.parameters.json b/pkg/domain/reference/comments/comapi-getreviews.parameters.json new file mode 100644 index 0000000..21ba6bc --- /dev/null +++ b/pkg/domain/reference/comments/comapi-getreviews.parameters.json @@ -0,0 +1,114 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "content", + "in": "query", + "type": "string", + "required": false, + "description": "评论内容的关键词,支持模糊匹配。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "beginTime", + "in": "query", + "type": "integer", + "required": true, + "description": "开始时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "format": "int64" + }, + { + "name": "endTime", + "in": "query", + "type": "integer", + "required": true, + "description": "结束时间的时间戳,从1970/01/01 08:00:00开始计算的毫秒数。 beginTime和endTime不能超过6个月的跨度。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "format": "int64" + }, + { + "name": "countries", + "in": "query", + "type": "string", + "required": true, + "description": "国家码(例如:CN),多个国家码使用英文逗号分隔,但一次只能查询同一站点内的国家。取值请参考国家码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "ratings", + "in": "query", + "type": "string", + "required": false, + "description": "评分(1~5),该参数不设置时默认查询所有评分的评论内容,否则请设置具体评分,查询多个评分的评论内容时使用英文逗号分隔。 例如: 如果传递参数“5”为查询所有评分为5的评论。 如果传递参数“4,5”为查询所有评分为4和5的评论。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "apkVersions", + "in": "query", + "type": "string", + "required": false, + "description": "应用版本(例:a.b.c),为应用市场中应用显示的版本号。该参数不设置时默认查询所有版本的评论内容,否则请设置具体版本,查询多个版本的评论内容时使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "auditStates", + "in": "query", + "type": "string", + "required": false, + "description": "已废弃。 审核状态,该参数不设置时默认查询所有审核状态的评论内容。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "devReplyStates", + "in": "query", + "type": "string", + "required": false, + "description": "答复状态,该参数不设置时默认查询所有答复状态的评论内容。 0:未答复,用户提交评论后的状态。 1:已答复,开发者已针对该评论发表了答复。 6:用户追加回复开发者,用户针对开发者的答复内容进行了追加回复。 3:答复内容被回复,开发者针对用户追加的回复进行了答复。 可以查询多个答复状态的评论数据,多个答复状态之间使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "langs", + "in": "query", + "type": "string", + "required": false, + "description": "语言(例:zh_CN),由语言(采用ISO-639-1标准)和国家/地区代码(参考国家码)中间加下划线\"_\"组成。 该参数不设置时默认查询所有语言类型的评论内容,否则请设置具体语言,查询多个语言的评论内容时使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "sort", + "in": "query", + "type": "integer", + "required": false, + "description": "排序方式,默认值:0。 0:BYTIME,按时间排序。 1:BYSCOREDESC,按分数降序。 2:BYSCOREASC,按分数排序。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "enum": [ + "0", + "1", + "2" + ] + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求查询的页码,默认1。 例如,查询时page配置为2,limit配置为20,表示返回时每页显示20条评论数据,当前查询第2页。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "每页请求数目,最大100条每页,默认20条。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-comapi-getreviews-0000001162468139#section126711053144817", + "maximum": 100 + } +] diff --git a/pkg/domain/reference/domains/domain-api-download-domain-config.json b/pkg/domain/reference/domains/domain-api-download-domain-config.json new file mode 100644 index 0000000..a37c5b6 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-download-domain-config.json @@ -0,0 +1,269 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section162251741185115", + "text": "请求示例\nGET /api/dms/domain-manage/v1/app/domain/verify-file HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer *******\n appId: 10******57" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section14178457143617", + "text": "响应示例\n\n无" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326", + "title": "查询域名修改次数/配置上限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522", + "title": "预检查业务域名配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section7163155161617", + "title": "服务器域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section5605815161218", + "title": "业务域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section16817111413112", + "text": "此接口用于以文件流的形式进行直接下载域名配置文件。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section7163155161617", + "text": "同一个元服务每个自然月服务器域名修改次数,默认为50次。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section7163155161617", + "text": "单项服务器域名配置数量最多不超过200个。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section7163155161617", + "text": "域名只支持HTTPS和WSS协议。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section7163155161617", + "text": "域名不能使用IP地址或localhost。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section7163155161617", + "text": "不可配置全局禁止清单内的域名。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section5605815161218", + "text": "同一个元服务每个自然月业务域名修改次数,默认为50次。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section5605815161218", + "text": "同一个APPID下,最多支持配置100个业务域名;同一个业务域名最多可配置100个APPID。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section5605815161218", + "text": "域名只支持HTTPS协议。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section5605815161218", + "text": "网页内iframe的域名也需要配置。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section9752647125217", + "text": "通过InputStream文件流返回校验文件内容。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/dms/domain-manage/v1/app/domain/verify-file" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165" + } + ], + "title": "下载域名配置文件", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:15.982Z", + "family": "domains", + "endpoint": "domain-api-download-domain-config" +} diff --git a/pkg/domain/reference/domains/domain-api-download-domain-config.parameters.json b/pkg/domain/reference/domains/domain-api-download-domain-config.parameters.json new file mode 100644 index 0000000..173db52 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-download-domain-config.parameters.json @@ -0,0 +1,11 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-download-domain-config-0000002271160653#section236517415165", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/domains/domain-api-get-domain-config.json b/pkg/domain/reference/domains/domain-api-get-domain-config.json new file mode 100644 index 0000000..9098efd --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-get-domain-config.json @@ -0,0 +1,300 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section162251741185115", + "text": "请求示例\n GET /api/dms/domain-manage/v1/app/domain/config?appId=10*****57 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer *******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section14178457143617", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"configs\": [\n {\n \"appId\": \"string\",\n \"appName\": \"string\",\n \"modifyCounts\": 0,\n \"serverDomainCounts\": 0,\n \"businessDomainCounts\": 0,\n \"updateTime\": 0\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-connectret-0000002272462489", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-appdomainconfig-0000002237503148", + "title": "AppDomainConfig" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522", + "title": "新增/更新元服务的域名配置信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653", + "title": "下载域名配置文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section1572199315", + "title": "服务器域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section5605815161218", + "title": "业务域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section16817111413112", + "text": "此接口用于查询域名修改次数、配置上限等信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section1572199315", + "text": "同一个元服务每个自然月服务器域名修改次数,默认为50次。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section1572199315", + "text": "单项服务器域名配置数量最多不超过200个。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section1572199315", + "text": "域名只支持HTTPS和WSS协议。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section1572199315", + "text": "域名不能使用IP地址或localhost。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section1572199315", + "text": "不可配置全局禁止清单内的域名。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section5605815161218", + "text": "同一个元服务每个自然月业务域名修改次数,默认为50次。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section5605815161218", + "text": "同一个APPID下,最多支持配置100个业务域名;同一个业务域名最多可配置100个APPID。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section5605815161218", + "text": "域名只支持HTTPS协议。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section5605815161218", + "text": "网页内iframe的域名也需要配置。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/dms/domain-manage/v1/app/domain/config" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section119494174419" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "元服务的应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "configs", + "O", + "List", + "元服务的域名配置信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section9752647125217" + } + ], + "title": "查询域名修改次数/配置上限", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:18.730Z", + "family": "domains", + "endpoint": "domain-api-get-domain-config" +} diff --git a/pkg/domain/reference/domains/domain-api-get-domain-config.parameters.json b/pkg/domain/reference/domains/domain-api-get-domain-config.parameters.json new file mode 100644 index 0000000..2ce30a7 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-get-domain-config.parameters.json @@ -0,0 +1,11 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "元服务的应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-config-0000002236201326#section886219295206", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/domains/domain-api-get-domain.json b/pkg/domain/reference/domains/domain-api-get-domain.json new file mode 100644 index 0000000..4dea6f1 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-get-domain.json @@ -0,0 +1,326 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section162251741185115", + "text": "请求示例\n GET /api/dms/domain-manage/v1/app/domain?category=server HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId: 10******57" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section14178457143617", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"modifyCounts\": 0,\n \"domains\": [\n {\n \"type\": \"httpRequest\",\n \"value\": \"string\",\n \"errorCode\": 0,\n \"errorMsg\": \"string\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-connectret-0000002272462489", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "title": "DomainInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522", + "title": "新增/更新元服务的域名配置信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section1572199315", + "title": "服务器域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section5605815161218", + "title": "业务域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section16817111413112", + "text": "此接口用于查询元服务的域名配置信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section1572199315", + "text": "同一个元服务每个自然月服务器域名修改次数,默认为50次。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section1572199315", + "text": "单项服务器域名配置数量最多不超过200个。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section1572199315", + "text": "域名只支持HTTPS和WSS协议。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section1572199315", + "text": "域名不能使用IP地址或localhost。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section1572199315", + "text": "不可配置全局禁止清单内的域名。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section5605815161218", + "text": "同一个元服务每个自然月业务域名修改次数,默认为50次。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section5605815161218", + "text": "同一个APPID下,最多支持配置100个业务域名;同一个业务域名最多可配置100个APPID。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section5605815161218", + "text": "域名只支持HTTPS协议。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section5605815161218", + "text": "网页内iframe的域名也需要配置。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/dms/domain-manage/v1/app/domain" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "category", + "M", + "String(32)", + "域名分类。 取值范围: server:服务器域名 business:业务域名" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "modifyCounts", + "O", + "Integer(32)", + "已修改次数。" + ], + [ + "domains", + "O", + "List", + "不合法的域名列表。 当ret为成功的时候存在,供前台按需展示。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section9752647125217" + } + ], + "title": "查询元服务的域名配置信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:17.291Z", + "family": "domains", + "endpoint": "domain-api-get-domain" +} diff --git a/pkg/domain/reference/domains/domain-api-get-domain.parameters.json b/pkg/domain/reference/domains/domain-api-get-domain.parameters.json new file mode 100644 index 0000000..67bde29 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-get-domain.parameters.json @@ -0,0 +1,24 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section236517415165", + "maxLength": 32 + }, + { + "name": "category", + "in": "query", + "type": "string", + "required": true, + "description": "域名分类。 取值范围: server:服务器域名 business:业务域名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-get-domain-0000002271000701#section886219295206", + "maxLength": 32, + "enum": [ + "server", + "business" + ] + } +] diff --git a/pkg/domain/reference/domains/domain-api-post-domain.json b/pkg/domain/reference/domains/domain-api-post-domain.json new file mode 100644 index 0000000..1394940 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-post-domain.json @@ -0,0 +1,403 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section162251741185115", + "text": "请求示例\n POST /api/dms/domain-manage/v1/app/domain?category=server HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer *******\n appId: 10******57\n {\n \"domains\": [\n {\n \"type\": \"httpRequest\",\n \"value\": \"string\"\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section14178457143617", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"invalidDomains\": [\n {\n \"type\": \"httpRequest\",\n \"value\": \"string\",\n \"errorCode\": 0,\n \"errorMsg\": \"string\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522", + "title": "预检查业务域名配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "title": "DomainInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-connectret-0000002272462489", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "title": "DomainInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-0000002271000701", + "title": "查询元服务的域名配置信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-get-domain-config-0000002236201326", + "title": "查询域名修改次数/配置上限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section1572199315", + "title": "服务器域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section5605815161218", + "title": "业务域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-post-domain-0000002236041522#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section16817111413112", + "text": "此接口用于新增/更新元服务的域名配置信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section16817111413112", + "text": "新增超过10个业务域名时,建议先调用预检查业务域名配置接口确认是否可以新增成功。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section1572199315", + "text": "同一个元服务每个自然月服务器域名修改次数,默认为50次。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section1572199315", + "text": "单项服务器域名配置数量最多不超过200个。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section1572199315", + "text": "域名只支持HTTPS和WSS协议。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section1572199315", + "text": "域名不能使用IP地址或localhost。" + }, + { + "section": "服务器域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section1572199315", + "text": "不可配置全局禁止清单内的域名。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section5605815161218", + "text": "同一个元服务每个自然月业务域名修改次数,默认为50次。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section5605815161218", + "text": "同一个APPID下,最多支持配置100个业务域名;同一个业务域名最多可配置100个APPID。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section5605815161218", + "text": "域名只支持HTTPS协议。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section5605815161218", + "text": "网页内iframe的域名也需要配置。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section141117691213", + "text": "请求Body中使用JSON格式携带域名信息,参数如下表所示。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section9752647125217", + "text": "DomainInfo" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/dms/domain-manage/v1/app/domain" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "category", + "M", + "String(32)", + "域名分类。 取值范围: server:服务器域名 business:业务域名" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section886219295206" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "domains", + "O", + "List", + "域名全量数据。 集合长度最大3000。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "invalidDomains", + "O", + "List", + "不合法的域名列表。 当ret不为成功的时候存在。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section9752647125217" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "type", + "M", + "String(32)", + "域名类型。 取值范围: httpRequest:httpRequest服务器域名 upload:upload服务器域名 download:download服务器域名 webSocket:webSocket服务器域名 webView:webView业务域名" + ], + [ + "value", + "M", + "String(128)", + "域名。 请输入完整的域名。 示例:https://baidu.com:8080。" + ], + [ + "errorCode", + "O", + "Integer(32)", + "非法原因错误码。 新增、修改域名时如果域名不合法,返回失败原因,调用接口新增修改域名配置时无需传入。" + ], + [ + "errorMsg", + "O", + "String(128)", + "非法原因错误描述。 新增、修改域名时如果域名不合法,返回失败原因,调用接口新增修改域名配置时无需传入。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section9752647125217" + } + ], + "title": "新增/更新元服务的域名配置信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:49.804Z", + "family": "domains", + "endpoint": "domain-api-post-domain" +} diff --git a/pkg/domain/reference/domains/domain-api-post-domain.parameters.json b/pkg/domain/reference/domains/domain-api-post-domain.parameters.json new file mode 100644 index 0000000..8c17f81 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-post-domain.parameters.json @@ -0,0 +1,61 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section236517415165", + "maxLength": 32 + }, + { + "name": "category", + "in": "query", + "type": "string", + "required": true, + "description": "域名分类。 取值范围: server:服务器域名 business:业务域名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section886219295206", + "maxLength": 32, + "enum": [ + "server", + "business" + ] + }, + { + "name": "domains", + "in": "body", + "type": "array", + "required": false, + "description": "域名全量数据。 集合长度最大3000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-post-domain-0000002236041522#section141117691213", + "itemsType": "object", + "maxItems": 3000, + "itemsProperties": [ + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "description": "域名类型。 取值范围: httpRequest:httpRequest服务器域名 upload:upload服务器域名 download:download服务器域名 webSocket:webSocket服务器域名 webView:webView业务域名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "maxLength": 32, + "enum": [ + "httpRequest", + "upload", + "download", + "webSocket", + "webView" + ] + }, + { + "name": "value", + "in": "body", + "type": "string", + "required": true, + "description": "完整的域名。例如: https://huawei.com:8080", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "maxLength": 128 + } + ] + } +] diff --git a/pkg/domain/reference/domains/domain-api-precheck.json b/pkg/domain/reference/domains/domain-api-precheck.json new file mode 100644 index 0000000..5c21884 --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-precheck.json @@ -0,0 +1,295 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section162251741185115", + "text": "请求示例\n POST /api/dms/domain-manage/v1/app/domain/pre-check HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer *******\n appId: 10******57\n {\n \"domain\": {\n \"type\": \"webView\",\n \"value\": \"https://huawei.com:8080\"\n }\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section14178457143617", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "title": "DomainInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-connectret-0000002272462489", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-download-domain-config-0000002271160653", + "title": "下载域名配置文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-0000002237343328", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section5605815161218", + "title": "业务域名配置约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-precheck-0000002295134522#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section16817111413112", + "text": "此接口用于对业务域名配置进行预检查。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section5605815161218", + "text": "同一个元服务每个自然月业务域名修改次数,默认为50次。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section5605815161218", + "text": "同一个APPID下,最多支持配置100个业务域名;同一个业务域名最多可配置100个APPID。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section5605815161218", + "text": "域名只支持HTTPS协议。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section5605815161218", + "text": "域名不能使用IP地址或localhost。" + }, + { + "section": "业务域名配置约束与限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section5605815161218", + "text": "网页内iframe的域名也需要配置。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section141117691213", + "text": "请求Body中使用JSON格式携带业务域名信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/dms/domain-manage/v1/app/domain/pre-check" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "domain", + "O", + "DomainInfo", + "业务域名信息。 说明 type必须设置为webView。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section9752647125217" + } + ], + "title": "预检查业务域名配置", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:50.960Z", + "family": "domains", + "endpoint": "domain-api-precheck" +} diff --git a/pkg/domain/reference/domains/domain-api-precheck.parameters.json b/pkg/domain/reference/domains/domain-api-precheck.parameters.json new file mode 100644 index 0000000..c0593ae --- /dev/null +++ b/pkg/domain/reference/domains/domain-api-precheck.parameters.json @@ -0,0 +1,42 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section236517415165", + "maxLength": 32 + }, + { + "name": "domain", + "in": "body", + "type": "object", + "required": false, + "description": "业务域名信息。 说明 type必须设置为webView。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-domain-api-precheck-0000002295134522#section141117691213", + "properties": [ + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "description": "域名类型。 取值范围: httpRequest:httpRequest服务器域名 upload:upload服务器域名 download:download服务器域名 webSocket:webSocket服务器域名 webView:webView业务域名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "maxLength": 32, + "enum": [ + "webView" + ] + }, + { + "name": "value", + "in": "body", + "type": "string", + "required": true, + "description": "完整的域名。例如: https://huawei.com:8080", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "maxLength": 128 + } + ] + } +] diff --git a/pkg/domain/reference/functions/create-alias.json b/pkg/domain/reference/functions/create-alias.json new file mode 100644 index 0000000..243d1ff --- /dev/null +++ b/pkg/domain/reference/functions/create-alias.json @@ -0,0 +1,261 @@ +{ + "title": "create-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/aliasApi.js", + "sha256": "3340b3b361b3805c80ec197b547653f88a83322bc7a3d57f10e8f901c35e4814", + "source": "import constants from\"../constants/constants.js\";import{isEmpty}from\"../util/tools.js\";import{newArgError,newOtherErrorWithMessage}from\"../error/errors.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import functionApi from\"./functionApi.js\";function assembleAliasInfo(t,e,n){return{functionVersion:e.result.functionVersion,revisionId:e.result.revisionId,description:isEmpty(t.description)?e.result.description:t.description,routingConfig:isEmpty(t.routingConfig)?e.result.routingConfig:n}}async function checkRoutingConfig(t,e,n){let r,o=await functionApi.listFunctionVersions(t,e.functionName,10,1);r=n?n.result.functionVersion:e.functionVersion;let s=getLatestPublishedVersion(o),i={};if(isEmpty(e.routingConfig))return i[r]=100,i;try{i=JSON.parse(e.routingConfig)}catch(t){throw newArgError(locale(constants.ROUTING_CONFIG_NOT_JSON))}let a=Object.keys(i).length;if(a>2)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_MAX_VERSION));if(2===a)return i;if(1===a){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){if(100===i[t])return i}if(r===s&&r in i){if(100===i[r])return i;throw newArgError(locale(constants.ROUTING_CONFIG_ONLY_LATEST_VERSION))}if(r in i){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[s]=100-e}}else for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[r]=100-e}}return i}function getLatestPublishedVersion(t){if(0===t.functions.length)throw newArgError(locale(constants.FUNCTION_LIST_EMPTY));return 1===t.functions.length?t.functions[0].versionNumber:t.functions.length>=2?\"$latest\"!==t.functions[0].versionNumber?t.functions[0].versionNumber:t.functions[1].versionNumber:void 0}async function listAliases(t,e,n,r,o,s){const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases`;return new Promise(((a,c)=>{t.edge({url:i,method:\"GET\",params:{pageIndex:r||constants.DEFAULT_FUNCTION_PAGE_INDEX,pageSize:o||constants.DEFAULT_FUNCTION_PAGE_SIZE,functionVersion:n}}).then((t=>t?0===t.code?t.result.total&&0!==t.result.total?void a(t):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ANY_ALIAS),{functionName:e}))):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_REASON_CMD),{message:t.message}))):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_CMD),{message:constants.UNKNOWN_REASON}))))).catch((t=>{c(functionApi.processEdgeError(t))}))}))}async function createAlias(t,e,n){let r=await checkRoutingConfig(t,e,null),o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases`;return new Promise(((n,s)=>{t.edge({url:o,method:\"POST\",data:{name:e.name,functionVersion:e.functionVersion,description:e.description,routingConfig:r}}).then((t=>{n(t.result)})).catch((t=>{s(functionApi.processEdgeError(t))}))}))}async function updateAlias(t,e,n){let r,o,s=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases/${e.name}`,i=await queryAliasInfo(t,e.functionName,e.name);return isEmpty(e.routingConfig)||(o=await checkRoutingConfig(t,e,i)),r=assembleAliasInfo(e,i,o),t.edge({url:s,method:\"PUT\",data:r}).then((t=>t.result)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function queryAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"GET\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function deleteAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"DELETE\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}export{queryAliasInfo,listAliases,createAlias,updateAlias,deleteAliasInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Provide one or two explicit version weights totaling 100; no implicit selection of latest published version." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "title": "创建别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "title": "查看别名列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "title": "删除别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "title": "权重策略" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "title": "规则策略" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "名称:别名名称,此函数下必须唯一。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "描述:别名描述,长度不超过64个字符。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "主版本:别名指向的主版本,创建后支持修改。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "查看别名列表有两种方式:" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "点击右侧“操作”列的“删除”即可删除别名。" + }, + { + "section": "基于别名的灰度能力", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "text": "别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”选择“新建模板”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "配置完成后,点击“保存”。" + } + ], + "renderedText": "别名管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。\n\n具体使用场景举例如下:\n\n发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。\n发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。\n创建别名\n在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。\n\n在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。\n\n创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。\n\n查看别名列表\n\n查看别名列表有两种方式:\n\n方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。\n\n方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。\n\n删除别名\n在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。\n点击右侧“操作”列的“删除”即可删除别名。\n\n基于别名的灰度能力\n\n别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。\n\n权重策略\n\n通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。\n\n规则策略\n\n通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。\n\n配置完成后,点击“保存”。\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建别名\n查看别名列表\n删除别名\n基于别名的灰度能力\n权重策略\n规则策略\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949", + "status": "browser-read", + "tables": [], + "title": "别名管理" + } + ] +} diff --git a/pkg/domain/reference/functions/create-cron-trigger.json b/pkg/domain/reference/functions/create-cron-trigger.json new file mode 100644 index 0000000..171a2d6 --- /dev/null +++ b/pkg/domain/reference/functions/create-cron-trigger.json @@ -0,0 +1,148 @@ +{ + "title": "create-cron-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Default AGCLI create switch is false; an explicit triggerSwitch is required. Current guide says switch cannot be changed later, unlike AGCLI update; cloud support is unverified." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/create-function-policy.json b/pkg/domain/reference/functions/create-function-policy.json new file mode 100644 index 0000000..af9956d --- /dev/null +++ b/pkg/domain/reference/functions/create-function-policy.json @@ -0,0 +1,355 @@ +{ + "title": "create-function-policy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Read policy first; no automatic grants or silent retries." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/create-function.json b/pkg/domain/reference/functions/create-function.json new file mode 100644 index 0000000..1d56e4d --- /dev/null +++ b/pkg/domain/reference/functions/create-function.json @@ -0,0 +1,61 @@ +{ + "title": "create-function", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/createFunctionCmd.js", + "sha256": "b473549a8c34d4f3a86cf34ab33891957a6ab12849a0c2645ca23aceb08dc749", + "source": "import constants from\"../../constants/constants.js\";import FormData from\"form-data\";import parse from\"../../option/parse.js\";import verify from\"../../option/verify.js\";import output from\"../../util/output.js\";import{functionInfoTitles}from\"./titles.js\";import{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote}from\"../../option/options.js\";import{hasFunctionServicePermission,readFunctionCodeFile,getLayerVersionUrns}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";import functionApi from\"../../api/functionApi.js\";async function createFunctionCmd(e,t){if(!await hasFunctionServicePermission(e))return;try{verify.verifyExclusionEnvironmentOption(t),new verify.Verifier(t).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyRuntime,\"runtime\",!0).addVerifyOptionFunc(verify.verifyFunctionCodePath,\"codePath\",!0).addVerifyOptionFunc(verify.verifyMemory,\"memory\",!0).addVerifyOptionFunc(verify.verifyTimeout,\"timeout\",!0).addVerifyOptionFunc(verify.verifyInstanceConcurrency,\"instanceConcurrency\",!0).addVerifyOptionFunc(verify.verifyDescription,\"description\",!1).addVerifyOptionFunc(verify.verifyEnvironment,\"environment\",!1).addVerifyOptionFunc(verify.verifyEnvironmentFile,\"environmentFile\",!1).addVerifyOptionFunc(verify.verifyLayers,\"layers\",!1).done()}catch(e){return void output.outputError(constants.FAILED_CREATE_FUNCTION_CMD,e)}let n=new FormData,i=n.getHeaders(),o=new parse.Parser(t),r={};try{if(r=o.addParseOptionFunc(parse.parseNameOptionInFunctionCmd).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseDescription).addParseOptionFunc(parse.parseRuntime).done(),t.layers){let i=await getLayerVersionUrns(e,t.layers);n.append(\"layers\",JSON.stringify(i))}t.handler||(\"java1.8\"!==t.runtime?r.handler=\"handler.myHandler\":r.handler=\"faas.HelloPojo::handleRequest\"),\"custom-runtime\"===t.runtime&&(r.handler=\"/invoke\")}catch(e){return void output.outputError(constants.FAILED_CREATE_FUNCTION_CMD,e)}for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&n.append(e,r[e]);if(t.codePath){let{codeSize:e,sha256:o,fileStream:r}=await readFunctionCodeFile(t.codePath);i[\"x-file-digest\"]=e,i[\"x-file-digest-sha256\"]=o,n.append(\"file\",r)}let a=null;try{a=await functionApi.createFunction(e,i,n)}catch(e){return void output.outputError(constants.FAILED_CREATE_FUNCTION_CMD,e)}try{output.outputTable(functionInfoTitles,a.function)}catch(e){output.outputError(constants.FAILED_CREATE_FUNCTION_CMD,e)}}function main(e){return{cmd:\"create-function\",desc:`${locale(constants.DESC_CMD_CREATE_FUNCTION)}`,options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setMandatory(OPTION.FunctionCode.option),setOptional(getOptionWithDefaultValue(OPTION.Runtime)),setOptional(getOptionWithDefaultValue(OPTION.Memory)),setOptional(getOptionWithDefaultValue(OPTION.Timeout)),setOptional(getOptionWithDefaultValue(OPTION.InstanceConcurrency)),setOptional(setOptionExtraNote(OPTION.Handler.option,\"java1.8 runtime default handler: 'faas.HelloPojo::handleRequest',custom-runtime runtime default handler: '/invoke', cannot be modified nodejs14.x runtime and python3 runtime default handler: 'handler.myHandler'\")),setOptional(OPTION.Description.option),setOptional(OPTION.Environment.option),setOptional(OPTION.EnvironmentFile.option),setOptional(OPTION.Layers.option)],addHelpText:[[\"after\",\"\\nExample:\\n agcli func create-function --name a1 --code-path ./function.zip\"]],child:[],action:t=>createFunctionCmd(e,t),beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkFuncServiceEnabled(e)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/create-http-trigger.json b/pkg/domain/reference/functions/create-http-trigger.json new file mode 100644 index 0000000..6bbf91d --- /dev/null +++ b/pkg/domain/reference/functions/create-http-trigger.json @@ -0,0 +1,140 @@ +{ + "title": "create-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "funcId is obtained from query-function-version and must include the intended qualifier; create policy separately if required." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/create-layer-version.json b/pkg/domain/reference/functions/create-layer-version.json new file mode 100644 index 0000000..d681027 --- /dev/null +++ b/pkg/domain/reference/functions/create-layer-version.json @@ -0,0 +1,465 @@ +{ + "title": "create-layer-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/cmd/layer/createLayerVersionCmd.js", + "sha256": "0a5c496d678c12b820d43528eb43eaa41a09a09fa087791bb91ebbc06650a4ca", + "source": "import common from\"./common.js\";import constants from\"../../constants/constants.js\";import fs from\"fs\";import verify from\"../../option/verify.js\";import layerApi from\"../../api/layerApi.js\";import output from\"../../util/output.js\";import{layerInfoTitles}from\"./titles.js\";import{OPTION,setOptional,setMandatory,getOptionWithDefaultValue}from\"../../option/options.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function createLayerVersionCmd(e,t){const{logger:o}=e;if(!await hasFunctionServicePermission(e))return;try{new verify.Verifier(t).addVerifyOptionFunc(verify.verifyNameOptionInLayerCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyLayerCodePath,\"codePath\",!0).addVerifyOptionFunc(verify.verifyLayerDescription,\"description\",!1).addVerifyOptionFunc(verify.verifyLayerSharedScope,\"sharedScope\",!0).addVerifyOptionFunc(verify.verifyLicenseInfo,\"licenseInfo\",!1).addVerifyOptionFunc(verify.verifyCompatibleRuntimes,\"compatibleRuntimes\",!1).done()}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}try{if(!await layerApi.queryLayerInfo(e,t.name,\"1\"))return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,{message:locale(constants.ERR_MSG_LAYER_UNEXIST)})}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}t.compatibleRuntimes||(t.compatibleRuntimes=[\"nodejs14.x\"]);let i={compatibleRuntimes:t.compatibleRuntimes,description:t.description,sharedScope:common.layerShares[t.sharedScope],licenseInfo:t.licenseInfo};if(t.codePath){let e=fs.readFileSync(t.codePath);i.zipFile=Buffer.from(e).toString(\"base64\")}try{let o=await layerApi.createLayer(e,t.name,i);common.processSharedScopeLayerInfo(o.result),output.outputInfo(layerInfoTitles,o.result)}catch(e){output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}}function main(e){return{cmd:\"create-layer-version\",desc:locale(constants.DESC_CMD_CREATE_LAYER_VERSION),options:[setMandatory(OPTION.NameOptionInLayerCmd.option),setOptional(common.setCompatibleFakeDefaultValue(OPTION.CompatibleRuntimes.option)),setOptional(OPTION.LayerCode.option),setOptional(getOptionWithDefaultValue(OPTION.LayerSharedScope)),setOptional(OPTION.LayerDescription.option),setOptional(OPTION.LicenseInfo.option)],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func create-layer-version --name test-layer --compatible-runtimes nodejs14.x --code-path ./layer.zip --shared-scope business\"]],action(t){createLayerVersionCmd(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkFuncServiceEnabled(e)}}}export default main;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "zipFile contains Base64 ZIP bytes; validate compressed/decompressed limits and entry count before authorization. Layer name creates the initial version or appends a version. AGCLI 1.12.0 local ZIP validation caps files below 50MiB; this direct API adapter uses the current browser-reviewed guide limits of 150MiB compressed, 300MiB expanded and 30000 entries. This difference and modern runtime wire values still require cloud verification." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip\n |---相关配置项" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-management-0000001517922200", + "title": "函数管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-flow-manage-0000001658598194", + "title": "流量治理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "title": "创建层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "title": "更新层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "title": "删除层版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "title": "查询层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "title": "将函数绑定层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "title": "将函数解绑层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持一个函数最多可以绑定5个层。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Node.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---node_modules" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Java层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---config" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---application.properties //相关配置文件" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---lib" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Python层结构:\n|---layer.zip\n |---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发者开发云函数代码,通过相对路径的形式引用依赖。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在云函数主界面,选择“层”页签。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在层管理页面,点击“创建层”。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击您已创建的层,进入层详情页面。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "删除层版本,已经绑定在函数中的层不会失效。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "在您已创建的层列表中,找到待删除的层,点击层进入详情页。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "我的:开发者自己创建的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "共享:同项目+同团队下共享的。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "一个函数最多可以绑定5个层。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "返回到“层配置”界面,绑定成功的层将展示在层列表中。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + } + ], + "renderedText": "指南\n云函数\n函数管理\n层管理\n层管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。\n\n云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。\n\n云函数支持一个函数最多可以绑定5个层。\n\n注意\n\n上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。\n\nNode.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项\nJava层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖\nPython层结构:\n|---layer.zip\n |---相关配置项\n\n具体使用场景举例如下:\n\n开发者开发云函数代码,通过相对路径的形式引用依赖。\n依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。\n函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。\n开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。\n创建层\n在云函数主界面,选择“层”页签。\n在层管理页面,点击“创建层”。\n\n页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。\n\n更新层\n\n发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。\n\n点击您已创建的层,进入层详情页面。\n点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。\n在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。\n\n删除层版本\n\n删除层版本,已经绑定在函数中的层不会失效。\n\n在您已创建的层列表中,找到待删除的层,点击层进入详情页。\n点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。\n\n删除层\n\n在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。\n\n注意\n\n删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。\n\n查询层\n进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。\n如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。\n\n将函数绑定层\n在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。\n\n在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。\n\n返回到“层配置”界面,绑定成功的层将展示在层列表中。\n\n将函数解绑层\n进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。\n\n点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。\n\n流量治理\n触发器管理\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建层\n更新层\n删除层版本\n删除层\n查询层\n将函数绑定层\n将函数解绑层\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "层描述", + "对正在创建层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 团队内共享 项目内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入类型,仅支持上传zip文件。 说明 ZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层描述", + "对正在创建的层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入的文件类型,zip文件。 说明 ZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "版本", + "存在多个层版本时,选择函数绑定的层版本。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。 nodejs java python custom-runtime" + ], + [ + "层描述", + "层的附加说明,长度不超过1024位。" + ] + ], + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174" + } + ], + "title": "层管理" + } + ] +} diff --git a/pkg/domain/reference/functions/delete-alias.json b/pkg/domain/reference/functions/delete-alias.json new file mode 100644 index 0000000..890f12b --- /dev/null +++ b/pkg/domain/reference/functions/delete-alias.json @@ -0,0 +1,259 @@ +{ + "title": "delete-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/aliasApi.js", + "sha256": "3340b3b361b3805c80ec197b547653f88a83322bc7a3d57f10e8f901c35e4814", + "source": "import constants from\"../constants/constants.js\";import{isEmpty}from\"../util/tools.js\";import{newArgError,newOtherErrorWithMessage}from\"../error/errors.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import functionApi from\"./functionApi.js\";function assembleAliasInfo(t,e,n){return{functionVersion:e.result.functionVersion,revisionId:e.result.revisionId,description:isEmpty(t.description)?e.result.description:t.description,routingConfig:isEmpty(t.routingConfig)?e.result.routingConfig:n}}async function checkRoutingConfig(t,e,n){let r,o=await functionApi.listFunctionVersions(t,e.functionName,10,1);r=n?n.result.functionVersion:e.functionVersion;let s=getLatestPublishedVersion(o),i={};if(isEmpty(e.routingConfig))return i[r]=100,i;try{i=JSON.parse(e.routingConfig)}catch(t){throw newArgError(locale(constants.ROUTING_CONFIG_NOT_JSON))}let a=Object.keys(i).length;if(a>2)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_MAX_VERSION));if(2===a)return i;if(1===a){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){if(100===i[t])return i}if(r===s&&r in i){if(100===i[r])return i;throw newArgError(locale(constants.ROUTING_CONFIG_ONLY_LATEST_VERSION))}if(r in i){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[s]=100-e}}else for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[r]=100-e}}return i}function getLatestPublishedVersion(t){if(0===t.functions.length)throw newArgError(locale(constants.FUNCTION_LIST_EMPTY));return 1===t.functions.length?t.functions[0].versionNumber:t.functions.length>=2?\"$latest\"!==t.functions[0].versionNumber?t.functions[0].versionNumber:t.functions[1].versionNumber:void 0}async function listAliases(t,e,n,r,o,s){const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases`;return new Promise(((a,c)=>{t.edge({url:i,method:\"GET\",params:{pageIndex:r||constants.DEFAULT_FUNCTION_PAGE_INDEX,pageSize:o||constants.DEFAULT_FUNCTION_PAGE_SIZE,functionVersion:n}}).then((t=>t?0===t.code?t.result.total&&0!==t.result.total?void a(t):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ANY_ALIAS),{functionName:e}))):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_REASON_CMD),{message:t.message}))):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_CMD),{message:constants.UNKNOWN_REASON}))))).catch((t=>{c(functionApi.processEdgeError(t))}))}))}async function createAlias(t,e,n){let r=await checkRoutingConfig(t,e,null),o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases`;return new Promise(((n,s)=>{t.edge({url:o,method:\"POST\",data:{name:e.name,functionVersion:e.functionVersion,description:e.description,routingConfig:r}}).then((t=>{n(t.result)})).catch((t=>{s(functionApi.processEdgeError(t))}))}))}async function updateAlias(t,e,n){let r,o,s=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases/${e.name}`,i=await queryAliasInfo(t,e.functionName,e.name);return isEmpty(e.routingConfig)||(o=await checkRoutingConfig(t,e,i)),r=assembleAliasInfo(e,i,o),t.edge({url:s,method:\"PUT\",data:r}).then((t=>t.result)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function queryAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"GET\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function deleteAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"DELETE\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}export{queryAliasInfo,listAliases,createAlias,updateAlias,deleteAliasInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "title": "创建别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "title": "查看别名列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "title": "删除别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "title": "权重策略" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "title": "规则策略" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "名称:别名名称,此函数下必须唯一。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "描述:别名描述,长度不超过64个字符。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "主版本:别名指向的主版本,创建后支持修改。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "查看别名列表有两种方式:" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "点击右侧“操作”列的“删除”即可删除别名。" + }, + { + "section": "基于别名的灰度能力", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "text": "别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”选择“新建模板”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "配置完成后,点击“保存”。" + } + ], + "renderedText": "别名管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。\n\n具体使用场景举例如下:\n\n发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。\n发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。\n创建别名\n在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。\n\n在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。\n\n创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。\n\n查看别名列表\n\n查看别名列表有两种方式:\n\n方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。\n\n方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。\n\n删除别名\n在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。\n点击右侧“操作”列的“删除”即可删除别名。\n\n基于别名的灰度能力\n\n别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。\n\n权重策略\n\n通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。\n\n规则策略\n\n通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。\n\n配置完成后,点击“保存”。\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建别名\n查看别名列表\n删除别名\n基于别名的灰度能力\n权重策略\n规则策略\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949", + "status": "browser-read", + "tables": [], + "title": "别名管理" + } + ] +} diff --git a/pkg/domain/reference/functions/delete-http-trigger.json b/pkg/domain/reference/functions/delete-http-trigger.json new file mode 100644 index 0000000..15515dd --- /dev/null +++ b/pkg/domain/reference/functions/delete-http-trigger.json @@ -0,0 +1,353 @@ +{ + "title": "delete-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/delete-trigger.json b/pkg/domain/reference/functions/delete-trigger.json new file mode 100644 index 0000000..7d993c1 --- /dev/null +++ b/pkg/domain/reference/functions/delete-trigger.json @@ -0,0 +1,353 @@ +{ + "title": "delete-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/get-alias.json b/pkg/domain/reference/functions/get-alias.json new file mode 100644 index 0000000..ad0558d --- /dev/null +++ b/pkg/domain/reference/functions/get-alias.json @@ -0,0 +1,259 @@ +{ + "title": "get-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/aliasApi.js", + "sha256": "3340b3b361b3805c80ec197b547653f88a83322bc7a3d57f10e8f901c35e4814", + "source": "import constants from\"../constants/constants.js\";import{isEmpty}from\"../util/tools.js\";import{newArgError,newOtherErrorWithMessage}from\"../error/errors.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import functionApi from\"./functionApi.js\";function assembleAliasInfo(t,e,n){return{functionVersion:e.result.functionVersion,revisionId:e.result.revisionId,description:isEmpty(t.description)?e.result.description:t.description,routingConfig:isEmpty(t.routingConfig)?e.result.routingConfig:n}}async function checkRoutingConfig(t,e,n){let r,o=await functionApi.listFunctionVersions(t,e.functionName,10,1);r=n?n.result.functionVersion:e.functionVersion;let s=getLatestPublishedVersion(o),i={};if(isEmpty(e.routingConfig))return i[r]=100,i;try{i=JSON.parse(e.routingConfig)}catch(t){throw newArgError(locale(constants.ROUTING_CONFIG_NOT_JSON))}let a=Object.keys(i).length;if(a>2)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_MAX_VERSION));if(2===a)return i;if(1===a){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){if(100===i[t])return i}if(r===s&&r in i){if(100===i[r])return i;throw newArgError(locale(constants.ROUTING_CONFIG_ONLY_LATEST_VERSION))}if(r in i){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[s]=100-e}}else for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[r]=100-e}}return i}function getLatestPublishedVersion(t){if(0===t.functions.length)throw newArgError(locale(constants.FUNCTION_LIST_EMPTY));return 1===t.functions.length?t.functions[0].versionNumber:t.functions.length>=2?\"$latest\"!==t.functions[0].versionNumber?t.functions[0].versionNumber:t.functions[1].versionNumber:void 0}async function listAliases(t,e,n,r,o,s){const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases`;return new Promise(((a,c)=>{t.edge({url:i,method:\"GET\",params:{pageIndex:r||constants.DEFAULT_FUNCTION_PAGE_INDEX,pageSize:o||constants.DEFAULT_FUNCTION_PAGE_SIZE,functionVersion:n}}).then((t=>t?0===t.code?t.result.total&&0!==t.result.total?void a(t):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ANY_ALIAS),{functionName:e}))):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_REASON_CMD),{message:t.message}))):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_CMD),{message:constants.UNKNOWN_REASON}))))).catch((t=>{c(functionApi.processEdgeError(t))}))}))}async function createAlias(t,e,n){let r=await checkRoutingConfig(t,e,null),o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases`;return new Promise(((n,s)=>{t.edge({url:o,method:\"POST\",data:{name:e.name,functionVersion:e.functionVersion,description:e.description,routingConfig:r}}).then((t=>{n(t.result)})).catch((t=>{s(functionApi.processEdgeError(t))}))}))}async function updateAlias(t,e,n){let r,o,s=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases/${e.name}`,i=await queryAliasInfo(t,e.functionName,e.name);return isEmpty(e.routingConfig)||(o=await checkRoutingConfig(t,e,i)),r=assembleAliasInfo(e,i,o),t.edge({url:s,method:\"PUT\",data:r}).then((t=>t.result)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function queryAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"GET\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function deleteAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"DELETE\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}export{queryAliasInfo,listAliases,createAlias,updateAlias,deleteAliasInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "title": "创建别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "title": "查看别名列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "title": "删除别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "title": "权重策略" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "title": "规则策略" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "名称:别名名称,此函数下必须唯一。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "描述:别名描述,长度不超过64个字符。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "主版本:别名指向的主版本,创建后支持修改。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "查看别名列表有两种方式:" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "点击右侧“操作”列的“删除”即可删除别名。" + }, + { + "section": "基于别名的灰度能力", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "text": "别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”选择“新建模板”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "配置完成后,点击“保存”。" + } + ], + "renderedText": "别名管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。\n\n具体使用场景举例如下:\n\n发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。\n发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。\n创建别名\n在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。\n\n在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。\n\n创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。\n\n查看别名列表\n\n查看别名列表有两种方式:\n\n方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。\n\n方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。\n\n删除别名\n在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。\n点击右侧“操作”列的“删除”即可删除别名。\n\n基于别名的灰度能力\n\n别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。\n\n权重策略\n\n通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。\n\n规则策略\n\n通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。\n\n配置完成后,点击“保存”。\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建别名\n查看别名列表\n删除别名\n基于别名的灰度能力\n权重策略\n规则策略\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949", + "status": "browser-read", + "tables": [], + "title": "别名管理" + } + ] +} diff --git a/pkg/domain/reference/functions/get-function-policy.json b/pkg/domain/reference/functions/get-function-policy.json new file mode 100644 index 0000000..49128f1 --- /dev/null +++ b/pkg/domain/reference/functions/get-function-policy.json @@ -0,0 +1,353 @@ +{ + "title": "get-function-policy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/get-http-trigger.json b/pkg/domain/reference/functions/get-http-trigger.json new file mode 100644 index 0000000..561cba1 --- /dev/null +++ b/pkg/domain/reference/functions/get-http-trigger.json @@ -0,0 +1,353 @@ +{ + "title": "get-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/get-layer-version.json b/pkg/domain/reference/functions/get-layer-version.json new file mode 100644 index 0000000..68b2b60 --- /dev/null +++ b/pkg/domain/reference/functions/get-layer-version.json @@ -0,0 +1,463 @@ +{ + "title": "get-layer-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/cmd/layer/createLayerVersionCmd.js", + "sha256": "0a5c496d678c12b820d43528eb43eaa41a09a09fa087791bb91ebbc06650a4ca", + "source": "import common from\"./common.js\";import constants from\"../../constants/constants.js\";import fs from\"fs\";import verify from\"../../option/verify.js\";import layerApi from\"../../api/layerApi.js\";import output from\"../../util/output.js\";import{layerInfoTitles}from\"./titles.js\";import{OPTION,setOptional,setMandatory,getOptionWithDefaultValue}from\"../../option/options.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function createLayerVersionCmd(e,t){const{logger:o}=e;if(!await hasFunctionServicePermission(e))return;try{new verify.Verifier(t).addVerifyOptionFunc(verify.verifyNameOptionInLayerCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyLayerCodePath,\"codePath\",!0).addVerifyOptionFunc(verify.verifyLayerDescription,\"description\",!1).addVerifyOptionFunc(verify.verifyLayerSharedScope,\"sharedScope\",!0).addVerifyOptionFunc(verify.verifyLicenseInfo,\"licenseInfo\",!1).addVerifyOptionFunc(verify.verifyCompatibleRuntimes,\"compatibleRuntimes\",!1).done()}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}try{if(!await layerApi.queryLayerInfo(e,t.name,\"1\"))return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,{message:locale(constants.ERR_MSG_LAYER_UNEXIST)})}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}t.compatibleRuntimes||(t.compatibleRuntimes=[\"nodejs14.x\"]);let i={compatibleRuntimes:t.compatibleRuntimes,description:t.description,sharedScope:common.layerShares[t.sharedScope],licenseInfo:t.licenseInfo};if(t.codePath){let e=fs.readFileSync(t.codePath);i.zipFile=Buffer.from(e).toString(\"base64\")}try{let o=await layerApi.createLayer(e,t.name,i);common.processSharedScopeLayerInfo(o.result),output.outputInfo(layerInfoTitles,o.result)}catch(e){output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}}function main(e){return{cmd:\"create-layer-version\",desc:locale(constants.DESC_CMD_CREATE_LAYER_VERSION),options:[setMandatory(OPTION.NameOptionInLayerCmd.option),setOptional(common.setCompatibleFakeDefaultValue(OPTION.CompatibleRuntimes.option)),setOptional(OPTION.LayerCode.option),setOptional(getOptionWithDefaultValue(OPTION.LayerSharedScope)),setOptional(OPTION.LayerDescription.option),setOptional(OPTION.LicenseInfo.option)],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func create-layer-version --name test-layer --compatible-runtimes nodejs14.x --code-path ./layer.zip --shared-scope business\"]],action(t){createLayerVersionCmd(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkFuncServiceEnabled(e)}}}export default main;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip\n |---相关配置项" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-management-0000001517922200", + "title": "函数管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-flow-manage-0000001658598194", + "title": "流量治理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "title": "创建层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "title": "更新层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "title": "删除层版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "title": "查询层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "title": "将函数绑定层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "title": "将函数解绑层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持一个函数最多可以绑定5个层。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Node.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---node_modules" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Java层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---config" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---application.properties //相关配置文件" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---lib" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Python层结构:\n|---layer.zip\n |---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发者开发云函数代码,通过相对路径的形式引用依赖。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在云函数主界面,选择“层”页签。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在层管理页面,点击“创建层”。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击您已创建的层,进入层详情页面。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "删除层版本,已经绑定在函数中的层不会失效。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "在您已创建的层列表中,找到待删除的层,点击层进入详情页。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "我的:开发者自己创建的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "共享:同项目+同团队下共享的。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "一个函数最多可以绑定5个层。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "返回到“层配置”界面,绑定成功的层将展示在层列表中。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + } + ], + "renderedText": "指南\n云函数\n函数管理\n层管理\n层管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。\n\n云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。\n\n云函数支持一个函数最多可以绑定5个层。\n\n注意\n\n上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。\n\nNode.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项\nJava层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖\nPython层结构:\n|---layer.zip\n |---相关配置项\n\n具体使用场景举例如下:\n\n开发者开发云函数代码,通过相对路径的形式引用依赖。\n依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。\n函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。\n开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。\n创建层\n在云函数主界面,选择“层”页签。\n在层管理页面,点击“创建层”。\n\n页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。\n\n更新层\n\n发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。\n\n点击您已创建的层,进入层详情页面。\n点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。\n在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。\n\n删除层版本\n\n删除层版本,已经绑定在函数中的层不会失效。\n\n在您已创建的层列表中,找到待删除的层,点击层进入详情页。\n点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。\n\n删除层\n\n在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。\n\n注意\n\n删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。\n\n查询层\n进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。\n如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。\n\n将函数绑定层\n在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。\n\n在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。\n\n返回到“层配置”界面,绑定成功的层将展示在层列表中。\n\n将函数解绑层\n进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。\n\n点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。\n\n流量治理\n触发器管理\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建层\n更新层\n删除层版本\n删除层\n查询层\n将函数绑定层\n将函数解绑层\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "层描述", + "对正在创建层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 团队内共享 项目内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入类型,仅支持上传zip文件。 说明 ZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层描述", + "对正在创建的层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入的文件类型,zip文件。 说明 ZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "版本", + "存在多个层版本时,选择函数绑定的层版本。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。 nodejs java python custom-runtime" + ], + [ + "层描述", + "层的附加说明,长度不超过1024位。" + ] + ], + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174" + } + ], + "title": "层管理" + } + ] +} diff --git a/pkg/domain/reference/functions/get-trigger.json b/pkg/domain/reference/functions/get-trigger.json new file mode 100644 index 0000000..e866752 --- /dev/null +++ b/pkg/domain/reference/functions/get-trigger.json @@ -0,0 +1,353 @@ +{ + "title": "get-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/invoke.json b/pkg/domain/reference/functions/invoke.json new file mode 100644 index 0000000..25b1a5b --- /dev/null +++ b/pkg/domain/reference/functions/invoke.json @@ -0,0 +1,61 @@ +{ + "title": "invoke", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/invokeCmd.js", + "sha256": "f3496a75901948206ac21d08be3af2b7ef09d3f14d06e3c87615177475f64837", + "source": "import{queryAliasInfo}from\"../../api/aliasApi.js\";import constants from\"../../constants/constants.js\";import{newArgError}from\"../../error/errors.js\";import fs from\"fs\";import functionApi from\"../../api/functionApi.js\";import verify from\"../../option/verify.js\";import{OPTION,setOptional,setMandatory,setOptionExtraNote}from\"../../option/options.js\";import output from\"../../util/output.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";const EXCLUSION_PAYLOAD_OPTION_ERROR=newArgError(locale(constants.ARG_ERR_EXCLUSION_PAYLOAD_OPTION)),EXCLUSION_VERSION_OR_ALIASNAME_OPTION_ERROR=newArgError(locale(constants.ARG_ERR_EXCLUSION_VERSION_OR_ALIAS_NAME_OPTION));async function invokeCmd(t,o){const{logger:n}=t;if(!await hasFunctionServicePermission(t))return;try{new verify.Verifier(o).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyVersionOptionInFunctionCmd,\"version\",!1).addVerifyOptionFunc(verify.verifyAliasName,\"aliasName\",!1).addVerifyOptionFunc(verify.verifyPayload,\"payload\",!1).addVerifyOptionFunc(verify.verifyPayloadFile,\"payloadFile\",!1).done()}catch(t){return void output.outputError(constants.FAILED_INVOKE_CMD,t)}if(o.payload&&o.payloadFile)return void output.outputError(constants.FAILED_INVOKE_CMD,EXCLUSION_PAYLOAD_OPTION_ERROR);if(o.aliasName&&o.version)return void output.outputError(constants.FAILED_INVOKE_CMD,EXCLUSION_VERSION_OR_ALIASNAME_OPTION_ERROR);let i=\"$latest\";if(o.version){i=o.version;try{await functionApi.queryFunctionVersion(t,o.name,o.version)}catch(t){return void output.outputError(constants.FAILED_INVOKE_CMD,t)}}if(o.aliasName){i=o.aliasName;try{await queryAliasInfo(t,o.name,o.aliasName)}catch(t){return void output.outputError(constants.FAILED_INVOKE_CMD,t)}}let e=\"{}\";o.payload&&(e=o.payload),o.payloadFile&&(e=fs.readFileSync(o.payloadFile)),PRINT(`Started to invoke the function: ${o.name}:${i}\\n`);let a=new Date,r=null;try{let n=JSON.parse(e);r=await functionApi.invokeFunction(t,o.name,i,n)}catch(t){return void output.outputError(constants.FAILED_INVOKE_CMD,t)}output.outputInvokeResult(r.response,r.traceId,a)}function main(t){return{cmd:\"invoke\",desc:`${locale(constants.DESC_CMD_INVOKE_FUNCTION)}`,options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setOptional(setOptionExtraNote(OPTION.VersionOptionInFunctionCmd.option,locale(constants.FUNCTION_INVOKE_VERSION_OPTION_NOTE))),setOptional(setOptionExtraNote(OPTION.FunctionAliasName.option,locale(constants.FUNCTION_INVOKE_ALIAS_NAME_OPTION_NOTE))),setOptional(setOptionExtraNote(OPTION.Payload.option,locale(constants.FUNCTION_PAYLOAD_OPTION_NOTE))),setOptional(setOptionExtraNote(OPTION.PayloadFile.option,locale(constants.FUNCTION_PAYLOAD_FILE_OPTION_NOTE)))],addHelpText:[[\"after\",'\\nExample:\\n agcli func invoke --name a1 --payload \"{\\\\\"request\\\\\": \\\\\"world\\\\\"}\"']],child:[],action(o){invokeCmd(t,o)},beforeAction:async()=>{await checkIsLogin(t),await checkSelectedProject(t),await checkFuncServiceEnabled(t)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/list-aliases.json b/pkg/domain/reference/functions/list-aliases.json new file mode 100644 index 0000000..6be9201 --- /dev/null +++ b/pkg/domain/reference/functions/list-aliases.json @@ -0,0 +1,259 @@ +{ + "title": "list-aliases", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/aliasApi.js", + "sha256": "3340b3b361b3805c80ec197b547653f88a83322bc7a3d57f10e8f901c35e4814", + "source": "import constants from\"../constants/constants.js\";import{isEmpty}from\"../util/tools.js\";import{newArgError,newOtherErrorWithMessage}from\"../error/errors.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import functionApi from\"./functionApi.js\";function assembleAliasInfo(t,e,n){return{functionVersion:e.result.functionVersion,revisionId:e.result.revisionId,description:isEmpty(t.description)?e.result.description:t.description,routingConfig:isEmpty(t.routingConfig)?e.result.routingConfig:n}}async function checkRoutingConfig(t,e,n){let r,o=await functionApi.listFunctionVersions(t,e.functionName,10,1);r=n?n.result.functionVersion:e.functionVersion;let s=getLatestPublishedVersion(o),i={};if(isEmpty(e.routingConfig))return i[r]=100,i;try{i=JSON.parse(e.routingConfig)}catch(t){throw newArgError(locale(constants.ROUTING_CONFIG_NOT_JSON))}let a=Object.keys(i).length;if(a>2)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_MAX_VERSION));if(2===a)return i;if(1===a){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){if(100===i[t])return i}if(r===s&&r in i){if(100===i[r])return i;throw newArgError(locale(constants.ROUTING_CONFIG_ONLY_LATEST_VERSION))}if(r in i){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[s]=100-e}}else for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[r]=100-e}}return i}function getLatestPublishedVersion(t){if(0===t.functions.length)throw newArgError(locale(constants.FUNCTION_LIST_EMPTY));return 1===t.functions.length?t.functions[0].versionNumber:t.functions.length>=2?\"$latest\"!==t.functions[0].versionNumber?t.functions[0].versionNumber:t.functions[1].versionNumber:void 0}async function listAliases(t,e,n,r,o,s){const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases`;return new Promise(((a,c)=>{t.edge({url:i,method:\"GET\",params:{pageIndex:r||constants.DEFAULT_FUNCTION_PAGE_INDEX,pageSize:o||constants.DEFAULT_FUNCTION_PAGE_SIZE,functionVersion:n}}).then((t=>t?0===t.code?t.result.total&&0!==t.result.total?void a(t):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ANY_ALIAS),{functionName:e}))):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_REASON_CMD),{message:t.message}))):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_CMD),{message:constants.UNKNOWN_REASON}))))).catch((t=>{c(functionApi.processEdgeError(t))}))}))}async function createAlias(t,e,n){let r=await checkRoutingConfig(t,e,null),o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases`;return new Promise(((n,s)=>{t.edge({url:o,method:\"POST\",data:{name:e.name,functionVersion:e.functionVersion,description:e.description,routingConfig:r}}).then((t=>{n(t.result)})).catch((t=>{s(functionApi.processEdgeError(t))}))}))}async function updateAlias(t,e,n){let r,o,s=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases/${e.name}`,i=await queryAliasInfo(t,e.functionName,e.name);return isEmpty(e.routingConfig)||(o=await checkRoutingConfig(t,e,i)),r=assembleAliasInfo(e,i,o),t.edge({url:s,method:\"PUT\",data:r}).then((t=>t.result)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function queryAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"GET\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function deleteAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"DELETE\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}export{queryAliasInfo,listAliases,createAlias,updateAlias,deleteAliasInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "title": "创建别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "title": "查看别名列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "title": "删除别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "title": "权重策略" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "title": "规则策略" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "名称:别名名称,此函数下必须唯一。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "描述:别名描述,长度不超过64个字符。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "主版本:别名指向的主版本,创建后支持修改。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "查看别名列表有两种方式:" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "点击右侧“操作”列的“删除”即可删除别名。" + }, + { + "section": "基于别名的灰度能力", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "text": "别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”选择“新建模板”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "配置完成后,点击“保存”。" + } + ], + "renderedText": "别名管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。\n\n具体使用场景举例如下:\n\n发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。\n发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。\n创建别名\n在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。\n\n在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。\n\n创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。\n\n查看别名列表\n\n查看别名列表有两种方式:\n\n方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。\n\n方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。\n\n删除别名\n在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。\n点击右侧“操作”列的“删除”即可删除别名。\n\n基于别名的灰度能力\n\n别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。\n\n权重策略\n\n通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。\n\n规则策略\n\n通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。\n\n配置完成后,点击“保存”。\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建别名\n查看别名列表\n删除别名\n基于别名的灰度能力\n权重策略\n规则策略\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949", + "status": "browser-read", + "tables": [], + "title": "别名管理" + } + ] +} diff --git a/pkg/domain/reference/functions/list-function-versions.json b/pkg/domain/reference/functions/list-function-versions.json new file mode 100644 index 0000000..7dcc879 --- /dev/null +++ b/pkg/domain/reference/functions/list-function-versions.json @@ -0,0 +1,61 @@ +{ + "title": "list-function-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/listFunctionVersionsCmd.js", + "sha256": "6bfeb611970aa7d930e4cf85bf1c559031116de938aadb894d6f0bc9dfe92fde", + "source": "import functionApi from\"../../api/functionApi.js\";import constants from\"../../constants/constants.js\";import verify from\"../../option/verify.js\";import output from\"../../util/output.js\";import types from\"../../types/type.js\";import{OPTION,getOptionWithDefaultValue,setOptional,setMandatory}from\"../../option/options.js\";import{functionVersionsListJSONTitles,functionVersionsListTableTitles}from\"./titles.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function listFunctionVersionsCmd(t,i){const{logger:n}=t;if(!await hasFunctionServicePermission(t))return;try{new verify.Verifier(i).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyListOutput,\"output\",!0).addVerifyOptionFunc(verify.verifyPageSize,\"pageSize\",!0).addVerifyOptionFunc(verify.verifyPageIndex,\"pageIndex\",!0).done()}catch(t){return void output.outputError(constants.FAILED_LIST_FUNCTION_VERSIONS_CMD,t)}let e=null;try{e=await functionApi.listFunctionVersions(t,i.name,i.pageSize,i.pageIndex)}catch(t){return void output.outputError(constants.FAILED_LIST_FUNCTION_VERSIONS_CMD,t)}try{switch(i.output){case\"table\":{let o={description:32,versionDesc:32},s=new types.ListInfo(functionVersionsListTableTitles,o,e.functions),a=new types.PageFuncInfo(listFunctionVersionsCmd,t,i,i.pageIndex,e.pageInfo.total);output.outputListCmd(n,output.strFormat(locale(constants.SUCCEED_LIST_FUNCTION_VERSIONS_CMD),{functionName:i.name}),s,a);break}default:output.outputJsonList(functionVersionsListJSONTitles,e,\"functions\")}}catch(t){output.outputError(constants.FAILED_LIST_FUNCTION_VERSIONS_CMD,t)}}function main(t){return{cmd:\"list-function-versions\",desc:`${locale(constants.DESC_CMD_LIST_FUNCTION_VERSIONS)}`,child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func list-function-versions --name a1\"]],options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setOptional(getOptionWithDefaultValue(OPTION.ListOutput)),setOptional(getOptionWithDefaultValue(OPTION.PageSize)),setOptional(getOptionWithDefaultValue(OPTION.PageIndex))],action(i){listFunctionVersionsCmd(t,i)},beforeAction:async()=>{await checkIsLogin(t),await checkSelectedProject(t),await checkFuncServiceEnabled(t)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/list-functions.json b/pkg/domain/reference/functions/list-functions.json new file mode 100644 index 0000000..b5637f8 --- /dev/null +++ b/pkg/domain/reference/functions/list-functions.json @@ -0,0 +1,61 @@ +{ + "title": "list-functions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/listFunctionsCmd.js", + "sha256": "b5b648fef32701ae6e936bdd985b4a71fc8a7b8528077b9e602d27b1b7564e39", + "source": "import constants from\"../../constants/constants.js\";import functionApi from\"../../api/functionApi.js\";import output from\"../../util/output.js\";import types from\"../../types/type.js\";import verify from\"../../option/verify.js\";import{functionListJSONTitles,functionListTableTitles}from\"./titles.js\";import{OPTION,getOptionWithDefaultValue,setOptional}from\"../../option/options.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function listFunctionsCmd(t,i){const{logger:e}=t;if(!await hasFunctionServicePermission(t))return;try{new verify.Verifier(i).addVerifyOptionFunc(verify.verifyFuzzyName,\"fuzzyName\",!1).addVerifyOptionFunc(verify.verifyListOutput,\"output\",!0).addVerifyOptionFunc(verify.verifyPageSize,\"pageSize\",!0).addVerifyOptionFunc(verify.verifyPageIndex,\"pageIndex\",!0).done()}catch(t){return void output.outputError(constants.FAILED_LIST_FUNCTIONS_CMD,t)}let o=null;try{o=await functionApi.listFunctions(t,i.fuzzyName,i.pageSize,i.pageIndex)}catch(t){return void output.outputError(constants.FAILED_LIST_FUNCTIONS_CMD,t)}try{switch(i.output){case\"table\":{let n={description:32},u=new types.ListInfo(functionListTableTitles,n,o.functions),a=new types.PageFuncInfo(listFunctionsCmd,t,i,i.pageIndex,o.pageInfo.total);output.outputListCmd(e,locale(constants.SUCCEED_LIST_FUNCTIONS_CMD),u,a);break}default:output.outputJsonList(functionListJSONTitles,o,\"functions\")}}catch(t){output.outputError(constants.FAILED_LIST_FUNCTIONS_CMD,t)}}function main(t){return{cmd:\"list-functions\",desc:`${locale(constants.DESC_CMD_LIST_FUNCTIONS)}`,options:[setOptional(OPTION.FuzzyNameOptionInFunctionCmd.option),setOptional(getOptionWithDefaultValue(OPTION.ListOutput)),setOptional(getOptionWithDefaultValue(OPTION.PageSize)),setOptional(getOptionWithDefaultValue(OPTION.PageIndex))],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func list-functions\"]],action(i){listFunctionsCmd(t,i)},beforeAction:async()=>{await checkIsLogin(t),await checkSelectedProject(t),await checkFuncServiceEnabled(t)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/list-http-triggers.json b/pkg/domain/reference/functions/list-http-triggers.json new file mode 100644 index 0000000..3104296 --- /dev/null +++ b/pkg/domain/reference/functions/list-http-triggers.json @@ -0,0 +1,355 @@ +{ + "title": "list-http-triggers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Listing path is also reviewed in boundary/triggerService.js." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/list-layer-versions.json b/pkg/domain/reference/functions/list-layer-versions.json new file mode 100644 index 0000000..7620250 --- /dev/null +++ b/pkg/domain/reference/functions/list-layer-versions.json @@ -0,0 +1,463 @@ +{ + "title": "list-layer-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/cmd/layer/createLayerVersionCmd.js", + "sha256": "0a5c496d678c12b820d43528eb43eaa41a09a09fa087791bb91ebbc06650a4ca", + "source": "import common from\"./common.js\";import constants from\"../../constants/constants.js\";import fs from\"fs\";import verify from\"../../option/verify.js\";import layerApi from\"../../api/layerApi.js\";import output from\"../../util/output.js\";import{layerInfoTitles}from\"./titles.js\";import{OPTION,setOptional,setMandatory,getOptionWithDefaultValue}from\"../../option/options.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function createLayerVersionCmd(e,t){const{logger:o}=e;if(!await hasFunctionServicePermission(e))return;try{new verify.Verifier(t).addVerifyOptionFunc(verify.verifyNameOptionInLayerCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyLayerCodePath,\"codePath\",!0).addVerifyOptionFunc(verify.verifyLayerDescription,\"description\",!1).addVerifyOptionFunc(verify.verifyLayerSharedScope,\"sharedScope\",!0).addVerifyOptionFunc(verify.verifyLicenseInfo,\"licenseInfo\",!1).addVerifyOptionFunc(verify.verifyCompatibleRuntimes,\"compatibleRuntimes\",!1).done()}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}try{if(!await layerApi.queryLayerInfo(e,t.name,\"1\"))return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,{message:locale(constants.ERR_MSG_LAYER_UNEXIST)})}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}t.compatibleRuntimes||(t.compatibleRuntimes=[\"nodejs14.x\"]);let i={compatibleRuntimes:t.compatibleRuntimes,description:t.description,sharedScope:common.layerShares[t.sharedScope],licenseInfo:t.licenseInfo};if(t.codePath){let e=fs.readFileSync(t.codePath);i.zipFile=Buffer.from(e).toString(\"base64\")}try{let o=await layerApi.createLayer(e,t.name,i);common.processSharedScopeLayerInfo(o.result),output.outputInfo(layerInfoTitles,o.result)}catch(e){output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}}function main(e){return{cmd:\"create-layer-version\",desc:locale(constants.DESC_CMD_CREATE_LAYER_VERSION),options:[setMandatory(OPTION.NameOptionInLayerCmd.option),setOptional(common.setCompatibleFakeDefaultValue(OPTION.CompatibleRuntimes.option)),setOptional(OPTION.LayerCode.option),setOptional(getOptionWithDefaultValue(OPTION.LayerSharedScope)),setOptional(OPTION.LayerDescription.option),setOptional(OPTION.LicenseInfo.option)],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func create-layer-version --name test-layer --compatible-runtimes nodejs14.x --code-path ./layer.zip --shared-scope business\"]],action(t){createLayerVersionCmd(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkFuncServiceEnabled(e)}}}export default main;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip\n |---相关配置项" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-management-0000001517922200", + "title": "函数管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-flow-manage-0000001658598194", + "title": "流量治理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "title": "创建层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "title": "更新层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "title": "删除层版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "title": "查询层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "title": "将函数绑定层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "title": "将函数解绑层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持一个函数最多可以绑定5个层。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Node.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---node_modules" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Java层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---config" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---application.properties //相关配置文件" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---lib" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Python层结构:\n|---layer.zip\n |---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发者开发云函数代码,通过相对路径的形式引用依赖。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在云函数主界面,选择“层”页签。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在层管理页面,点击“创建层”。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击您已创建的层,进入层详情页面。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "删除层版本,已经绑定在函数中的层不会失效。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "在您已创建的层列表中,找到待删除的层,点击层进入详情页。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "我的:开发者自己创建的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "共享:同项目+同团队下共享的。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "一个函数最多可以绑定5个层。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "返回到“层配置”界面,绑定成功的层将展示在层列表中。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + } + ], + "renderedText": "指南\n云函数\n函数管理\n层管理\n层管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。\n\n云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。\n\n云函数支持一个函数最多可以绑定5个层。\n\n注意\n\n上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。\n\nNode.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项\nJava层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖\nPython层结构:\n|---layer.zip\n |---相关配置项\n\n具体使用场景举例如下:\n\n开发者开发云函数代码,通过相对路径的形式引用依赖。\n依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。\n函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。\n开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。\n创建层\n在云函数主界面,选择“层”页签。\n在层管理页面,点击“创建层”。\n\n页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。\n\n更新层\n\n发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。\n\n点击您已创建的层,进入层详情页面。\n点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。\n在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。\n\n删除层版本\n\n删除层版本,已经绑定在函数中的层不会失效。\n\n在您已创建的层列表中,找到待删除的层,点击层进入详情页。\n点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。\n\n删除层\n\n在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。\n\n注意\n\n删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。\n\n查询层\n进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。\n如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。\n\n将函数绑定层\n在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。\n\n在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。\n\n返回到“层配置”界面,绑定成功的层将展示在层列表中。\n\n将函数解绑层\n进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。\n\n点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。\n\n流量治理\n触发器管理\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建层\n更新层\n删除层版本\n删除层\n查询层\n将函数绑定层\n将函数解绑层\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "层描述", + "对正在创建层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 团队内共享 项目内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入类型,仅支持上传zip文件。 说明 ZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层描述", + "对正在创建的层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入的文件类型,zip文件。 说明 ZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "版本", + "存在多个层版本时,选择函数绑定的层版本。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。 nodejs java python custom-runtime" + ], + [ + "层描述", + "层的附加说明,长度不超过1024位。" + ] + ], + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174" + } + ], + "title": "层管理" + } + ] +} diff --git a/pkg/domain/reference/functions/list-layers.json b/pkg/domain/reference/functions/list-layers.json new file mode 100644 index 0000000..08dd481 --- /dev/null +++ b/pkg/domain/reference/functions/list-layers.json @@ -0,0 +1,463 @@ +{ + "title": "list-layers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/cmd/layer/createLayerVersionCmd.js", + "sha256": "0a5c496d678c12b820d43528eb43eaa41a09a09fa087791bb91ebbc06650a4ca", + "source": "import common from\"./common.js\";import constants from\"../../constants/constants.js\";import fs from\"fs\";import verify from\"../../option/verify.js\";import layerApi from\"../../api/layerApi.js\";import output from\"../../util/output.js\";import{layerInfoTitles}from\"./titles.js\";import{OPTION,setOptional,setMandatory,getOptionWithDefaultValue}from\"../../option/options.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function createLayerVersionCmd(e,t){const{logger:o}=e;if(!await hasFunctionServicePermission(e))return;try{new verify.Verifier(t).addVerifyOptionFunc(verify.verifyNameOptionInLayerCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyLayerCodePath,\"codePath\",!0).addVerifyOptionFunc(verify.verifyLayerDescription,\"description\",!1).addVerifyOptionFunc(verify.verifyLayerSharedScope,\"sharedScope\",!0).addVerifyOptionFunc(verify.verifyLicenseInfo,\"licenseInfo\",!1).addVerifyOptionFunc(verify.verifyCompatibleRuntimes,\"compatibleRuntimes\",!1).done()}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}try{if(!await layerApi.queryLayerInfo(e,t.name,\"1\"))return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,{message:locale(constants.ERR_MSG_LAYER_UNEXIST)})}catch(e){return void output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}t.compatibleRuntimes||(t.compatibleRuntimes=[\"nodejs14.x\"]);let i={compatibleRuntimes:t.compatibleRuntimes,description:t.description,sharedScope:common.layerShares[t.sharedScope],licenseInfo:t.licenseInfo};if(t.codePath){let e=fs.readFileSync(t.codePath);i.zipFile=Buffer.from(e).toString(\"base64\")}try{let o=await layerApi.createLayer(e,t.name,i);common.processSharedScopeLayerInfo(o.result),output.outputInfo(layerInfoTitles,o.result)}catch(e){output.outputError(constants.FAILED_CREATE_LAYER_VERSION_CMD,e)}}function main(e){return{cmd:\"create-layer-version\",desc:locale(constants.DESC_CMD_CREATE_LAYER_VERSION),options:[setMandatory(OPTION.NameOptionInLayerCmd.option),setOptional(common.setCompatibleFakeDefaultValue(OPTION.CompatibleRuntimes.option)),setOptional(OPTION.LayerCode.option),setOptional(getOptionWithDefaultValue(OPTION.LayerSharedScope)),setOptional(OPTION.LayerDescription.option),setOptional(OPTION.LicenseInfo.option)],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func create-layer-version --name test-layer --compatible-runtimes nodejs14.x --code-path ./layer.zip --shared-scope business\"]],action(t){createLayerVersionCmd(e,t)},beforeAction:async()=>{await checkIsLogin(e),await checkSelectedProject(e),await checkFuncServiceEnabled(e)}}}export default main;" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip\n |---相关配置项" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-management-0000001517922200", + "title": "函数管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-flow-manage-0000001658598194", + "title": "流量治理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "title": "创建层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "title": "更新层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "title": "删除层版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "title": "查询层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "title": "将函数绑定层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "title": "将函数解绑层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持一个函数最多可以绑定5个层。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Node.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---node_modules" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Java层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---config" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---application.properties //相关配置文件" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---lib" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Python层结构:\n|---layer.zip\n |---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发者开发云函数代码,通过相对路径的形式引用依赖。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在云函数主界面,选择“层”页签。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在层管理页面,点击“创建层”。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击您已创建的层,进入层详情页面。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "删除层版本,已经绑定在函数中的层不会失效。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "在您已创建的层列表中,找到待删除的层,点击层进入详情页。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "我的:开发者自己创建的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "共享:同项目+同团队下共享的。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "一个函数最多可以绑定5个层。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "返回到“层配置”界面,绑定成功的层将展示在层列表中。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + } + ], + "renderedText": "指南\n云函数\n函数管理\n层管理\n层管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。\n\n云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。\n\n云函数支持一个函数最多可以绑定5个层。\n\n注意\n\n上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。\n\nNode.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项\nJava层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖\nPython层结构:\n|---layer.zip\n |---相关配置项\n\n具体使用场景举例如下:\n\n开发者开发云函数代码,通过相对路径的形式引用依赖。\n依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。\n函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。\n开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。\n创建层\n在云函数主界面,选择“层”页签。\n在层管理页面,点击“创建层”。\n\n页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。\n\n更新层\n\n发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。\n\n点击您已创建的层,进入层详情页面。\n点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。\n在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。\n\n删除层版本\n\n删除层版本,已经绑定在函数中的层不会失效。\n\n在您已创建的层列表中,找到待删除的层,点击层进入详情页。\n点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。\n\n删除层\n\n在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。\n\n注意\n\n删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。\n\n查询层\n进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。\n如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。\n\n将函数绑定层\n在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。\n\n在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。\n\n返回到“层配置”界面,绑定成功的层将展示在层列表中。\n\n将函数解绑层\n进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。\n\n点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。\n\n流量治理\n触发器管理\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建层\n更新层\n删除层版本\n删除层\n查询层\n将函数绑定层\n将函数解绑层\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "层描述", + "对正在创建层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 团队内共享 项目内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入类型,仅支持上传zip文件。 说明 ZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层描述", + "对正在创建的层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入的文件类型,zip文件。 说明 ZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "版本", + "存在多个层版本时,选择函数绑定的层版本。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。 nodejs java python custom-runtime" + ], + [ + "层描述", + "层的附加说明,长度不超过1024位。" + ] + ], + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174" + } + ], + "title": "层管理" + } + ] +} diff --git a/pkg/domain/reference/functions/list-triggers.json b/pkg/domain/reference/functions/list-triggers.json new file mode 100644 index 0000000..73de7f9 --- /dev/null +++ b/pkg/domain/reference/functions/list-triggers.json @@ -0,0 +1,355 @@ +{ + "title": "list-triggers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Listing path is also reviewed in boundary/triggerService.js." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/publish-function.json b/pkg/domain/reference/functions/publish-function.json new file mode 100644 index 0000000..9648234 --- /dev/null +++ b/pkg/domain/reference/functions/publish-function.json @@ -0,0 +1,61 @@ +{ + "title": "publish-function", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/publishFunctionCmd.js", + "sha256": "638fde2d41a7f7eb09d7e56d9ba63b320d4d07d347125cc8317d73fe414dfd6e", + "source": "import{hasFunctionServicePermission}from\"../../util/tools.js\";import constants from\"../../constants/constants.js\";import functionApi from\"../../api/functionApi.js\";import{locale}from\"../../util/locale.js\";import verify from\"../../option/verify.js\";import output from\"../../util/output.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";import{functionInfoTitles}from\"./titles.js\";import{OPTION,setOptional,setMandatory}from\"../../option/options.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";async function publishFunctionCmd(t,n){const{logger:o}=t;if(!await hasFunctionServicePermission(t))return;try{new verify.Verifier(n).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyVersionDescription,\"versionDescription\",!0).done()}catch(t){return void output.outputError(constants.FAILED_PUBLISH_FUNCTION_CMD,t)}let i=null;try{i=await functionApi.queryFunctionVersion(t,n.name,\"$latest\")}catch(t){return void output.outputError(constants.FAILED_PUBLISH_FUNCTION_CMD,t)}let{revisionId:e}=i.function,r=null;try{r=await functionApi.publishFunction(t,n.name,n.versionDescription,e)}catch(t){return void output.outputError(constants.FAILED_PUBLISH_FUNCTION_CMD,t)}try{output.outputInfo(functionInfoTitles,r.function)}catch(t){output.outputError(constants.FAILED_PUBLISH_FUNCTION_CMD,t)}}function main(t){return{cmd:\"publish-function\",desc:`${locale(constants.DESC_CMD_PUBLISH_FUNCTION)}`,options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setMandatory(OPTION.VersionDescription.option)],child:[],addHelpText:[[\"after\",'\\nExample:\\n agcli func publish-function --name a1 --version-description \"publish function description\"']],action(n){publishFunctionCmd(t,n)},beforeAction:async()=>{await checkIsLogin(t),await checkSelectedProject(t),await checkFuncServiceEnabled(t)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/query-function-version.json b/pkg/domain/reference/functions/query-function-version.json new file mode 100644 index 0000000..5a858fa --- /dev/null +++ b/pkg/domain/reference/functions/query-function-version.json @@ -0,0 +1,61 @@ +{ + "title": "query-function-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/queryFunctionVersionCmd.js", + "sha256": "03b592c00c42505158113e5960a2014afa857a5a88643cb7f3c70f3d694bdfce", + "source": "import constants from\"../../constants/constants.js\";import functionApi from\"../../api/functionApi.js\";import output from\"../../util/output.js\";import verify from\"../../option/verify.js\";import{functionInfoTitles}from\"./titles.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{OPTION,getOptionWithDefaultValue,setOptional,setMandatory}from\"../../option/options.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function queryFunctionVersionCmd(t,n){const{logger:o}=t;if(!await hasFunctionServicePermission(t))return;try{new verify.Verifier(n).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyVersionOptionInFunctionCmd,\"version\",!0).done()}catch(t){return void output.outputError(constants.FAILED_QUERY_FUNCTION_VERSION_CMD,t)}let i;try{i=await functionApi.queryFunctionVersion(t,n.name,n.version)}catch(t){return void output.outputError(constants.FAILED_QUERY_FUNCTION_VERSION_CMD,t)}output.outputInfo(functionInfoTitles,i.function)}function main(t){return{cmd:\"query-function-version\",desc:`${locale(constants.DESC_CMD_QUERY_FUNCTION_VERSION)}`,options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setOptional(getOptionWithDefaultValue(OPTION.VersionOptionInFunctionCmd))],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func query-function-version --name a1 --function-version $latest\"]],action(n){queryFunctionVersionCmd(t,n)},beforeAction:async()=>{await checkIsLogin(t),await checkSelectedProject(t),await checkFuncServiceEnabled(t)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/update-alias.json b/pkg/domain/reference/functions/update-alias.json new file mode 100644 index 0000000..0718b96 --- /dev/null +++ b/pkg/domain/reference/functions/update-alias.json @@ -0,0 +1,261 @@ +{ + "title": "update-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/aliasApi.js", + "sha256": "3340b3b361b3805c80ec197b547653f88a83322bc7a3d57f10e8f901c35e4814", + "source": "import constants from\"../constants/constants.js\";import{isEmpty}from\"../util/tools.js\";import{newArgError,newOtherErrorWithMessage}from\"../error/errors.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import functionApi from\"./functionApi.js\";function assembleAliasInfo(t,e,n){return{functionVersion:e.result.functionVersion,revisionId:e.result.revisionId,description:isEmpty(t.description)?e.result.description:t.description,routingConfig:isEmpty(t.routingConfig)?e.result.routingConfig:n}}async function checkRoutingConfig(t,e,n){let r,o=await functionApi.listFunctionVersions(t,e.functionName,10,1);r=n?n.result.functionVersion:e.functionVersion;let s=getLatestPublishedVersion(o),i={};if(isEmpty(e.routingConfig))return i[r]=100,i;try{i=JSON.parse(e.routingConfig)}catch(t){throw newArgError(locale(constants.ROUTING_CONFIG_NOT_JSON))}let a=Object.keys(i).length;if(a>2)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_MAX_VERSION));if(2===a)return i;if(1===a){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){if(100===i[t])return i}if(r===s&&r in i){if(100===i[r])return i;throw newArgError(locale(constants.ROUTING_CONFIG_ONLY_LATEST_VERSION))}if(r in i){for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[s]=100-e}}else for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)){let e=i[t];if(e<0||e>100)throw newArgError(locale(constants.ROUTING_CONFIG_OVER_WEIGHT));i[r]=100-e}}return i}function getLatestPublishedVersion(t){if(0===t.functions.length)throw newArgError(locale(constants.FUNCTION_LIST_EMPTY));return 1===t.functions.length?t.functions[0].versionNumber:t.functions.length>=2?\"$latest\"!==t.functions[0].versionNumber?t.functions[0].versionNumber:t.functions[1].versionNumber:void 0}async function listAliases(t,e,n,r,o,s){const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases`;return new Promise(((a,c)=>{t.edge({url:i,method:\"GET\",params:{pageIndex:r||constants.DEFAULT_FUNCTION_PAGE_INDEX,pageSize:o||constants.DEFAULT_FUNCTION_PAGE_SIZE,functionVersion:n}}).then((t=>t?0===t.code?t.result.total&&0!==t.result.total?void a(t):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ANY_ALIAS),{functionName:e}))):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_REASON_CMD),{message:t.message}))):s?void a({result:{aliases:[]}}):void c(newOtherErrorWithMessage(output.strFormat(locale(constants.FAILED_LIST_ALIAS_CMD),{message:constants.UNKNOWN_REASON}))))).catch((t=>{c(functionApi.processEdgeError(t))}))}))}async function createAlias(t,e,n){let r=await checkRoutingConfig(t,e,null),o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases`;return new Promise(((n,s)=>{t.edge({url:o,method:\"POST\",data:{name:e.name,functionVersion:e.functionVersion,description:e.description,routingConfig:r}}).then((t=>{n(t.result)})).catch((t=>{s(functionApi.processEdgeError(t))}))}))}async function updateAlias(t,e,n){let r,o,s=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e.functionName}/aliases/${e.name}`,i=await queryAliasInfo(t,e.functionName,e.name);return isEmpty(e.routingConfig)||(o=await checkRoutingConfig(t,e,i)),r=assembleAliasInfo(e,i,o),t.edge({url:s,method:\"PUT\",data:r}).then((t=>t.result)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function queryAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"GET\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}async function deleteAliasInfo(t,e,n){return t.edge({url:`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${e}/aliases/${n}`,method:\"DELETE\"}).then((t=>t)).catch((t=>{throw functionApi.processEdgeError(t)}))}export{queryAliasInfo,listAliases,createAlias,updateAlias,deleteAliasInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Read get-alias first and provide revisionId plus the full intended routing configuration." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "title": "创建别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "title": "查看别名列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "title": "删除别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "title": "权重策略" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "title": "规则策略" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "名称:别名名称,此函数下必须唯一。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "描述:别名描述,长度不超过64个字符。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "主版本:别名指向的主版本,创建后支持修改。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "查看别名列表有两种方式:" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "点击右侧“操作”列的“删除”即可删除别名。" + }, + { + "section": "基于别名的灰度能力", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "text": "别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”选择“新建模板”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "配置完成后,点击“保存”。" + } + ], + "renderedText": "别名管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。\n\n具体使用场景举例如下:\n\n发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。\n发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。\n创建别名\n在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。\n\n在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。\n\n创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。\n\n查看别名列表\n\n查看别名列表有两种方式:\n\n方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。\n\n方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。\n\n删除别名\n在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。\n点击右侧“操作”列的“删除”即可删除别名。\n\n基于别名的灰度能力\n\n别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。\n\n权重策略\n\n通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。\n\n规则策略\n\n通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。\n\n配置完成后,点击“保存”。\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建别名\n查看别名列表\n删除别名\n基于别名的灰度能力\n权重策略\n规则策略\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949", + "status": "browser-read", + "tables": [], + "title": "别名管理" + } + ] +} diff --git a/pkg/domain/reference/functions/update-and-publish-function.json b/pkg/domain/reference/functions/update-and-publish-function.json new file mode 100644 index 0000000..2003075 --- /dev/null +++ b/pkg/domain/reference/functions/update-and-publish-function.json @@ -0,0 +1,61 @@ +{ + "title": "update-and-publish-function", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/updateAndPublishFunctionCmd.js", + "sha256": "41eb7c39ef24d706fafc475259ccfcaabac0e6476e395cbc70f0de34972cfbb0", + "source": "import{OPTION,setOptional,setMandatory}from\"../../option/options.js\";import constants from\"../../constants/constants.js\";import output from\"../../util/output.js\";import functionApi from\"../../api/functionApi.js\";import verify from\"../../option/verify.js\";import{functionInfoTitles}from\"./titles.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{locale}from\"../../util/locale.js\";async function updateAndPublishFunctionCmd(n,t){if(!await hasFunctionServicePermission(n))return;try{verify.verifyExclusionEnvironmentOption(t),new verify.Verifier(t).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyVersionDescription,\"versionDescription\",!0).addVerifyOptionFunc(verify.verifyFunctionCodePath,\"codePath\",!1).addVerifyOptionFunc(verify.verifyMemory,\"memory\",!1).addVerifyOptionFunc(verify.verifyTimeout,\"timeout\",!1).addVerifyOptionFunc(verify.verifyInstanceConcurrency,\"instanceConcurrency\",!1).addVerifyOptionFunc(verify.verifyEnvironment,\"environment\",!1).addVerifyOptionFunc(verify.verifyEnvironmentFile,\"environmentFile\",!1).addVerifyOptionFunc(verify.verifyLayers,\"layers\",!1).done()}catch(n){return void output.outputError(constants.FAILED_UPDATE_AND_PUBLISH_FUNCTION_CMD,n)}let i,o,e=!0;2===Object.keys(t).length&&(e=!1);try{o=await functionApi.queryFunctionVersion(n,t.name,\"$latest\"),i=o.function.revisionId}catch(n){return void output.outputError(constants.FAILED_UPDATE_AND_PUBLISH_FUNCTION_CMD,n)}if(e)try{i=(await functionApi.updateFunction(n,t,o.function,i)).function.revisionId}catch(n){return void output.outputError(constants.FAILED_UPDATE_AND_PUBLISH_FUNCTION_CMD,n)}let r=null;try{r=await functionApi.publishFunction(n,t.name,t.versionDescription,i)}catch(n){return void output.outputError(constants.FAILED_UPDATE_AND_PUBLISH_FUNCTION_CMD,n)}try{output.outputTable(functionInfoTitles,r.function)}catch(n){output.outputError(constants.FAILED_UPDATE_AND_PUBLISH_FUNCTION_CMD,n)}}function main(n){return{cmd:\"update-and-publish-function\",desc:`${locale(constants.DESC_CMD_UPDATE_AND_PUBLISH_FUNCTION)}`,options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setMandatory(OPTION.VersionDescription.option),setOptional(OPTION.FunctionCode.option),setOptional(OPTION.Memory.option),setOptional(OPTION.Timeout.option),setOptional(OPTION.InstanceConcurrency.option),setOptional(OPTION.Handler.option),setOptional(OPTION.Environment.option),setOptional(OPTION.EnvironmentFile.option),setOptional(OPTION.Layers.option)],child:[],addHelpText:[[\"after\",'\\nExample:\\n agcli func update-and-publish-function --name a1 --version-description \"version description is necessary\" --code-path ./function.zip ']],action:t=>updateAndPublishFunctionCmd(n,t),beforeAction:async()=>{await checkIsLogin(n),await checkSelectedProject(n),await checkFuncServiceEnabled(n)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/update-cron-trigger.json b/pkg/domain/reference/functions/update-cron-trigger.json new file mode 100644 index 0000000..338b07c --- /dev/null +++ b/pkg/domain/reference/functions/update-cron-trigger.json @@ -0,0 +1,148 @@ +{ + "title": "update-cron-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/triggerApi.js", + "sha256": "fdfd34f00e851f4c0fe3859bbd68c5f3212c184aa63be556e2311708d374a197", + "source": "import{isEmpty,getAliasOrVersion}from\"../util/tools.js\";import functionApi from\"./functionApi.js\";async function getFunctionId(e,r,t){let i=(await functionApi.queryFunctionVersion(e,r,t)).function.id,n=i.split(\":\");return n.pop(),n.push(t),i=n.join(\":\"),i}function callCreateCronTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createCronTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));isEmpty(r.payload)||\"string\"!=typeof r.payload?isEmpty(r.payload)||(t=r.payload):t=JSON.parse(r.payload);return callCreateCronTriggerService(e,{funcId:i,triggerType:\"Cron\",triggerMode:r.triggerMode,triggerSwitch:!1,spec:{schedule:r.schedule,payload:t}})}const authTypeList=[\"apigw-client\",\"cloudgw-client\",\"internal-auth\"];function callCreateHttpTriggerService(e,r){return new Promise(((t,i)=>{e.edge({url:`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger`,method:\"POST\",data:r}).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function createHttpTrigger(e,r){let t,i=await getFunctionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"));t=authTypeList.includes(r.authType)?r.authType:\"apigw-client\";return callCreateHttpTriggerService(e,{mode:\"NO_PATH\",funcId:i,authFlag:!0,authAlgor:\"HDA-SYSTEM\",authType:t,enableUrlDecode:\"false\"!==r.enableUrlDecode})}async function updateCronTrigger(e,r,t,i){let n={funcId:r.funcId,triggerMode:r.triggerMode,triggerSwitch:\"true\"===i,spec:r.spec,revisionId:r.revisionId},o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${t}`;return e.edge({url:o,method:\"PUT\",data:n}).then((e=>e.result)).catch((e=>{throw functionApi.processEdgeError(e)}))}async function getTriggerById(e,r){return new Promise(((t,i)=>{e.edge.get(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function deleteTriggerById(e,r){return new Promise(((t,i)=>{e.edge.delete(r).then((e=>{t(e.result)})).catch((e=>{i(functionApi.processEdgeError(e))}))}))}async function queryOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return getTriggerById(e,t)}async function deleteOtherTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/${r}`;return deleteTriggerById(e,t)}async function queryHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return getTriggerById(e,t)}async function deleteHttpTrigger(e,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/${r}`;return deleteTriggerById(e,t)}async function getPolicyRevisionId(e,r,t){return e.edge.get(`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r}/policy`,{params:{qualifier:t}}).then((e=>isEmpty(e.result.revisionId)?\"\":e.result.revisionId)).catch((e=>\"\"))}async function createPolicy(e,r,t,i){let n={effect:\"Allow\",action:\"InvokeFunction\",sourceProvider:t,sourceId:i,revisionId:await getPolicyRevisionId(e,r.functionName,getAliasOrVersion(r,\"aliasName\",\"functionVersion\"))};const o=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${r.functionName}/policy`;return e.edge({url:o,method:\"POST\",params:{qualifier:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")},data:n}).then((e=>e)).catch((e=>{throw functionApi.processEdgeError(e)}))}export{getTriggerById,createPolicy,getFunctionId,callCreateCronTriggerService,createCronTrigger,callCreateHttpTriggerService,createHttpTrigger,queryOtherTrigger,queryHttpTrigger,updateCronTrigger,deleteHttpTrigger,deleteOtherTrigger};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/boundary/triggerService.js", + "sha256": "295bf48da5487467f559e5adcc1d8be29abfc62196a5dd4af61ca0aab58762a9", + "source": "import{getFunctionId}from\"../api/triggerApi.js\";import{getAliasOrVersion,isEmpty}from\"../util/tools.js\";import types from\"../types/type.js\";import output from\"../util/output.js\";import{locale}from\"../util/locale.js\";import constants from\"../constants/constants.js\";async function writeTriggerList(t,e,r,g){const{triggerResult:i,httpTriggerResult:o}=await getTriggerList(t,e,r,g);let s=addTriggerInfo(i,o),a=1;switch(i&&i.total>0&&(a=i.total),r.output){case\"table\":{let e=[\"TriggerType\",\"TriggerId\"],i=new types.ListInfo(e,null,s),o=new types.PageFuncInfo(g,t,r,r.pageIndex,a);output.outputListCmd(t.logger,output.strFormat(locale(constants.SUCCEED_LIST_TRIGGER_CMD),{functionName:r.functionName,version:getAliasOrVersion(r,\"aliasName\",\"functionVersion\")}),i,o);break}default:s=mergeTriggerJSONResult(i,o,r.pageSize,r.pageIndex),PRINT(JSON.stringify(s,null,\"\\t\"))}}async function getTriggerListAsJson(t,e,r){r.pageSize=99,r.pageIndex=1;const{triggerResult:g,httpTriggerResult:i}=await getTriggerList(t,e,r);return mergeTriggerJSONResult(g,i,r.pageSize,r.pageIndex)}async function getTriggerList(t,e,r){try{let g=await getFunctionId(t,e.functionName,getAliasOrVersion(e,\"aliasName\",\"functionVersion\"));const i=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/trigger/list/${g}`,o=`${t.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/triggers/list/${g}`,s=await getTrigger(o,t,r.pageSize,r.pageIndex);return{triggerResult:s,httpTriggerResult:await getTrigger(i,t,r.pageSize,r.pageIndex)}}catch(t){output.outputError(constants.FAILED_LIST_TRIGGER_CMD,t)}}function mergeTriggerJSONResult(t,e,r,g){let i={},o={pageSize:r,pageIndex:g,total:0};if(i.pageInfo=o,e&&e.count&&e.count>0){o.total=e.count,i.httptrigger=[];for(let t of e.triggers)isEmpty(t.triggerId)||i.httptrigger.push({triggerId:t.triggerId,method:t.method,authFlag:t.authFlag,authAlgor:t.authAlgor,authType:t.authType,enableUrlDecode:t.enableUrlDecode,triggerUrl:t.triggerUrl,createTime:t.createTime,updateTime:t.updateTime})}if(t&&t.total&&t.total>0){o.total+=t.total,i.crontrigger=[];for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||i.crontrigger.push({triggerId:e.triggerId,triggerType:e.triggerType,triggerSwitch:e.triggerSwitch,triggerMode:e.triggerMode,spec:e.spec,createTime:e.createTime})}return i}function addTriggerInfo(t,e){let r=[];if(e&&e.count&&e.count>0)for(let t of e.triggers)isEmpty(t.triggerId)||r.push({TriggerId:t.triggerId,TriggerType:\"HTTP\"});if(t&&t.total&&t.total>0)for(let e of t.triggers)isEmpty(e.triggerId)||isEmpty(e.triggerType)||r.push({TriggerId:e.triggerId,TriggerType:e.triggerType});return r}async function getTrigger(t,e,r,g){return e.edge.get(t,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:g||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((t=>{if(t&&0===t.code&&0!==t.result.count&&0!==t.result.total)return t.result})).catch((()=>{}))}export{writeTriggerList,getTriggerListAsJson};" + }, + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Read get-trigger first; preserve funcId, spec, triggerMode and revisionId." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + } + ] +} diff --git a/pkg/domain/reference/functions/update-function-code.json b/pkg/domain/reference/functions/update-function-code.json new file mode 100644 index 0000000..89bc83b --- /dev/null +++ b/pkg/domain/reference/functions/update-function-code.json @@ -0,0 +1,61 @@ +{ + "title": "update-function-code", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/updateFunctionCodeCmd.js", + "sha256": "665df45feb0936240059ac1e497944b1c854cbecf35327efa6aa92215f856b0d", + "source": "import constants from\"../../constants/constants.js\";import functionApi from\"../../api/functionApi.js\";import verify from\"../../option/verify.js\";import output from\"../../util/output.js\";import{functionInfoTitles}from\"./titles.js\";import{OPTION,setMandatory}from\"../../option/options.js\";import{hasFunctionServicePermission}from\"../../util/tools.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";async function updateFunctionCodeCmd(t,o){const{logger:n}=t;if(!await hasFunctionServicePermission(t))return;try{new verify.Verifier(o).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyFunctionCodePath,\"codePath\",!0).done()}catch(t){return void output.outputError(constants.FAILED_UPDATE_FUNCTION_CODE_CMD,t)}let i=null;try{i=await functionApi.queryFunctionVersion(t,o.name,\"$latest\")}catch(t){return void output.outputError(constants.FAILED_UPDATE_FUNCTION_CODE_CMD,t)}let e=null;try{e=await functionApi.updateFunction(t,o,i.function,i.function.revisionId)}catch(t){return void output.outputError(constants.FAILED_UPDATE_FUNCTION_CODE_CMD,t)}output.outputInfo(functionInfoTitles,e.function)}function main(t){return{cmd:\"update-function-code\",desc:`${locale(constants.DESC_CMD_UPDATE_FUNCTION_CODE)}`,options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setMandatory(OPTION.FunctionCode.option)],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func update-function-code --name a1 --code-path ./function.zip\"]],action(o){updateFunctionCodeCmd(t,o)},beforeAction:async()=>{await checkIsLogin(t),await checkSelectedProject(t),await checkFuncServiceEnabled(t)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/functions/update-function-config.json b/pkg/domain/reference/functions/update-function-config.json new file mode 100644 index 0000000..1deb6cb --- /dev/null +++ b/pkg/domain/reference/functions/update-function-config.json @@ -0,0 +1,61 @@ +{ + "title": "update-function-config", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/cloudfunction/api/functionApi.js", + "sha256": "0c6381043b1c59276591f681335d987010ea5cc274f84e3deaf1bfbd916c76b3", + "source": "import constants from\"../constants/constants.js\";import FormData from\"form-data\";import{processEdgeError,makeTraceId}from\"./common.js\";import parse from\"../option/parse.js\";import{readFunctionCodeFile,getLayerVersionUrns,isEmpty}from\"../util/tools.js\";async function invokeFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/invocations`;let o=makeTraceId();\"{}\"===JSON.stringify(t)&&(t=null);let a={url:s,method:\"POST\",headers:{\"x-trace-id\":o},params:{qualifier:r||\"$latest\"},data:t};return new Promise(((n,r)=>{e.edgeWithRawResponse(a).then((e=>{n({traceId:o,response:e})})).catch((e=>r(processEdgeError(e))))}))}async function listFunctions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((o,a)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX,qualifier:\"$latest\",name:n,status:1}}).then((e=>{o(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function publishFunction(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;let o=makeTraceId();return new Promise(((n,a)=>{e.edge({url:s,method:\"POST\",headers:{\"x-trace-id\":o},data:{versionDesc:r,revisionId:t}}).then((e=>{n(e)})).catch((e=>{a(processEdgeError(e))}))}))}async function queryFunctionVersion(e,n,r){isEmpty(r)&&(r=\"$latest\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}`;return new Promise(((n,s)=>{e.edge.get(t,{params:{qualifier:r}}).then((e=>{n(e)})).catch((e=>{s(processEdgeError(e))}))}))}async function listFunctionVersions(e,n,r,t){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n}/versions`;return new Promise(((n,o)=>{e.edge.get(s,{params:{pageSize:r||constants.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||constants.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{n(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function createFunction(e,n,r){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions`;return new Promise(((s,o)=>{e.edge({url:t,method:\"POST\",headers:n,data:r,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{s(e)})).catch((e=>{o(processEdgeError(e))}))}))}async function updateFunction(e,n,r,t){let s=new FormData;s.append(\"revisionId\",t);let o=s.getHeaders();o.accept=\"application/json\";let a=new parse.Parser(n).addParseOptionFunc(parse.parseEnvironment).addParseOptionFunc(parse.parseEnvironmentFile).addParseOptionFunc(parse.parseInstanceConcurrency).addParseOptionFunc(parse.parseMemory).addParseOptionFunc(parse.parseTimeout).addParseOptionFunc(parse.parseHandler).addParseOptionFunc(parse.parseVersionDescription,\"versionDesc\").done();!a.environment&&r.environment&&(a.environment=JSON.stringify(r.environment)),!a.layers&&r.layers&&(a.layers=JSON.stringify(r.layers)),a.handler||(a.handler=r.handler);for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&s.append(e,a[e]);if(n.codePath){let{codeSize:e,sha256:r,fileStream:t}=await readFunctionCodeFile(n.codePath);o[\"x-file-digest\"]=e,o[\"x-file-digest-sha256\"]=r,s.append(\"file\",t)}if(n.layers){let r=await getLayerVersionUrns(e,n.layers);s.append(\"layers\",JSON.stringify(r))}const i=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/functions/${n.name}`;return new Promise(((n,r)=>{e.edge({url:i,method:\"PUT\",headers:o,data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{n(e)})).catch((e=>{r(processEdgeError(e))}))}))}export default{createFunction:createFunction,invokeFunction:invokeFunction,listFunctions:listFunctions,listFunctionVersions:listFunctionVersions,publishFunction:publishFunction,queryFunctionVersion:queryFunctionVersion,updateFunction:updateFunction,processEdgeError:processEdgeError};" + }, + { + "packagePath": "commands/cloudfunction/api/layerApi.js", + "sha256": "e83075d25be8e16deb438b9dbc070fa3d110c96ec62c129d5d78662f62329f5d", + "source": "import consts from\"../constants/constants.js\";import{newArgError,newAgcGwError}from\"../error/errors.js\";import{processEdgeError}from\"./common.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";async function queryLayerList(e,r){const s=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers`;return new Promise(((t,o)=>{e.edge.get(s,{params:{layerName:r.layerName,pageSize:r.pageSize?r.pageSize:consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:r.pageIndex?r.pageIndex:consts.DEFAULT_FUNCTION_PAGE_INDEX,ownerFlag:r.ownerFlag,compatibleRuntime:r.compatibleRuntime}}).then((e=>{t(e.result)})).catch((e=>{o(processEdgeError(e))}))}))}async function queryLayerVersionList(e,r,s,t,o){const a=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,n)=>{e.edge.get(a,{params:{compatibleRuntime:s,pageSize:o||consts.DEFAULT_FUNCTION_PAGE_SIZE,pageIndex:t||consts.DEFAULT_FUNCTION_PAGE_INDEX}}).then((e=>{r(e.result)})).catch((e=>{n(processEdgeError(e))}))}))}async function queryLayerInfo(e,r,s){s||(s=\"1\");const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions/${s}`;return new Promise(((o,a)=>{e.edge.get(t,{params:{}}).then((e=>{e&&0===e.code&&e.result?o(e.result):a(newArgError(output.strFormat(locale(consts.ERR_MSG_LAYER_UNEXIST),{layer:`${r}:${s}`})))})).catch((e=>{a(processEdgeError(e))}))}))}async function createLayer(e,r,s){const t=`${e.storage.getProjectBaseUrl()}/api/wisefunction/serverless/v1/layers/${r}/versions`;return new Promise(((r,o)=>{e.edge({url:t,method:\"POST\",data:s,maxContentLength:1/0,maxBodyLength:1/0}).then((e=>{r(e)})).catch((e=>{\"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\"===e.code?o(newAgcGwError(consts.AGC_GW_FILE_TOO_BIGGER_CODE,e.code)):o(processEdgeError(e))}))}))}export default{createLayer:createLayer,queryLayerVersionList:queryLayerVersionList,queryLayerList:queryLayerList,queryLayerInfo:queryLayerInfo};" + }, + { + "packagePath": "commands/cloudfunction/option/options.js", + "sha256": "2bdfcd7383e38bd4a32ee31ca8b5b1ca2bfe74b99ac908061078be69d442176f", + "source": "import constants from\"../constants/constants.js\";import{ErrorType,CloudFunctionError}from\"../error/errors.js\";import{locale}from\"../util/locale.js\";const OPTION=Object.freeze({FuzzyNameOptionInFunctionCmd:{option:[\"--fuzzy-name \",\"Function name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},FuzzyNameOptionInLayerCmd:{option:[\"--fuzzy-name \",\"Layer name for fuzzy search. Enter a string of up to 32 characters, including only lowercase letters, digits, and hyphens (-).\"],defaultValue:null},NameOptionInAliasCmd:{option:[\"--name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInFunctionCmd:{option:[\"--name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},NameOptionInLayerCmd:{option:[\"--name \",\"Layer name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The layer name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionName:{option:[\"--function-name \",\"Function name. Enter a string of 2 to 32 characters, including only lowercase letters, digits, and hyphens (-). The function name must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},Destination:{option:[\"-d --destination \",\"\"],defaultValue:null},Source:{option:[\"-s --source \",\"\"],defaultValue:null},Runtime:{option:[\"--runtime \",\"Function runtime. The options are nodejs14.x, java1.8, custom-runtime , and python3.\"],defaultValue:\"nodejs14.x\"},FunctionCode:{option:[\"--code-path \",\"Path of the function deployment package. Enter a valid path with the package name. The package must be a ZIP package.\"],defaultValue:null},VersionOptionInFunctionCmd:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},FunctionVersion:{option:[\"--function-version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Version:{option:[\"--version \",\"Function version. Use $latest, which stands for the latest version, or enter a character string, which is an integer ranging from 1 to 1000.\"],defaultValue:\"$latest\"},Memory:{option:[\"--memory \",\"Function memory resources, in Mi. The options are 500, 1000, 2000, and 4000.\"],defaultValue:500},Timeout:{option:[\"--timeout \",\"Function timeout interval, in seconds. Enter an integer ranging from 1 to 1800. You are advised to set this parameter to 1 to 55 for synchronous function calls, and to 1 to 1800 for asynchronous function calls.\"],defaultValue:55},InstanceConcurrency:{option:[\"--instance-concurrency \",\"Maximum number of concurrent function instances. Enter an integer ranging from 1 to 1000.\"],defaultValue:100},Handler:{option:[\"--handler \",\"Handler. The handler format varies as follows:\\nnodejs14.x and python3: Handler file name.Handler method name. Enter a string of up to 64 characters. The handler file name and handler method name can contain only letters, digits, underscores (_), and hyphens (-).\\njava1.8: Package name.Main class::Handler method or Package name.Main class. The package, class, and method name must contain only digits, letters, and underscores (_) and start with a letter or an underscore (_). Enter a string of up to 24 characters. The package can contain up to 8 layers.\"],defaultValue:null},Description:{option:[\"--description \",\"Function description. Enter a string of up to 64 characters.\"],defaultValue:null},VersionDescription:{option:[\"--version-description \",\"Function version description. Enter a string of up to 64 characters.\"],defaultValue:null},Environment:{option:[\"--environment \",\"Function environment variable, of the JSON string type. envKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment-file parameter.\"],defaultValue:null},EnvironmentFile:{option:[\"--environment-file \",\"Function environment variable file. \\nEnter a valid path with the file name. The file must be in JSON format. \\nThe file content must be in JSON string format. The key-value requirements are as follows:\\nenvKey: environment variable name, which contains up to 64 characters and starts with a letter, hyphen (-), dot (.), or underscore (_). The value can contain only letters, digits, hyphens (-), dots (.), and underscores (_). envValue: environment variable value, which can contain up to 2048 characters. \\nThis parameter cannot be used together with the --environment parameter.\"],defaultValue:null},Layers:{option:[\"--layers \",\"Specified layers. Enter an array of character strings. Up to 5 layers are supported at a time. The format of each layer is as follows: layerName:layerVersion or layerUrn:layerVersion.\"],defaultValue:null},Payload:{option:[\"--payload \",\"Request event, which is a JSON string.\"],defaultValue:\"{}\"},PayloadFile:{option:[\"--payload-file \",\"Request event file. Enter a valid path with the file name. The file must be in JSON format. The file content must be a JSON string.\"],defaultValue:null},TriggerConfigFile:{option:[\"--config-file \",\"Path of the trigger configuration file. Enter a valid path with the file name. The file must be in JSON format.\"],defaultValue:null},Schedule:{option:[\"--schedule \",\"Cron trigger execution interval. Format: @every Value Unit. The parameters are described as follows: \\nValue: Enter a positive integer. \\nUnit: unit. The options are s (second), m (minute), and h (hour).\"],defaultValue:null},TriggerMode:{option:[\"--trigger-mode \",\"Trigger mode. The options are ASync (asynchronous) and Sync (synchronous).\"],defaultValue:\"ASync\"},TriggerSwitch:{option:[\"--trigger-switch \",\"Trigger switch, which is of the Boolean type.\"],defaultValue:null},TriggerId:{option:[\"--trigger-id \",\"ID of the trigger.\"],defaultValue:null},AuthType:{option:[\"--auth-type \",\"Authentication type of the trigger. The options are as follows: \\napigw-client: API client authentication (applicable to the client) \\ncloudgw-client: API client authentication (applicable to the server).\"],defaultValue:\"apiqw-client\"},EnableUrlDecode:{option:[\"--enable-url-decode \",\"Indicates whether to enable decoding for the trigger. The value is of the Boolean type.\"],defaultValue:!0},AliasDescription:{option:[\"--description \",\"Alias description. Enter a string of up to 64 characters.\"],defaultValue:null},FunctionAliasName:{option:[\"--alias-name \",\"Function alias. Enter a string of 2 to 16 characters, including only lowercase letters, digits, and hyphens (-). The alias must start with a lowercase letter and end with a lowercase letter or digit.\"],defaultValue:null},FunctionRoutingConfig:{option:[\"--routing-config \",\"Configuration for allocating traffic between two versions, in JSON format. \\nIf this parameter is not set, 100% traffic is allocated to the version specified when the alias is created. \\nIf you set only the ratio of traffic allocated to the version specified by the alias, the remaining traffic is automatically allocated to the latest version. \\nIf you set only the ratio of traffic allocated to the other version, the remaining traffic is automatically allocated to the version specified by the alias. \\nIf you specify the traffic allocation for both versions, one of them must be the version specified when you create the alias. \\nThe policy can contain only two versions.\"],defaultValue:null},CompatibleRuntimes:{option:[\"--compatible-runtimes \",\"Runtime compatible with the layer. You can select one or more of the following options: nodejs14.x, java1.8, and python3.\"],defaultValue:[\"nodejs14.x\"]},CompatibleRuntime:{option:[\"--compatible-runtime \",\"Runtime compatible with the layer. The options are as follows: nodejs14.x, java1.8, and python3.\"],defaultValue:\"nodejs14.x\"},LayerCode:{option:[\"--code-path \",\"Path of the layer deployment package. Enter a valid path with the file name. The package must be in ZIP format and cannot exceed 200 MB.\"],defaultValue:null},LayerDescription:{option:[\"--description \",\"Layer description. Enter a string of up to 1024 characters.\"],defaultValue:\"string\"},LayerSharedScope:{option:[\"--shared-scope \",\"Layer sharing scope. The options are business and tenant.\"],defaultValue:\"business\"},VersionOptionInLayerCmd:{option:[\"--version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LayerVersion:{option:[\"-layer-version \",\"Layer version. Enter a positive integer.\"],defaultValue:\"1\"},LicenseInfo:{option:[\"--license-info \",\"Layer license. Enter a string of up to 64 characters.\"],defaultValue:null},LayerOwnerFlag:{option:[\"--owner-flag \",\"Owner of layers to be displayed. The options are as follows: \\nall: All layers created by the current operator and under other projects are displayed. self: Only layers created by the current operator are displayed. other: Only layers created under other projects are displayed.\"],defaultValue:\"all\"},ListOutput:{option:[\"--output \",\"Output format. The options are json (outputting information in JSON format) and table (outputting information in a table).\"],defaultValue:\"json\"},PageSize:{option:[\"--page-size \",\"Maximum number of items that can be returned. Enter an integer ranging from 1 to 1000.\"],defaultValue:10},PageIndex:{option:[\"--page-index \",\"Index of a page where a specified resource is located. The value is an integer greater than 1.\"],defaultValue:1}});function getOptionWithDefaultValue(e){return getOptionWithValue(e,e.defaultValue)}function getOptionWithValue(e,t){if(null===t)throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e.option];return n.push(t),n}function setOptionExtraNote(e,t){if(null===e||!Array.isArray(e))throw new CloudFunctionError(ErrorType.OTHER_ERROR,new Error(\"value is null\"));let n=[...e];return n[1]=n[1]+\" \\nNOTE: \"+t,n}function setOptional(e){let t=[...e];return t[1]=`[${locale(constants.MSG_OPTIONAL)}]`+t[1],[...t]}function setMandatory(e){let t=[...e];return t[1]=`[${locale(constants.MSG_MANDATORY)}]`+t[1],[...t]}export{OPTION,getOptionWithDefaultValue,setOptional,setMandatory,setOptionExtraNote};" + }, + { + "packagePath": "commands/cloudfunction/option/verify.js", + "sha256": "a556f80bf7d8ba67a06940875219a962d883de944606f216c8ab5f3a9c956f18", + "source": "import constants from\"../constants/constants.js\";import{newArgError}from\"../error/errors.js\";import fs from\"fs\";import path from\"path\";import{isEmpty,getStringWidth}from\"../util/tools.js\";import verifyTools from\"./tools.js\";import{locale}from\"../util/locale.js\";import output from\"../util/output.js\";import{validateTypeMinutesHourDayMonthWeekExpression,validateTypeEveryExpression}from\"./cronExpressionValidator.js\";const runtimes=[\"nodejs14.x\",\"java1.8\",\"python3\",\"custom-runtime\"],Owners=[\"all\",\"self\",\"other\"],memories=[500,1e3,2e3,4e3],layerShares=[\"business\",\"tenant\"],layerMaxSize=52428800;class Verifier{constructor(r){this.options=r,this.optionFns=[]}addVerifyOptionFunc(r,e,n){return this.optionFns.push({fn:r,optionName:e,required:n}),this}done(){for(let{fn:r,optionName:e=\"\",required:n}of this.optionFns)(e in this.options||n)&&r(this.options)}}function verifyFunctionName(r){let{functionName:e}=r;baseVerifyFunctionName(e)}function verifyNameOptionInFunctionCmd(r){let{name:e}=r;baseVerifyFunctionName(e)}function baseVerifyFunctionName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_NAME_ILLEGAL))}function verifyExclusionEnvironmentOption(r){if(r.environment&&r.environmentFile)throw newArgError(locale(constants.ARG_ERR_EXCLUSION_ENVIRONMENT_OPTION))}function verifyExclusionTriggerConfigOption(r,e){if(r.configFile)for(let n of e)if(r[n])throw newArgError(locale(constants.ARG_ERR_EXCLUSION_TRIGGER_CONFIG_OPTION))}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function verifyHTTPTriggerAuthType(r){if(!r.authType)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY));if(-1===HttpTriggerAuthTypeList.indexOf(r.authType))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL))}const HttpTriggerEnableUrlDecodeList=[\"true\",\"false\"];function verifyHTTPTriggerEnableUrlDecode(r){if(!r.enableUrlDecode)throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY));if(-1===HttpTriggerEnableUrlDecodeList.indexOf(r.enableUrlDecode))throw newArgError(locale(constants.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL))}function verifyTriggerId(r){if(isEmpty(r.triggerId))throw newArgError(locale(constants.INPUT_TRIGGER_ID_EMPTY))}function verifyTriggerSwitch(r){if(!isEmpty(r.triggerSwitch)&&\"true\"!==r.triggerSwitch&&\"false\"!==r.triggerSwitch)throw newArgError(locale(constants.INPUT_TRIGGER_SWITCH_ERROR))}let CronTriggerModeList=[\"ASync\",\"Sync\"];function verifyCronTriggerMode(r){if(!r.triggerMode)throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_EMPTY));if(-1===CronTriggerModeList.indexOf(r.triggerMode))throw newArgError(locale(constants.ARG_ERR_CRON_TRIGGER_MODE_ILLEGAL))}function verifyAliasName(r){let{aliasName:e}=r;baseVerifyAliasName(e)}function verifyFuzzyName(r){if(isEmpty(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_EMPTY));if(r.fuzzyName.length>32)throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_LENTH_SHORT));if(!new RegExp(\"^[0-9a-z-]\").test(r.fuzzyName))throw newArgError(locale(constants.ARG_ERR_FUZZY_NAME_ILLEGAL))}function verifyNameOptionInAliasCmd(r){let{name:e}=r;baseVerifyAliasName(e)}function baseVerifyAliasName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_SHORT));if(r.length>16)throw newArgError(locale(constants.ARG_ERR_ALIAS_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_ALIAS_ILLEGAL))}function verifyRuntime(r){let{runtime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_RUNTIME_ILLEGAL))}function verifyFunctionCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER))}function verifyMemory(r){let{memory:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_MEMORY_EMPTY));if(!verifyTools.isInteger(e)&&(e=Number(e),isNaN(e)))throw newArgError(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED));if(-1===memories.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED),{memories:memories.join(\",\")}))}function verifyTimeout(r){let{timeout:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_TIMEOUT_TYPE_ILLEGAL));if(e<1||e>1800)throw newArgError(locale(constants.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED))}function verifyInstanceConcurrency(r){let{instanceConcurrency:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL));if(e<1||e>1e3)throw newArgError(locale(constants.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED))}function verifyDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_DESCRIPTION_LONGER))}function verifyVersionDescription(r){let{versionDescription:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_VERSION_DESCRIPTION_LONGER))}function verifyEnvironment(r){let{environment:e}=r;if(isEmpty(r.environment))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_EMPTY));checkEnvironmentContent(e)}function verifyEnvironmentFile(r){let{environmentFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_PATH_FORMAT_ILLEGAL));if(fs.statSync(e).size>=3145728)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_FILE_CONTENT_SIZE_TOO_BIGGER));checkEnvironmentContent(fs.readFileSync(e))}function checkEnvironmentContent(r){if(r.length>=3145728)throw newArgError(locale(constants.ARG_ERR_FUNCTION_CODE_CONTENT_SIZE_TOO_BIGGER));let e=null;try{e=JSON.parse(r)}catch(r){throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_ILLEGAL))}for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r.length>64)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_LONGER));if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL));if(e[r].length>2048)throw newArgError(locale(constants.ARG_ERR_ENVIRONMENT_VALUE_LONGER))}}function verifyLayers(r){let{layers:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_EMPTY));if(isEmpty(e)||!verifyTools.isArray(e))throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join().length<4)throw newArgError(locale(constants.ARG_ERR_LAYER_ILLEGAL));if(e.join(\" \").substring(1,e.join().length-1).split(\",\").length>5)throw newArgError(locale(constants.ARG_ERR_LAYER_TOO_MANY))}function verifyPayload(r){let{payload:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_EMPTY));try{JSON.parse(e)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_ILLEGAL))}}function verifySchedule(r){if(isEmpty(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_EMPTY));if(!validateTypeEveryExpression(r.schedule)&&!validateTypeMinutesHourDayMonthWeekExpression(r.schedule))throw newArgError(locale(constants.ARG_ERR_SCHEDULE_ILLEGAL))}function verifyPayloadFile(r){let{payloadFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=4194304)throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FILE_CONTENT_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_PAYLOAD_FLE_CONTENT_ILLEGAL))}}function verifyVersionOptionInFunctionCmd(r){let{version:e}=r;baseVerifyFunctionVersion(e)}function verifyFunctionVersion(r){let{functionVersion:e}=r;baseVerifyFunctionVersion(e)}function baseVerifyFunctionVersion(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_EMPTY));if(\"$latest\"===r)return;let e=Number(r);if(isNaN(e)||e<1)throw newArgError(locale(constants.ARG_ERR_FUNCTION_VERSION_NOT_SUPPORTED))}function verifyNameOptionInLayerCmd(r){let{name:e}=r;baseVerifyLayerName(e)}function verifyNameOptionInLayerVersionsListCmd(r){let{name:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));let n=e.split(\":\");if(1!==n.length){if(6!==n.length)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_FORMAT_ILLEGAL_IN_LAYER_VERSIONS_LIST_CMD))}else baseVerifyLayerName(e)}function verifyLayerName(r){let{layerName:e}=r;baseVerifyLayerName(e)}function baseVerifyLayerName(r){if(isEmpty(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_EMPTY));if(r.length<2)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_SHORT));if(r.length>32)throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_LENTH_LONGER));if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newArgError(locale(constants.ARG_ERR_LAYER_NAME_ILLEGAL))}function verifyLayerCodePath(r){let{codePath:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST));if(\".zip\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=52428800)throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_SIZE_TOO_BIGGER))}function verifyJsonFileDestinationPath(r){let{destination:e}=r;if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_LAYER_FILE_UNEXIST))}function verifyJsonFileSourcePath(r){let{source:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_JSON_SOURCE_NOT_EXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_JSON_PATH_FORMAT_ILLEGAL))}function verifyLayerDescription(r){let{description:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_EMPTY));if(e.length>1024)throw newArgError(locale(constants.ARG_ERR_LAYER_DESCRIPTION_LONGER))}function verifyLayerOwnerFlag(r){let{ownerFlag:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_EMPTY));if(-1===Owners.indexOf(e))throw newArgError(locale(constants.ARG_ERR_LAYER_OWNER_NOT_SUPPORTED))}function verifyLayerSharedScope(r){let{sharedScope:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_EMPTY));if(!isEmpty(e)&&-1===layerShares.indexOf(e))throw newArgError(output.strFormat(locale(constants.ARG_ERR_LAYER_SHARE_SCOPE_NOT_SUPPORTED),{layerShares:layerShares.join(\",\")}))}function verifyCompatibleRuntimes(r){let{compatibleRuntimes:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_EMPTY));let n=[];for(let r of e){if(-1===runtimes.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_NOT_SUPPORTED));if(-1!==n.indexOf(r))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIMES_REPEAT));n.push(r)}}function verifyCompatibleRuntime(r){let{compatibleRuntime:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_EMPTY));if(-1===runtimes.indexOf(e))throw newArgError(locale(constants.ARG_ERR_COMPATIBLE_RUNTIME_ILLEGAL))}function verifyLayerVersion(r){let{layerVersion:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_EMPTY));let n=Number(e);if(isNaN(n)||n<1)throw newArgError(locale(constants.ARG_ERR_LAYER_VERSION_NOT_SUPPORTED))}function verifyLicenseInfo(r){let{licenseInfo:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_EMPTY));if(!verifyTools.isString(e))throw newArgError(locale(constants.ARG_ERR_LICENSE_ILLEGAL));if(getStringWidth(e)>64)throw newArgError(locale(constants.ARG_ERR_LICENSE_LENTH_LONGER))}function verifyTriggerConfigFile(r){let{configFile:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_EMPTY));if(!fs.existsSync(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_UNEXIST));if(\".json\"!==path.extname(e))throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_FORMAT_ILLEGAL));if(fs.statSync(e).size>=1048576)throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_CONTENT_SIZE_TOO_BIGGER));let n=fs.readFileSync(e);try{JSON.parse(n)}catch(r){throw newArgError(locale(constants.ARG_ERR_TRIGGER_CONFIG_FILE_CONTENT_ILLEGAL))}}function verifyCronPayload(r){if(!isEmpty(r.payload))try{JSON.parse(r.payload)}catch(r){throw newArgError(locale(constants.INPUT_PAYLOAD_SHOULD_BE_JSON))}}function verifyListOutput(r){let{output:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_UNEXIST));if(-1===[\"json\",\"table\"].indexOf(e))throw newArgError(locale(constants.ARG_ERR_LIST_OUTPUT_ILLEGAL))}function verifyPageSize(r){let{pageSize:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_SIZE_VALUE_NOT_SUPPORTED));r.pageSize=e}function verifyPageIndex(r){let{pageIndex:e}=r;if(isEmpty(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_UNEXIST));if(verifyTools.isNumber(e)||(e=Number(e)),isNaN(e)||!verifyTools.isInteger(e))throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_TYPE_ILLEGAL));if(e<1)throw newArgError(locale(constants.ARG_ERR_PAGE_INDEX_VALUE_NOT_SUPPORTED));r.pageIndex=e}export default{Verifier:Verifier,verifyNameOptionInFunctionCmd:verifyNameOptionInFunctionCmd,verifyFunctionName:verifyFunctionName,verifyRuntime:verifyRuntime,verifyFunctionCodePath:verifyFunctionCodePath,verifyMemory:verifyMemory,verifyTimeout:verifyTimeout,verifyInstanceConcurrency:verifyInstanceConcurrency,verifyDescription:verifyDescription,verifyVersionDescription:verifyVersionDescription,verifyEnvironment:verifyEnvironment,verifyEnvironmentFile:verifyEnvironmentFile,verifyExclusionEnvironmentOption:verifyExclusionEnvironmentOption,verifyLayers:verifyLayers,verifyPayload:verifyPayload,verifyPayloadFile:verifyPayloadFile,verifyFunctionVersion:verifyFunctionVersion,verifyVersionOptionInFunctionCmd:verifyVersionOptionInFunctionCmd,verifyNameOptionInAliasCmd:verifyNameOptionInAliasCmd,verifyAliasName:verifyAliasName,verifySchedule:verifySchedule,verifyFuzzyName:verifyFuzzyName,verifyNameOptionInLayerCmd:verifyNameOptionInLayerCmd,verifyNameOptionInLayerVersionsListCmd:verifyNameOptionInLayerVersionsListCmd,verifyLayerOwnerFlag:verifyLayerOwnerFlag,verifyLayerName:verifyLayerName,verifyLayerCodePath:verifyLayerCodePath,verifyLayerDescription:verifyLayerDescription,verifyLayerVersion:verifyLayerVersion,verifyCompatibleRuntimes:verifyCompatibleRuntimes,verifyCompatibleRuntime:verifyCompatibleRuntime,verifyLicenseInfo:verifyLicenseInfo,verifyLayerSharedScope:verifyLayerSharedScope,verifyCronPayload:verifyCronPayload,verifyTriggerId:verifyTriggerId,verifyTriggerSwitch:verifyTriggerSwitch,verifyCronTriggerMode:verifyCronTriggerMode,verifyTriggerConfigFile:verifyTriggerConfigFile,verifyHTTPTriggerAuthType:verifyHTTPTriggerAuthType,verifyHTTPTriggerEnableUrlDecode:verifyHTTPTriggerEnableUrlDecode,verifyExclusionTriggerConfigOption:verifyExclusionTriggerConfigOption,verifyListOutput:verifyListOutput,verifyPageSize:verifyPageSize,verifyPageIndex:verifyPageIndex,verifyJsonFileDestinationPath:verifyJsonFileDestinationPath,verifyJsonFileSourcePath:verifyJsonFileSourcePath};" + }, + { + "packagePath": "commands/cloudfunction/option/parse.js", + "sha256": "d8fcfbe7e7cda03600778fcde4c32098fb80827cbb1f6f5bf638265f18812e67", + "source": "import fs from\"fs\";import{isNull}from\"../util/tools.js\";const resources={500:500,1e3:500,2e3:1e3,4e3:2e3,8e3:4e3};class Parser{constructor(e){this.options=e,this.optionFns=[],this.data={}}addParseOptionFunc(e,r){return this.optionFns.push({fn:e,dataKey:r}),this}done(){for(let{fn:e,dataKey:r}of this.optionFns)e(this.data,this.options,r);return this.data}}function parseFunctionName(e,r,n){isNull(r.functionName)||(n||(n=\"functionName\"),e[n]=r.functionName)}function parseNameOptionInFunctionCmd(e,r,n){isNull(r.name)||(n||(n=\"name\"),e[n]=r.name)}function parseRuntime(e,r,n){let{runtime:i}=r;isNull(i)||(n||(n=\"runtime\"),e[n]=i)}function parseMemory(e,r,n){let{memory:i}=r;if(isNull(i))return;let s=Number(i),t=resources[s];e.memory=s,e.cpu=t}function parseTimeout(e,r,n){let{timeout:i}=r;isNull(i)||(n||(n=\"timeout\"),e[n]=Number(i))}function parseInstanceConcurrency(e,r,n){let{instanceConcurrency:i}=r;isNull(i)||(n||(n=\"instanceConcurrency\"),e[n]=Number(i))}function parseHandler(e,r,n){let{handler:i}=r;isNull(i)||(n||(n=\"handler\"),e[n]=i)}function parseDescription(e,r,n){let{description:i}=r;isNull(i)||(n||(n=\"description\"),e[n]=i)}function parseVersionDescription(e,r,n){let{versionDescription:i}=r;isNull(i)||(n||(n=\"versionDescription\"),e[n]=i)}function parseEnvironment(e,r,n){let{environment:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=i)}function parseEnvironmentFile(e,r,n){let{environmentFile:i}=r;isNull(i)||(n||(n=\"environment\"),e[n]=fs.readFileSync(i))}function parseTriggerConfigFile(e,r,n){let{configFile:i}=r;if(isNull(i))return;let s=fs.readFileSync(i),t=JSON.parse(s);for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function parseCronTriggerSchedule(e,r,n){let{schedule:i}=r;isNull(i)||(n||(n=\"schedule\"),e[n]=i)}function parseCronTriggerPayload(e,r,n){let{payload:i}=r;isNull(i)||(n||(n=\"payload\"),e[n]=i)}function parseHTTPTriggerEnableUrlDecode(e,r,n){let{enableUrlDecode:i}=r;isNull(i)||(n||(n=\"enableUrlDecode\"),e[n]=i)}function parseCronTriggerMode(e,r,n){let{triggerMode:i}=r;isNull(i)||(n||(n=\"triggerMode\"),e[n]=i)}function parseCronTriggerSwitch(e,r,n){let{triggerSwitch:i}=r;isNull(i)||(n||(n=\"triggerSwitch\"),e[n]=i)}function parseHTTPTriggerAuthType(e,r,n){let{authType:i}=r;isNull(i)||(n||(n=\"authType\"),e[n]=i)}function parseFunctionVersion(e,r,n){let{functionVersion:i}=r;isNull(i)||(n||(n=\"functionVersion\"),e[n]=i)}function parseAliasName(e,r,n){let{aliasName:i}=r;isNull(i)||(n||(n=\"aliasName\"),e[n]=i)}export default{Parser:Parser,parseFunctionName:parseFunctionName,parseNameOptionInFunctionCmd:parseNameOptionInFunctionCmd,parseRuntime:parseRuntime,parseMemory:parseMemory,parseTimeout:parseTimeout,parseInstanceConcurrency:parseInstanceConcurrency,parseHandler:parseHandler,parseDescription:parseDescription,parseEnvironment:parseEnvironment,parseEnvironmentFile:parseEnvironmentFile,parseVersionDescription:parseVersionDescription,parseFunctionVersion:parseFunctionVersion,parseAliasName:parseAliasName,parseTriggerConfigFile:parseTriggerConfigFile,parseCronTriggerSchedule:parseCronTriggerSchedule,parseCronTriggerPayload:parseCronTriggerPayload,parseCronTriggerMode:parseCronTriggerMode,parseCronTriggerSwitch:parseCronTriggerSwitch,parseHTTPTriggerAuthType:parseHTTPTriggerAuthType,parseHTTPTriggerEnableUrlDecode:parseHTTPTriggerEnableUrlDecode};" + }, + { + "packagePath": "commands/cloudfunction/util/tools.js", + "sha256": "cef5c62cd54b5eba393ec87ea174bf94a9339d94fbbb39e7737dd775df51fe4a", + "source": "import fs from\"fs\";import constants from\"../constants/constants.js\";import layerApi from\"../api/layerApi.js\";import{locale}from\"../util/locale.js\";import{newArgError}from\"../error/errors.js\";import{createHash}from\"crypto\";import output from\"../util/output.js\";async function hasFunctionServicePermission(t){const e=t.storage.globalGet(\"teamList\")||\"\";if(!await t.session.isSessionValid()||!e)return output.outputLoginFirst(),!1;const r=t.storage.globalGet(\"serviceInfos\")||null;return!(!r||-1===r.indexOf(\"function\"))||(output.activeFunctionServiceFirst(),!1)}function getAliasOrVersion(t,e,r){return t[e]?t[e]:t[r]?t[r]:\"$latest\"}function isNull(t){return void 0===t}function isEmpty(t){return null==t||\"\"===t}async function readFunctionCodeFile(t){let e=getCodeFileSize(t),r=fs.createReadStream(t);return{codeSize:e,sha256:await getFileHash256(t),fileStream:r}}async function getLayerVersionUrns(t,e){if(isNull(e))return[];let r=[];for(let n of e){let e=n.split(\":\");if(2!==e.length&&7!==e.length)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_FORMAT_ILLEGAL),{layer:n}));let o=e.pop(),i=e.join(\":\"),a=await layerApi.queryLayerInfo(t,i,o);if(!0===a.deletedFlag)throw newArgError(output.strFormat(locale(constants.ERR_MSG_ADD_LAYER_FAILED_LAYER_DELETED),{layer:n}));r.push(a.layerVersionUrn)}return r}function getStringWidth(t){let e=0;for(let r=0;r=0&&n<=128?1:2}return e}function getCodeFileSize(t){return fs.statSync(t).size}function getFileHash256(t){return new Promise(((e,r)=>{const n=fs.createReadStream(t),o=createHash(\"sha256\");n.on(\"data\",(t=>{o.update(t,\"utf8\")})),n.on(\"end\",(()=>{const t=o.digest(\"hex\");e(t)}))}))}async function drawTable(t){const{Console:e}=await import(\"node:console\"),{Transform:r}=await import(\"node:stream\"),n=new r({transform(t,e,r){r(null,t)}});return new e({stdout:n}).table(t),(n.read()||\"\").toString()}function createMapWithField(t,e){return t?t.reduce(((t,r)=>t.set(r[e],r)),new Map):new Map}export{hasFunctionServicePermission,isNull,isEmpty,getStringWidth,readFunctionCodeFile,getAliasOrVersion,getLayerVersionUrns,getFileHash256,drawTable,createMapWithField};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + }, + { + "packagePath": "commands/cloudfunction/cmd/function/updateFunctionConfigCmd.js", + "sha256": "739709bc53388cc26853a4d957d7a022069ace65103144b47774c1c58572088b", + "source": "import{hasFunctionServicePermission}from\"../../util/tools.js\";import verify from\"../../option/verify.js\";import{OPTION,setOptional,setMandatory}from\"../../option/options.js\";import output from\"../../util/output.js\";import{functionInfoTitles}from\"./titles.js\";import functionApi from\"../../api/functionApi.js\";import{locale}from\"../../util/locale.js\";import{checkFuncServiceEnabled}from\"../../util/validation.js\";import{checkIsLogin,checkSelectedProject}from\"../../../common/util/validation.js\";import constants from\"../../constants/constants.js\";async function updateFunctionConfigCmd(t,n){const{logger:o}=t;if(!await hasFunctionServicePermission(t))return;try{verify.verifyExclusionEnvironmentOption(n),new verify.Verifier(n).addVerifyOptionFunc(verify.verifyNameOptionInFunctionCmd,\"name\",!0).addVerifyOptionFunc(verify.verifyVersionDescription,\"versionDescription\",!1).addVerifyOptionFunc(verify.verifyMemory,\"memory\",!1).addVerifyOptionFunc(verify.verifyInstanceConcurrency,\"instanceConcurrency\",!1).addVerifyOptionFunc(verify.verifyTimeout,\"timeout\",!1).addVerifyOptionFunc(verify.verifyEnvironment,\"environment\",!1).addVerifyOptionFunc(verify.verifyEnvironmentFile,\"environmentFile\",!1).addVerifyOptionFunc(verify.verifyLayers,\"layers\",!1).done()}catch(t){return void output.outputError(constants.FAILED_UPDATE_FUNCTION_CONFIG_CMD,t)}if(1===Object.keys(n).length)return void output.outputError(constants.FAILED_UPDATE_FUNCTION_CONFIG_CMD,output.INPUT_AT_LEAST_ERROR);let i=null;try{i=await functionApi.queryFunctionVersion(t,n.name,\"$latest\")}catch(t){return void output.outputError(constants.FAILED_UPDATE_FUNCTION_CONFIG_CMD,t)}let e=null;try{e=await functionApi.updateFunction(t,n,i.function,i.function.revisionId)}catch(t){return void output.outputError(constants.FAILED_UPDATE_FUNCTION_CONFIG_CMD,t)}output.outputInfo(functionInfoTitles,e.function)}function main(t){return{cmd:\"update-function-config\",desc:`${locale(constants.DESC_CMD_UPDATE_FUNCTION_CONFIG)}`,options:[setMandatory(OPTION.NameOptionInFunctionCmd.option),setOptional(OPTION.Handler.option),setOptional(OPTION.Memory.option),setOptional(OPTION.Timeout.option),setOptional(OPTION.InstanceConcurrency.option),setOptional(OPTION.VersionDescription.option),setOptional(OPTION.Environment.option),setOptional(OPTION.EnvironmentFile.option),setOptional(OPTION.Layers.option)],child:[],addHelpText:[[\"after\",\"\\nExample:\\n agcli func update-function-config --name a1 --timeout 63\"]],action(n){updateFunctionConfigCmd(t,n)},beforeAction:async()=>{await checkIsLogin(t),await checkSelectedProject(t),await checkFuncServiceEnabled(t)}}}export default main;" + } + ], + "notes": [ + { + "text": "Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node." + } + ], + "limitations": [ + "The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.", + "Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.", + "Management responses omit environment/session values; invocation application results remain unchanged.", + "Native responses above 16 MiB return an explicit local-limit error." + ] +} diff --git a/pkg/domain/reference/game-items/propapi-getroleinfo.json b/pkg/domain/reference/game-items/propapi-getroleinfo.json new file mode 100644 index 0000000..dd1c243 --- /dev/null +++ b/pkg/domain/reference/game-items/propapi-getroleinfo.json @@ -0,0 +1,804 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section44892321176", + "text": "请求示例\nPOST {第三方应用服务器url} HTTP/1.1\nContent Type : application/x-www-form-urlencoded ; charset=UTF-8\nuserIdType=1&userId=*****&sign=***&ts=****" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section136271029195216", + "text": "响应示例\nHTTP/1.1 200 OK\nContent Type : application/json ; charset=UTF-8\n{\n \"result\":0,\n \"roleList\":[\n {\"zoneId\":\"****\",\"zoneName\":\"****\",\"roleId\":\"****\",\"roleName\":\"****\",\"sign\":\"****\"},\n {\"zoneId\":\"****\",\"zoneName\":\"****\",\"roleId\":\"****\",\"roleName\":\"****\",\"sign\":\"****\"}]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-0000002355134701", + "title": "游戏道具商城" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/game-center-prop-mall-0000002302937820#section21502017134016", + "title": "接入配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1751519509527", + "title": "签名机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#ZH-CN_TOPIC_0000002355255377__li1818916227122", + "title": "RoleInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1751519509527", + "title": "签名机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section714665315115", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏私钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏私钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "title": "生成签名字符串" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section714665315115", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-0000002355134701", + "title": "游戏道具商城" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666", + "title": "下单" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section556562310512", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1499072135210", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section44892321176", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section8195101404419", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section136271029195216", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1751519509527", + "title": "检验签名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "title": "生成签名字符串" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "title": "校验签名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "title": "服务端示例代码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section556562310512", + "text": "此接口用于查询玩家区服角色信息。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "text": "Body参数:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section8195101404419", + "text": "返回码:200" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section8195101404419", + "text": "RoleInfo 参数名称 必选(M)/可选(O) 类型 参数说明 zoneId M String(64) 游戏区服ID。 zoneName M String(64) 游戏区服名称。 roleId M String(64) 游戏角色ID。 roleName M String(64) 游戏角色名称。 sign M String(8192) 待签名字符串: roleId=****&roleName=******&zoneId=*****&zoneName=***** RSA签名(使用游戏服务私钥进行签名,待验签内容生成方法参见签名机制)。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "以如下参数数组为例:" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "userIdType =1&userId=144***50&sign=XXX&ts=174***64" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "将请求参数中需要参与签名的参数,按参数名首字母的ASCII码将参数升序排序,若遇到相同首字母,则比较第二个字母,以此类推。需要参与签名的参数是指接口说明中“是否参与签名”列为“是”的参数。 注意 没有值(包括null和“”情况)的参数如果出现在请求中也需要包含到待签名数据中,参与签名的格式如下: parametername = 只有出现在接口中的参数需要参与验签,没有出现的不参与。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "没有值(包括null和“”情况)的参数如果出现在请求中也需要包含到待签名数据中,参与签名的格式如下: parametername =" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "parametername =" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "只有出现在接口中的参数需要参与验签,没有出现的不参与。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "排序完成之后,将所有数组值(value非空)进行urlencode。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "将urlencode之后的所有参数名和参数值的键值对以“&”字符连接起来,此字符串便是待签名字符串,如下列字符串所示: sign=XXX&ts=174***64&userId=144***50&userIdType=1 生成待签名字符串的Java示例代码如下: public static String buildSortedSignData(Map params) throws UnsupportedEncodingException { StringBuilder targetParamStr = new StringBuilder(); Map sortedParamMap = new TreeMap<>(params); for (Map.Entry param : sortedParamMap.entrySet()) { String key = param.getKey(); String value = param.getValue(); targetParamStr.append(key) .append(\"=\") .append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\")) .append(\"&\"); } return targetParamStr.substring(0, targetParamStr.toString().length() - 1); }" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "sign=XXX&ts=174***64&userId=144***50&userIdType=1" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "public static String buildSortedSignData(Map params) throws UnsupportedEncodingException {" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "StringBuilder targetParamStr = new StringBuilder();" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "Map sortedParamMap = new TreeMap<>(params);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "for (Map.Entry param : sortedParamMap.entrySet()) {" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "String key = param.getKey();" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "String value = param.getValue();" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "targetParamStr.append(key)" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": ".append(\"=\")" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": ".append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\"))" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": ".append(\"&\");" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "}" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "return targetParamStr.substring(0, targetParamStr.toString().length() - 1);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "将待签名字符串使用游戏私钥按照RSA算法(SHA256WithRSA/PSS)进行签名,将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 说明 游戏私钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。 正式上线时,示例代码中的privateKey请务必替换为AppGallery Connect上的游戏私钥;在自行验证时,亦可将代码中的privateKey在本地代码中替换为AppGallery Connect上的游戏私钥,用于自验证验签逻辑。 sign在RSA签名后需要进行Base64编码。 生成签名字符串的Java示例代码如下: public static String signWithRSA(byte[] data, String privateKey) throws Exception { byte[] keyBytes = Base64.decodeBase64(privateKey); PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initSign(privateK); signature.update(data); return Base64.encodeBase64String(signature.sign()); }" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "游戏私钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "正式上线时,示例代码中的privateKey请务必替换为AppGallery Connect上的游戏私钥;在自行验证时,亦可将代码中的privateKey在本地代码中替换为AppGallery Connect上的游戏私钥,用于自验证验签逻辑。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "sign在RSA签名后需要进行Base64编码。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "public static String signWithRSA(byte[] data, String privateKey) throws Exception {" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "byte[] keyBytes = Base64.decodeBase64(privateKey);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\");" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "signature.initSign(privateK);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "signature.update(data);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section13836111115817", + "text": "return Base64.encodeBase64String(signature.sign());" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "获取请求参数,生成签名字符串。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "使用游戏公钥对签名字符串进行验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。 正式上线时,示例代码中的publicKey请务必替换为AppGallery Connect上的游戏公钥;在自行验证时,亦可将代码中的publicKey在本地代码中替换为AppGallery Connect上的游戏公钥,用于自验证验签逻辑。 校验签名的Java示例代码如下: public static boolean verify(byte[] data, String publicKey, String sign) throws Exception { byte[] keyBytes = Base64.decodeBase64(publicKey); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PublicKey publicK = keyFactory.generatePublic(keySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initVerify(publicK); signature.update(data); return signature.verify(Base64.decodeBase64(sign)); }" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "正式上线时,示例代码中的publicKey请务必替换为AppGallery Connect上的游戏公钥;在自行验证时,亦可将代码中的publicKey在本地代码中替换为AppGallery Connect上的游戏公钥,用于自验证验签逻辑。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "校验签名的Java示例代码如下:" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "public static boolean verify(byte[] data, String publicKey, String sign) throws Exception {" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "PublicKey publicK = keyFactory.generatePublic(keySpec);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "signature.initVerify(publicK);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section117734312219", + "text": "return signature.verify(Base64.decodeBase64(sign));" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "验签示例代码 JAVA package com.huawei.game.domain.develop.test; import org.apache.commons.codec.binary.Base64; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.PublicKey; import java.security.Signature; import java.security.spec.X509EncodedKeySpec; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; public class SecretVerifyTest { public static void main(String[] args) throws Exception { // 以下公钥和私钥为临时生成,以供展示代码示例,正式环境请替换 String publicKey = \"MIIBIjANBgkqh*****AB\"; String privateKey = \"MIIEvAIBADANB*****==\"; System.out.println(\"公钥:\" + publicKey); System.out.println(\"私钥:\" + privateKey); // 模拟入参 HashMap reqMap = new HashMap<>(); // 验签步骤 // 1. 从请求中取出sign属性,注意:待验签的字符串不包含sign属性,此时需要从Map中取出。 String reqSign = reqMap.remove(\"sign\"); System.out.println(\"加签结果:\" + reqSign); // 2. 生成待验签的字符串。 String targetStr = buildSortedSignData(reqMap); System.out.println(\"加签的字符串:\" + targetStr); // 3. 进行验签,注意:此处验签的公钥需要修改为AGC管理台上的公钥。 boolean result = verify(targetStr.getBytes(StandardCharsets.UTF_8), publicKey, reqSign); System.out.println(\"验签结果为:\" + result); } /** * 生成待签名的字符串 * * @param params 入参 * @return 待签名的字符串 */ public static String buildSortedSignData(Map params) throws UnsupportedEncodingException { StringBuilder targetParamStr = new StringBuilder(); Map sortedParamMap = new TreeMap<>(params); for (Map.Entry param : sortedParamMap.entrySet()) { String key = param.getKey(); String value = param.getValue(); targetParamStr.append(key) .append(\"=\") .append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\")) .append(\"&\"); } return targetParamStr.substring(0, targetParamStr.toString().length() - 1); } /** * 验签结果 * * @param data 待验签的字符串 * @param publicKey 公钥 * @param sign 签名字符串 * @return 验签结果 */ public static boolean verify(byte[] data, String publicKey, String sign) throws Exception { byte[] keyBytes = Base64.decodeBase64(publicKey); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PublicKey publicK = keyFactory.generatePublic(keySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initVerify(publicK); signature.update(data); return signature.verify(Base64.decodeBase64(sign)); } }" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "package com.huawei.game.domain.develop.test;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import org.apache.commons.codec.binary.Base64;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.io.UnsupportedEncodingException;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.net.URLEncoder;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.nio.charset.StandardCharsets;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.security.KeyFactory;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.security.PublicKey;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.security.Signature;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.security.spec.X509EncodedKeySpec;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.util.HashMap;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.util.Map;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.util.TreeMap;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "public class SecretVerifyTest {" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "public static void main(String[] args) throws Exception {" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 以下公钥和私钥为临时生成,以供展示代码示例,正式环境请替换" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "String publicKey = \"MIIBIjANBgkqh*****AB\";" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "String privateKey = \"MIIEvAIBADANB*****==\";" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "System.out.println(\"公钥:\" + publicKey);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "System.out.println(\"私钥:\" + privateKey);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 模拟入参" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "HashMap reqMap = new HashMap<>();" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 验签步骤" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 1. 从请求中取出sign属性,注意:待验签的字符串不包含sign属性,此时需要从Map中取出。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "String reqSign = reqMap.remove(\"sign\");" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "System.out.println(\"加签结果:\" + reqSign);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 2. 生成待验签的字符串。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "String targetStr = buildSortedSignData(reqMap);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "System.out.println(\"加签的字符串:\" + targetStr);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 3. 进行验签,注意:此处验签的公钥需要修改为AGC管理台上的公钥。" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "boolean result = verify(targetStr.getBytes(StandardCharsets.UTF_8), publicKey, reqSign);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "System.out.println(\"验签结果为:\" + result);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "/**" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* 生成待签名的字符串" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "*" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @param params 入参" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @return 待签名的字符串" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "*/" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* 验签结果" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @param data 待验签的字符串" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @param publicKey 公钥" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @param sign 签名字符串" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @return 验签结果" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "验签测试代码 JAVA package com.huawei.game.domain.develop.test; import org.apache.commons.codec.binary.Base64; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.PrivateKey; import java.security.Signature; import java.security.spec.PKCS8EncodedKeySpec; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; public class SecretCreateSignTest { public static void main(String[] args) throws Exception { // 以下公钥和私钥为临时生成,以供展示代码示例,正式环境请替换 String publicKey = \"MIIBIjANBgkqh*****AB\"; String privateKey = \"MIIEvAIBADANB*****==\"; System.out.println(\"公钥:\" + publicKey); System.out.println(\"私钥:\" + privateKey); HashMap reqMap = new HashMap<>(); reqMap.put(\"userIdType\", \"1\"); reqMap.put(\"userId\", \"144***50\"); reqMap.put(\"ts\", \"174***64\"); // 待加签的字符串 String str = buildSortedSignData(reqMap); // 加签的字符串 String sign = signWithRSA(str.getBytes(StandardCharsets.UTF_8), privateKey); reqMap.put(\"sign\", sign); System.out.println(\"加签结果:\" + sign); } /** * 生成待签名的字符串 * * @param params 入参 * @return 待签名的字符串 */ public static String buildSortedSignData(Map params) throws UnsupportedEncodingException { StringBuilder targetParamStr = new StringBuilder(); Map sortedParamMap = new TreeMap<>(params); for (Map.Entry param : sortedParamMap.entrySet()) { String key = param.getKey(); String value = param.getValue(); targetParamStr.append(key) .append(\"=\") .append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\")) .append(\"&\"); } return targetParamStr.substring(0, targetParamStr.toString().length() - 1); } /** * 签名结果 * * @param data 待签名的字符串 * @param privateKey 私钥 * @return 签名结果 */ public static String signWithRSA(byte[] data, String privateKey) throws Exception { byte[] keyBytes = Base64.decodeBase64(privateKey); PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initSign(privateK); signature.update(data); return Base64.encodeBase64String(signature.sign()); } }" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.security.PrivateKey;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "import java.security.spec.PKCS8EncodedKeySpec;" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "public class SecretCreateSignTest {" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "reqMap.put(\"userIdType\", \"1\");" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "reqMap.put(\"userId\", \"144***50\");" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "reqMap.put(\"ts\", \"174***64\");" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 待加签的字符串" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "String str = buildSortedSignData(reqMap);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "// 加签的字符串" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "String sign = signWithRSA(str.getBytes(StandardCharsets.UTF_8), privateKey);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "reqMap.put(\"sign\", sign);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "System.out.println(\"加签结果:\" + sign);" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* 签名结果" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @param data 待签名的字符串" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @param privateKey 私钥" + }, + { + "section": "检验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section189643201134", + "text": "* @return 签名结果" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为服务器 -> 三方应用服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<100ms" + ], + [ + "接口URL", + "URL从AGC中接入配置获取。" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1499072135210" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "说明" + ], + [ + "userId", + "M", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "M", + "Int", + "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdUserId 说明 userId和userIdType配套使用,userId是值,userIdType是类型。" + ], + [ + "ts", + "M", + "Long", + "当前时间(单位为:milliseconds),由System.currentTimeMillis()获取。" + ], + [ + "sign", + "M", + "String(8192)", + "RSA签名(使用游戏服务公钥进行验签,待验签内容生成方法见签名机制)。 签名算法SHA256WithRSA/PSS。 注意 考虑到自选参数格式多样化,本参数在\"utf-8\" urlencode后发送。 Java中request的getParameter()方法会隐含进行urldecode。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "说明" + ], + [ + "result", + "M", + "Int", + "操作结果: 0:成功 1:验签失败 2:业务信息错误 3:IP白名单限制,开发者拒绝服务(禁止开发者设置白名单,错误码仅仅用于异常监控) 99:其他错误" + ], + [ + "roleList", + "O", + "List", + "玩家角色信息列表。根据角色最近登录时间倒序。 说明 当根据playerId查询不存在角色信息时,请返回空的集合: { \"result\":0, \"roleList\":[] }" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section8195101404419" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "zoneId", + "M", + "String(64)", + "游戏区服ID。" + ], + [ + "zoneName", + "M", + "String(64)", + "游戏区服名称。" + ], + [ + "roleId", + "M", + "String(64)", + "游戏角色ID。" + ], + [ + "roleName", + "M", + "String(64)", + "游戏角色名称。" + ], + [ + "sign", + "M", + "String(8192)", + "待签名字符串: roleId=****&roleName=******&zoneId=*****&zoneName=***** RSA签名(使用游戏服务私钥进行签名,待验签内容生成方法参见签名机制)。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section8195101404419" + } + ], + "title": "查询玩家区服角色", + "updatedAt": "2026-02-11 14:07", + "checkedAt": "2026-10-07T03:00:00.519Z", + "family": "game-items", + "endpoint": "propapi-getroleinfo" +} diff --git a/pkg/domain/reference/game-items/propapi-getroleinfo.parameters.json b/pkg/domain/reference/game-items/propapi-getroleinfo.parameters.json new file mode 100644 index 0000000..45a1745 --- /dev/null +++ b/pkg/domain/reference/game-items/propapi-getroleinfo.parameters.json @@ -0,0 +1,44 @@ +[ + { + "name": "userId", + "in": "body", + "required": true, + "type": "string", + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "required": true, + "type": "integer", + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdUserId 说明 userId和userIdType配套使用,userId是值,userIdType是类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + }, + { + "name": "ts", + "in": "body", + "required": true, + "type": "integer", + "description": "当前时间(单位为:milliseconds),由System.currentTimeMillis()获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513" + }, + { + "name": "sign", + "in": "body", + "required": true, + "type": "string", + "description": "RSA签名(使用游戏服务公钥进行验签,待验签内容生成方法见签名机制)。 签名算法SHA256WithRSA/PSS。 注意 考虑到自选参数格式多样化,本参数在\"utf-8\" urlencode后发送。 Java中request的getParameter()方法会隐含进行urldecode。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377#section1764512695513", + "maxLength": 8192 + } +] diff --git a/pkg/domain/reference/game-items/propapi-order.json b/pkg/domain/reference/game-items/propapi-order.json new file mode 100644 index 0000000..696996c --- /dev/null +++ b/pkg/domain/reference/game-items/propapi-order.json @@ -0,0 +1,835 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section113203518197", + "text": "请求示例\nPOST {第三方应用服务器url} HTTP/1.1\nContent Type : application/x-www-form-urlencoded; charset=UTF-8\nrequestId=***&userIdType=1&userId=***&zoneId=***&roleId=***&productId=***&price=***currency=***&sign=***&ts= ***" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section10818173582215", + "text": "响应示例\nHTTP/1.1 200 OK\nContent Type : application/json ; charset=UTF-8\n{\n \"result\":0,\n \"payload\":\"*****\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-0000002355134701", + "title": "游戏道具商城" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/game-center-prop-mall-0000002302937820#section21502017134016", + "title": "接入配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7914950122315", + "title": "签名机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7914950122315", + "title": "签名机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section714665315115", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏私钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏私钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "title": "生成签名字符串" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section714665315115", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-prop-overview-0000002321821228#section204081625185415", + "title": "游戏公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-getroleinfo-0000002355255377", + "title": "查询玩家区服角色" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section1543584217101", + "title": "接口功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section20219133117119", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section113203518197", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section10906112312191", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section10818173582215", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7914950122315", + "title": "校验签名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "title": "生成签名字符串" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "title": "校验签名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "title": "服务端示例代码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "接口功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section1543584217101", + "text": "本接口购买游戏内商品进行下单。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "text": "Body参数:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section10906112312191", + "text": "返回码:200" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "以如下参数数组为例:" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "requestId=550***00&userIdType=1&userId=144***50&zoneId=957***76&roleId=101&productId=11&price=600¤cy=CNY&sign=XXX&ts= 174***64&quantity=1" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "将请求参数中需要参与签名的参数,按参数名首字母的ASCII码将参数升序排序,若遇到相同首字母,则比较第二个字母,以此类推。需要参与签名的参数是指接口说明中“是否参与签名”列为“是”的参数。 注意 没有值(包括null和“”情况)的参数如果出现在请求中也需要包含到待签名数据中,参与签名的格式如下: parametername = 只有出现在接口中的参数需要参与验签,没有出现的不参与。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "没有值(包括null和“”情况)的参数如果出现在请求中也需要包含到待签名数据中,参与签名的格式如下: parametername =" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "parametername =" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "只有出现在接口中的参数需要参与验签,没有出现的不参与。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "排序完成之后,将所有数组值(value非空)进行urlencode。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "将urlencode之后的所有参数名和参数值的键值对以“&”字符连接起来,此字符串便是待签名字符串,如下列字符串所示: currency=CNY&price=600&productId=11&quantity=1&requestId=550***00&roleId=101&sign=XXX&ts=174***64&userId=144***50&userIdType=1&zoneId=957***76 生成待签名字符串的Java示例代码如下: public static String buildSortedSignData(Map params) throws UnsupportedEncodingException { StringBuilder targetParamStr = new StringBuilder(); Map sortedParamMap = new TreeMap<>(params); for (Map.Entry param : sortedParamMap.entrySet()) { String key = param.getKey(); String value = param.getValue(); targetParamStr.append(key) .append(\"=\") .append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\")) .append(\"&\"); } return targetParamStr.substring(0, targetParamStr.toString().length() - 1); }" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "currency=CNY&price=600&productId=11&quantity=1&requestId=550***00&roleId=101&sign=XXX&ts=174***64&userId=144***50&userIdType=1&zoneId=957***76" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "public static String buildSortedSignData(Map params) throws UnsupportedEncodingException {" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "StringBuilder targetParamStr = new StringBuilder();" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "Map sortedParamMap = new TreeMap<>(params);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "for (Map.Entry param : sortedParamMap.entrySet()) {" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "String key = param.getKey();" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "String value = param.getValue();" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "targetParamStr.append(key)" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": ".append(\"=\")" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": ".append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\"))" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": ".append(\"&\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "}" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "return targetParamStr.substring(0, targetParamStr.toString().length() - 1);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "将待签名字符串使用游戏私钥按照RSA算法(SHA256WithRSA/PSS)进行签名,将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 说明 游戏私钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。 正式上线时,示例代码中的privateKey请务必替换为AppGallery Connect上的游戏私钥;在自行验证时,亦可将代码中的privateKey在本地代码中替换为AppGallery Connect上的游戏私钥,用于自验证验签逻辑。 sign在RSA签名后需要进行Base64编码。 生成签名字符串的Java示例代码如下: public static String signWithRSA(byte[] data, String privateKey) throws Exception { byte[] keyBytes = Base64.decodeBase64(privateKey); PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initSign(privateK); signature.update(data); return Base64.encodeBase64String(signature.sign()); }" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "游戏私钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "正式上线时,示例代码中的privateKey请务必替换为AppGallery Connect上的游戏私钥;在自行验证时,亦可将代码中的privateKey在本地代码中替换为AppGallery Connect上的游戏私钥,用于自验证验签逻辑。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "sign在RSA签名后需要进行Base64编码。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "public static String signWithRSA(byte[] data, String privateKey) throws Exception {" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "byte[] keyBytes = Base64.decodeBase64(privateKey);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "signature.initSign(privateK);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "signature.update(data);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section93661014020", + "text": "return Base64.encodeBase64String(signature.sign());" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "获取请求参数,生成签名字符串。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "使用游戏公钥对签名字符串进行验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。 正式上线时,示例代码中的publicKey请务必替换为AppGallery Connect上的游戏公钥;在自行验证时,亦可将代码中的publicKey在本地代码中替换为AppGallery Connect上的游戏公钥,用于自验证验签逻辑。 校验签名的Java示例代码如下: public static boolean verify(byte[] data, String publicKey, String sign) throws Exception { byte[] keyBytes = Base64.decodeBase64(publicKey); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PublicKey publicK = keyFactory.generatePublic(keySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initVerify(publicK); signature.update(data); return signature.verify(Base64.decodeBase64(sign)); }" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "正式上线时,示例代码中的publicKey请务必替换为AppGallery Connect上的游戏公钥;在自行验证时,亦可将代码中的publicKey在本地代码中替换为AppGallery Connect上的游戏公钥,用于自验证验签逻辑。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "校验签名的Java示例代码如下:" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "public static boolean verify(byte[] data, String publicKey, String sign) throws Exception {" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "PublicKey publicK = keyFactory.generatePublic(keySpec);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "signature.initVerify(publicK);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section7537439174014", + "text": "return signature.verify(Base64.decodeBase64(sign));" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "验签示例代码 JAVA package com.huawei.game.domain.develop.test; import org.apache.commons.codec.binary.Base64; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.PublicKey; import java.security.Signature; import java.security.spec.X509EncodedKeySpec; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; public class SecretVerifyTest { public static void main(String[] args) throws Exception { // 以下公钥和私钥为临时生成,以供展示代码示例,正式环境请替换 String publicKey = \"MIIBIjANBgkqh*****AB\"; String privateKey = \"MIIEvAIBADANB*****==\"; System.out.println(\"公钥:\" + publicKey); System.out.println(\"私钥:\" + privateKey); // 模拟入参 HashMap reqMap = new HashMap<>(); // 验签步骤 // 1. 从请求中取出sign属性,注意:待验签的字符串不包含sign属性,此时需要从Map中取出。 String reqSign = reqMap.remove(\"sign\"); System.out.println(\"加签结果:\" + reqSign); // 2. 生成待验签的字符串。 String targetStr = buildSortedSignData(reqMap); System.out.println(\"加签的字符串:\" + targetStr); // 3. 进行验签,注意:此处验签的公钥需要修改为AGC管理台上的公钥。 boolean result = verify(targetStr.getBytes(StandardCharsets.UTF_8), publicKey, reqSign); System.out.println(\"验签结果为:\" + result); } /** * 生成待签名的字符串 * * @param params 入参 * @return 待签名的字符串 */ public static String buildSortedSignData(Map params) throws UnsupportedEncodingException { StringBuilder targetParamStr = new StringBuilder(); Map sortedParamMap = new TreeMap<>(params); for (Map.Entry param : sortedParamMap.entrySet()) { String key = param.getKey(); String value = param.getValue(); targetParamStr.append(key) .append(\"=\") .append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\")) .append(\"&\"); } return targetParamStr.substring(0, targetParamStr.toString().length() - 1); } /** * 验签结果 * * @param data 待验签的字符串 * @param publicKey 公钥 * @param sign 签名字符串 * @return 验签结果 */ public static boolean verify(byte[] data, String publicKey, String sign) throws Exception { byte[] keyBytes = Base64.decodeBase64(publicKey); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PublicKey publicK = keyFactory.generatePublic(keySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initVerify(publicK); signature.update(data); return signature.verify(Base64.decodeBase64(sign)); } }" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "package com.huawei.game.domain.develop.test;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import org.apache.commons.codec.binary.Base64;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.io.UnsupportedEncodingException;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.net.URLEncoder;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.nio.charset.StandardCharsets;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.security.KeyFactory;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.security.PublicKey;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.security.Signature;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.security.spec.X509EncodedKeySpec;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.util.HashMap;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.util.Map;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.util.TreeMap;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "public class SecretVerifyTest {" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "public static void main(String[] args) throws Exception {" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 以下公钥和私钥为临时生成,以供展示代码示例,正式环境请替换" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "String publicKey = \"MIIBIjANBgkqh*****AB\";" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "String privateKey = \"MIIEvAIBADANB*****==\";" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "System.out.println(\"公钥:\" + publicKey);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "System.out.println(\"私钥:\" + privateKey);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 模拟入参" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "HashMap reqMap = new HashMap<>();" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 验签步骤" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 1. 从请求中取出sign属性,注意:待验签的字符串不包含sign属性,此时需要从Map中取出。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "String reqSign = reqMap.remove(\"sign\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "System.out.println(\"加签结果:\" + reqSign);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 2. 生成待验签的字符串。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "String targetStr = buildSortedSignData(reqMap);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "System.out.println(\"加签的字符串:\" + targetStr);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 3. 进行验签,注意:此处验签的公钥需要修改为AGC管理台上的公钥。" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "boolean result = verify(targetStr.getBytes(StandardCharsets.UTF_8), publicKey, reqSign);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "System.out.println(\"验签结果为:\" + result);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "/**" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* 生成待签名的字符串" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "*" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @param params 入参" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @return 待签名的字符串" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "*/" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* 验签结果" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @param data 待验签的字符串" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @param publicKey 公钥" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @param sign 签名字符串" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @return 验签结果" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "验签测试代码 JAVA package com.huawei.game.domain.develop.test; import org.apache.commons.codec.binary.Base64; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.PrivateKey; import java.security.Signature; import java.security.spec.PKCS8EncodedKeySpec; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; public class SecretCreateSignTest { public static void main(String[] args) throws Exception { // 以下公钥和私钥为临时生成,以供展示代码示例,正式环境请替换 String publicKey = \"MIIBIjANBgkqh*****AB\"; String privateKey = \"MIIEvAIBADANB*****==\"; System.out.println(\"公钥:\" + publicKey); System.out.println(\"私钥:\" + privateKey); HashMap reqMap = new HashMap<>(); reqMap.put(\"requestId\", \"550***800\"); reqMap.put(\"userIdType\", \"1\"); reqMap.put(\"userId\", \"144***50\"); reqMap.put(\"zoneId\", \"957***76\"); reqMap.put(\"roleId\", \"101\"); reqMap.put(\"productId\", \"11\"); reqMap.put(\"price\", \"600\"); reqMap.put(\"currency\", \"CNY\"); reqMap.put(\"ts\", \"174***64\"); reqMap.put(\"quantity\", \"1\"); // 待加签的字符串 String str = buildSortedSignData(reqMap); // 加签的字符串 String sign = signWithRSA(str.getBytes(StandardCharsets.UTF_8), privateKey); reqMap.put(\"sign\", sign); System.out.println(\"加签结果:\" + sign); } /** * 生成待签名的字符串 * * @param params 入参 * @return 待签名的字符串 */ public static String buildSortedSignData(Map params) throws UnsupportedEncodingException { StringBuilder targetParamStr = new StringBuilder(); Map sortedParamMap = new TreeMap<>(params); for (Map.Entry param : sortedParamMap.entrySet()) { String key = param.getKey(); String value = param.getValue(); targetParamStr.append(key) .append(\"=\") .append(null == value ? \"\" : URLEncoder.encode(value, \"UTF-8\")) .append(\"&\"); } return targetParamStr.substring(0, targetParamStr.toString().length() - 1); } /** * 签名结果 * * @param data 待签名的字符串 * @param privateKey 私钥 * @return 签名结果 */ public static String signWithRSA(byte[] data, String privateKey) throws Exception { byte[] keyBytes = Base64.decodeBase64(privateKey); PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec); Signature signature = Signature.getInstance(\"SHA256WithRSA/PSS\"); signature.initSign(privateK); signature.update(data); return Base64.encodeBase64String(signature.sign()); } }" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.security.PrivateKey;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "import java.security.spec.PKCS8EncodedKeySpec;" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "public class SecretCreateSignTest {" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"requestId\", \"550***800\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"userIdType\", \"1\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"userId\", \"144***50\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"zoneId\", \"957***76\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"roleId\", \"101\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"productId\", \"11\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"price\", \"600\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"currency\", \"CNY\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"ts\", \"174***64\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"quantity\", \"1\");" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 待加签的字符串" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "String str = buildSortedSignData(reqMap);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "// 加签的字符串" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "String sign = signWithRSA(str.getBytes(StandardCharsets.UTF_8), privateKey);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "reqMap.put(\"sign\", sign);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "System.out.println(\"加签结果:\" + sign);" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* 签名结果" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @param data 待签名的字符串" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @param privateKey 私钥" + }, + { + "section": "校验签名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section15553164094014", + "text": "* @return 签名结果" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为服务器 -> 三方应用服务器" + ], + [ + "性能指标", + "TPS>200" + ], + [ + "最大响应时间", + "<200ms" + ], + [ + "接口URL", + "URL从AGC中接入配置获取。" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section20219133117119" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求标识。" + ], + [ + "userId", + "M", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "M", + "Int", + "玩家标识类型: 1:playerId 2:openId 3:unionid 4:gamePlayerId 5:teamPlayerId 6:thirdUserId 说明 userId和userIdType配套使用,userId是值,userIdType是类型。" + ], + [ + "zoneId", + "M", + "String(64)", + "游戏内区服ID。" + ], + [ + "roleId", + "M", + "String(64)", + "游戏内角色ID。" + ], + [ + "productId", + "M", + "String(64)", + "商品ID。" + ], + [ + "price", + "M", + "Long", + "商品价格,单位:分。" + ], + [ + "quantity", + "M", + "Long", + "订购数量。" + ], + [ + "currency", + "M", + "String(4)", + "商品价格币种。" + ], + [ + "ts", + "M", + "Long", + "当前时间(单位为:milliseconds),由System.currentTimeMillis()获取。" + ], + [ + "sign", + "M", + "String(8192)", + "RSA签名(使用游戏服务公钥进行验签,待验签内容生成方法见签名机制)。 签名算法为SHA256WithRSA/PSS。 注意 考虑到自选参数格式多样化,本参数在\"utf-8\" urlencode后发送。 Java中request的getParameter()方法会隐含进行urldecode。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211" + }, + { + "location": "", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "说明" + ], + [ + "result", + "M", + "Int", + "操作结果: 0:成功 1:验签失败 2:业务信息错误,比如userId不存在,区服角色错误 3:IP白名单限制,开发者侧拒绝服务(禁止开发者设置白名单,错误码仅仅用于异常监控) 4:游戏内购买限制 99:其他错误" + ], + [ + "payload", + "M", + "String(256)", + "订单关键信息。 说明 响应的payload,会用于后续的发货流程中。建议和游戏内下单时提供给华为收银台的保持相同,避免对后续发货流程的影响。" + ], + [ + "sign", + "M", + "String(8192)", + "签名信息。 待签名字符串: payload=xxxx RSA签名(使用游戏服务私钥进行签名,待验签内容生成方法见签名机制)" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section10906112312191" + } + ], + "title": "下单", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:02.681Z", + "family": "game-items", + "endpoint": "propapi-order" +} diff --git a/pkg/domain/reference/game-items/propapi-order.parameters.json b/pkg/domain/reference/game-items/propapi-order.parameters.json new file mode 100644 index 0000000..7f70770 --- /dev/null +++ b/pkg/domain/reference/game-items/propapi-order.parameters.json @@ -0,0 +1,105 @@ +[ + { + "name": "requestId", + "in": "body", + "required": true, + "type": "string", + "description": "请求标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64 + }, + { + "name": "userId", + "in": "body", + "required": true, + "type": "string", + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "required": true, + "type": "integer", + "description": "玩家标识类型: 1:playerId 2:openId 3:unionid 4:gamePlayerId 5:teamPlayerId 6:thirdUserId 说明 userId和userIdType配套使用,userId是值,userIdType是类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + }, + { + "name": "zoneId", + "in": "body", + "required": true, + "type": "string", + "description": "游戏内区服ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64 + }, + { + "name": "roleId", + "in": "body", + "required": true, + "type": "string", + "description": "游戏内角色ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64 + }, + { + "name": "productId", + "in": "body", + "required": true, + "type": "string", + "description": "商品ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 64 + }, + { + "name": "price", + "in": "body", + "required": true, + "type": "integer", + "description": "商品价格,单位:分。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211" + }, + { + "name": "quantity", + "in": "body", + "required": true, + "type": "integer", + "description": "订购数量。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211" + }, + { + "name": "currency", + "in": "body", + "required": true, + "type": "string", + "description": "商品价格币种。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 4 + }, + { + "name": "ts", + "in": "body", + "required": true, + "type": "integer", + "description": "当前时间(单位为:milliseconds),由System.currentTimeMillis()获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211" + }, + { + "name": "sign", + "in": "body", + "required": true, + "type": "string", + "description": "RSA签名(使用游戏服务公钥进行验签,待验签内容生成方法见签名机制)。 签名算法为SHA256WithRSA/PSS。 注意 考虑到自选参数格式多样化,本参数在\"utf-8\" urlencode后发送。 Java中request的getParameter()方法会隐含进行urldecode。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-order-0000002321296666#section89871216101211", + "maxLength": 8192 + } +] diff --git a/pkg/domain/reference/gameplay/asset-details.json b/pkg/domain/reference/gameplay/asset-details.json new file mode 100644 index 0000000..bd2e568 --- /dev/null +++ b/pkg/domain/reference/gameplay/asset-details.json @@ -0,0 +1,408 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section1168614731019", + "text": "请求示例\nPOST {接口url} \nHost: xxx \nContent-Type: application/json \nheaders:\nappId: 165***568\ntimestamp: 1729479182505\nnonce: ABC***123\nsign: cnVub29i5Y********cndlcXI=\n{ \n \"appId\": \"135***568\",\n \"userId\": \"01***33\", \n \"userIdType\": 4, \n \"serverId\": \"123456\",\n \"roleId\": \"4563971\", \n \"assetType\": \"skin\", \n \"category\": \"SSS\",\n \"pageNo\": 1,\n \"pageSize\": 20,\n \"lang\": \"zh_CN\" \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section239825451012", + "text": "响应示例\nHTTP/1.1 200 OK \nContent-Type: application/json;charset=UTF-8 \n{\n \"result\":0,\n \"hasNext\": true,\n \"assets\": [\n {\n \"name\": \"彩虹大聪明\",\n \"idx\": \"string\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/get-public-key-0000001050164350", + "title": "获取验签公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#ZH-CN_TOPIC_0000002022225253__zh-cn_topic_0000001896789840_p20910265379", + "title": "资源明细数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#ZH-CN_TOPIC_0000002022225253__zh-cn_topic_0000001896789840_p26732703020", + "title": "GameResource" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#ZH-CN_TOPIC_0000002022225253__zh-cn_topic_0000001896789840_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/query-game-info-0000001050164346", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", + "title": "查询资产概要" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-propapi-0000002355134701", + "title": "游戏道具商城" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section19331230181011", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8751936131014", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section133671740131017", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "title": "Header参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section1168614731019", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section4102155161010", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section239825451012", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section19331230181011", + "text": "华为游戏服务器调用此接口查询玩家在玩游戏的资产明细数据,并将信息展示在游戏中心的“在玩”页面上。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section4102155161010", + "text": "GameResource" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "将Header参数中的appId、timestamp、nonce字段依次拼接成一个待验签的字符串。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "对待验签字符串使用SHA256WithRSA/PSS算法进行签名。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "将签名后的字符串经过Base64编码,得到的字符串与sign字段中的签名字符串进行一致性验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "Java示例代码如下:" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "// 从Header中取出appId,timestamp,nonce,拼接成待签名的字符串" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "String rawStr = appId + timestamp + nonce;" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "// 获取验签公钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "String publicKey = \"xxxxxxxxx\";" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "// 验签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "PublicKey publicK = keyFactory.generatePublic(pkcs8KeySpec);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "signature.initVerify(key);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "signature.update(rawStr.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section205561419163916", + "text": "signature.verify(Base64.decodeBase64(sign)); // sign是Header中的字段,即请求时传递的签名" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为游戏服务器 -> 开发者服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<500ms" + ], + [ + "接口URL", + "URL由华为运营联系您获取。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8751936131014" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "timestamp", + "是", + "String(32)", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "nonce", + "是", + "String(64)", + "随机字符串。" + ], + [ + "sign", + "是", + "String(1024)", + "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "userId", + "是", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "是", + "Integer", + "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + ], + [ + "serverId", + "否", + "String(32)", + "区服ID。" + ], + [ + "roleId", + "否", + "String(32)", + "角色ID。" + ], + [ + "assetType", + "是", + "String(32)", + "资产类型,例如:“skin”。" + ], + [ + "category", + "否", + "String(32)", + "资产分类标签值,例如“SSS”。" + ], + [ + "pageNo", + "是", + "Integer", + "页码。起始页码为1。" + ], + [ + "pageSize", + "是", + "Integer", + "每页数量,默认20个,最大100个。" + ], + [ + "lang", + "是", + "String(20)", + "语言,用于获取不同语言的资源明细数据,至少需要支持zh_CN(中文)和en_US(英文)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "result", + "是", + "Integer", + "操作结果: 0:表示成功 1:验签失败 2:超时 3:业务信息错误 31:游戏号不存在 94:系统错误 95:IO错误 96:错误的url 97:错误的响应 98:参数错误 99:其他错误" + ], + [ + "hasNext", + "否", + "Boolean", + "是否还有下一页: true:是。 false:否。" + ], + [ + "assets", + "否", + "List", + "资源明细数据,最多返回100组资源数据。语言版本应与请求参数中的lang参数指定的一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "name", + "是", + "String(32)", + "资源名称。" + ], + [ + "idx", + "是", + "String(128)", + "资源索引。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section4102155161010" + } + ], + "title": "查询资产明细", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:45.882Z", + "family": "gameplay", + "endpoint": "asset-details" +} diff --git a/pkg/domain/reference/gameplay/asset-details.parameters.json b/pkg/domain/reference/gameplay/asset-details.parameters.json new file mode 100644 index 0000000..3e4f428 --- /dev/null +++ b/pkg/domain/reference/gameplay/asset-details.parameters.json @@ -0,0 +1,135 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 32 + }, + { + "name": "timestamp", + "in": "header", + "type": "string", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 32 + }, + { + "name": "nonce", + "in": "header", + "type": "string", + "required": true, + "description": "随机字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 64 + }, + { + "name": "sign", + "in": "header", + "type": "string", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section94561545161915", + "maxLength": 1024 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32 + }, + { + "name": "userId", + "in": "body", + "type": "string", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "type": "integer", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + }, + { + "name": "serverId", + "in": "body", + "type": "string", + "required": false, + "description": "区服ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32 + }, + { + "name": "roleId", + "in": "body", + "type": "string", + "required": false, + "description": "角色ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32 + }, + { + "name": "assetType", + "in": "body", + "type": "string", + "required": true, + "description": "资产类型,例如:“skin”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32 + }, + { + "name": "category", + "in": "body", + "type": "string", + "required": false, + "description": "资产分类标签值,例如“SSS”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 32 + }, + { + "name": "pageNo", + "in": "body", + "type": "integer", + "required": true, + "description": "页码。起始页码为1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "minimum": 1 + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": true, + "description": "每页数量,默认20个,最大100个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maximum": 100 + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,用于获取不同语言的资源明细数据,至少需要支持zh_CN(中文)和en_US(英文)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253#section8202184551317", + "maxLength": 20 + } +] diff --git a/pkg/domain/reference/gameplay/asset-summary.json b/pkg/domain/reference/gameplay/asset-summary.json new file mode 100644 index 0000000..5d4d79f --- /dev/null +++ b/pkg/domain/reference/gameplay/asset-summary.json @@ -0,0 +1,649 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section1168614731019", + "text": "请求示例\nPOST {接口url} \nHost: xxx \nContent-Type: application/json \nheaders:\nappId: 165***568\ntimestamp: 1729479182505\nnonce: ABC***123\nsign: cnVub29i5Y********cndlcXI=\n{ \n \"appId\": \"135***568\",\n \"userId\": \"01***33\", \n \"userIdType\": 4, \n \"serverId\": \"123456\",\n \"roleId\": \"4563971\", \n \"lang\": \"zh_CN\" \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section239825451012", + "text": "响应示例\nHTTP/1.1 200 OK \nContent-Type: application/json;charset=UTF-8\n{\n \"result\": 0,\n \"profile\": {\n \"title\": \"资产概览\",\n \"data\": [\n {\n \"label\": \"赛季胜利\",\n \"value\": \"168\"\n }\n ]\n },\n \"assets\": [\n {\n \"title\": \"皮肤收集\",\n \"layout\": {\n \"hasMore\": false,\n \"lineNum\": 1,\n \"columnNum\": 3\n },\n \"data\": {\n \"profile\": {\n \"assetType\": \"skin\",\n \"categories\": [\n {\n \"name\": \"SSS级\",\n \"value\": \"SSS\"\n }\n ],\n \"total\": 968\n },\n \"details\": [\n {\n \"name\": \"彩虹大聪明\",\n \"idx\": \"string\"\n }\n ]\n }\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/get-public-key-0000001050164350", + "title": "获取验签公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p425951173513", + "title": "资产概要统计数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p1659182115443", + "title": "资产明细数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p26732703020", + "title": "AssetStatisticCard" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p1654914113312", + "title": "AssetCard" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p32140253327", + "title": "GameStatistic" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p8651388497", + "title": "CardLayout" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p22180319491", + "title": "AssetCardData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p9411155316493", + "title": "AssetProfile" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p5230161455020", + "title": "GameResource" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#ZH-CN_TOPIC_0000002022105729__zh-cn_topic_0000001896629956_p125584123502", + "title": "CategoryTag" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/query-game-info-0000001050164346", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", + "title": "分页查询玩家战绩" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-details-0000002022225253", + "title": "查询资产明细" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section19331230181011", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section8751936131014", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section1168614731019", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section239825451012", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section19331230181011", + "text": "华为游戏服务器调用此接口查询玩家在玩游戏的资产概要数据,并将信息展示在游戏中心的“在玩”页面上。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "text": "Header参数" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "AssetStatisticCard" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "GameStatistic" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "AssetCard" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "CardLayout" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "AssetCardData" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "AssetProfile" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "CategoryTag" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010", + "text": "GameResource" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "将Header参数中的appId、timestamp、nonce字段依次拼接成一个待验签的字符串。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "对待验签字符串使用SHA256WithRSA/PSS算法进行签名。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "将签名后的字符串经过Base64编码,得到的字符串与sign字段中的签名字符串进行一致性验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "Java示例代码如下:" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "// 从Header中取出appId,timestamp,nonce,拼接成待签名的字符串" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "String rawStr = appId + timestamp + nonce;" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "// 获取验签公钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "String publicKey = \"xxxxxxxxx\";" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "// 验签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "PublicKey publicK = keyFactory.generatePublic(pkcs8KeySpec);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "signature.initVerify(key);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "signature.update(rawStr.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section205561419163916", + "text": "signature.verify(Base64.decodeBase64(sign)); // sign是Header中的字段,即请求时传递的签名" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为游戏服务器 -> 开发者服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<500ms" + ], + [ + "接口URL", + "URL由华为运营联系您获取。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section8751936131014" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "timestamp", + "是", + "String(32)", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "nonce", + "是", + "String(64)", + "随机字符串。" + ], + [ + "sign", + "是", + "String(1024)", + "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "userId", + "是", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "是", + "Integer", + "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + ], + [ + "serverId", + "否", + "String(32)", + "区服ID。" + ], + [ + "roleId", + "否", + "String(32)", + "角色ID。" + ], + [ + "lang", + "是", + "String(20)", + "语言,用于获取不同语言的资产概要统计数据和资产明细数据,至少需要支持zh_CN(中文)和en_US(英文)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "result", + "是", + "Integer", + "操作结果。 0:表示成功 1:验签失败 2:超时 3:业务信息错误 31:游戏号不存在 94:系统错误 95:IO 错误 96:错误的url 97:错误的响应 98:参数错误 99:其他错误" + ], + [ + "profile", + "否", + "AssetStatisticCard", + "资产概要统计数据,语言版本应与请求参数中的lang参数指定的一致。" + ], + [ + "assets", + "否", + "List", + "资产明细数据,最多返回20组资产数据。语言版本应与请求参数中的lang参数指定的一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "title", + "是", + "String(16)", + "统计面板的标题,例如“资产概览”。" + ], + [ + "data", + "是", + "List", + "统计值,最多返回20组数据。 说明 请提前联系华为运营人员商定。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "label", + "是", + "String(16)", + "统计值描述。" + ], + [ + "value", + "是", + "String(16)", + "统计值数值。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "title", + "是", + "String(16)", + "资产卡名称,例如:“皮肤收集”。" + ], + [ + "layout", + "是", + "CardLayout", + "卡片分布信息。" + ], + [ + "data", + "是", + "AssetCardData", + "卡片数据信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "hasMore", + "是", + "Boolean", + "是否有更多页面。 true:是 false:否" + ], + [ + "lineNum", + "是", + "Integer", + "行数。" + ], + [ + "columnNum", + "是", + "Integer", + "列数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "profile", + "是", + "AssetProfile", + "资产概要信息。" + ], + [ + "details", + "是", + "List", + "资产明细数据,最多返回20组资产数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "assetType", + "是", + "String", + "资产类型(可用于查询资产明细)。" + ], + [ + "categories", + "否", + "List", + "资产分类标签,最多返回20个资产标签。" + ], + [ + "total", + "是", + "Integer", + "玩家持有的总数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "name", + "是", + "String(16)", + "分类显示名称。" + ], + [ + "value", + "是", + "String(16)", + "分类值(可用于查询资产明细)。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "name", + "是", + "String(32)", + "资源名称。" + ], + [ + "idx", + "是", + "String(128)", + "资源索引。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section4102155161010" + } + ], + "title": "查询资产概要", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:47.368Z", + "family": "gameplay", + "endpoint": "asset-summary" +} diff --git a/pkg/domain/reference/gameplay/asset-summary.parameters.json b/pkg/domain/reference/gameplay/asset-summary.parameters.json new file mode 100644 index 0000000..3daa5ce --- /dev/null +++ b/pkg/domain/reference/gameplay/asset-summary.parameters.json @@ -0,0 +1,99 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 32 + }, + { + "name": "timestamp", + "in": "header", + "type": "string", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 32 + }, + { + "name": "nonce", + "in": "header", + "type": "string", + "required": true, + "description": "随机字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 64 + }, + { + "name": "sign", + "in": "header", + "type": "string", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section133671740131017", + "maxLength": 1024 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 32 + }, + { + "name": "userId", + "in": "body", + "type": "string", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "type": "integer", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + }, + { + "name": "serverId", + "in": "body", + "type": "string", + "required": false, + "description": "区服ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 32 + }, + { + "name": "roleId", + "in": "body", + "type": "string", + "required": false, + "description": "角色ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 32 + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,用于获取不同语言的资产概要统计数据和资产明细数据,至少需要支持zh_CN(中文)和en_US(英文)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729#section114701453163211", + "maxLength": 20 + } +] diff --git a/pkg/domain/reference/gameplay/basic-info.json b/pkg/domain/reference/gameplay/basic-info.json new file mode 100644 index 0000000..229205b --- /dev/null +++ b/pkg/domain/reference/gameplay/basic-info.json @@ -0,0 +1,520 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section109281921420", + "text": "请求示例\nPOST {接口url} \nHost: xxx \nContent-Type: application/json \nheaders:\nappId: 165***568\ntimestamp: 1729479182505\nnonce: ABC***123\nsign: cnVub29i5Y********cndlcXI=\n{ \n \"appId\": \"165***568\", \n \"userIds\": [\n \"userId\": \"886***126\",\n \"userIdType\": 4\n ],\n \"lang\": \"zh_CN\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section12681228131415", + "text": "响应示例\n{\n \"result\": 0,\n \"players\": [\n \"userId\": \"ABC***DEF\",\n \"userIdType\": 4,\n \"basicInfo\":{\n \"id\": \"afafafgd\",\n \"name\": \"nickname123\",\n \"avatar\": \"https://abc.com/avatar\",\n \"avatarType\": 2,\n \"level\": {\n \"name\": \"level5\"\n },\n \"avatarExt\": {\n \"avatarUpdateTime\": 1729479182505\n }\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/get-public-key-0000001050164350", + "title": "获取验签公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#ZH-CN_TOPIC_0000002038975322__p17884430419", + "title": "UserId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#ZH-CN_TOPIC_0000002038975322__zh-cn_topic_0000001850302325_p031535817384", + "title": "玩家信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#ZH-CN_TOPIC_0000002038975322__p9452154912104", + "title": "Player" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#ZH-CN_TOPIC_0000002038975322__zh-cn_topic_0000001850302325_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#ZH-CN_TOPIC_0000002038975322__p168318367114", + "title": "PlayerInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#ZH-CN_TOPIC_0000002038975322__zh-cn_topic_0000001850302325_p3525214107", + "title": "AvatarExt" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#ZH-CN_TOPIC_0000002038975322__zh-cn_topic_0000001850302325_p32140253327", + "title": "GameLevel" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/query-game-info-0000001050164346", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", + "title": "批量查询玩家角色信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section85026377136", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section1994120406138", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section78935915145", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "title": "Header参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section109281921420", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section12681228131415", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section85026377136", + "text": "华为游戏服务器调用此接口批量查询玩家基本信息,并将信息展示在游戏中心的“在玩”页面上。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "text": "UserId" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415", + "text": "Player" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415", + "text": "PlayerInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415", + "text": "AvatarExt" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415", + "text": "GameLevel" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "将Header参数中的appId、timestamp、nonce字段依次拼接成一个待验签的字符串。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "对待验签字符串使用SHA256WithRSA/PSS算法进行签名。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "将签名后的字符串经过Base64编码,得到的字符串与sign字段中的签名字符串进行一致性验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "Java示例代码如下:" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "// 从Header中取出appId,timestamp,nonce,拼接成待签名的字符串" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "String rawStr = appId + timestamp + nonce;" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "// 获取验签公钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "String publicKey = \"xxxxxxxxx\";" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "// 验签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "PublicKey publicK = keyFactory.generatePublic(pkcs8KeySpec);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "signature.initVerify(key);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "signature.update(rawStr.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section205561419163916", + "text": "signature.verify(Base64.decodeBase64(sign)); // sign是Header中的字段,即请求时传递的签名" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为游戏服务器 -> 开发者服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<500ms" + ], + [ + "接口URL", + "URL由华为运营联系您获取。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section1994120406138" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "timestamp", + "是", + "String(32)", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "nonce", + "是", + "String(64)", + "随机字符串。" + ], + [ + "sign", + "是", + "String(1024)", + "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "userIds", + "是", + "List", + "玩家标识列表,最多返回20个玩家信息。" + ], + [ + "lang", + "是", + "String(20)", + "语言,用于获取不同语言的玩家信息,至少需要支持zh_CN(中文)和en_US(英文)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "userId", + "是", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "是", + "Integer", + "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "result", + "是", + "Integer", + "操作结果: 0:表示成功 1:验签失败 2:超时 3:业务信息错误 31:游戏号不存在 94:系统错误 95:IO错误 96:错误的url 97:错误的响应 98:参数错误 99:其他错误" + ], + [ + "players", + "否", + "List", + "玩家信息列表,最多返回20个玩家信息。语言版本应与请求参数中的lang参数指定的一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "userId", + "是", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "是", + "Integer", + "玩家标识类型: playerId openId unionId gamePlayerId teamPlayerId thirdOpenId" + ], + [ + "basicInfo", + "是", + "PlayerInfo", + "玩家基本信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "id", + "是", + "String(256)", + "游戏生成的玩家ID。" + ], + [ + "name", + "是", + "String(64)", + "游戏昵称。" + ], + [ + "avatar", + "是", + "String(256)", + "头像的URL。头像图片支持jpg、jpeg、bmp、png格式,URL需要携带图片的后缀,并且图片地址需要https格式,例如https://test.abc.com/testPath/test.png。" + ], + [ + "avatarExt", + "是", + "AvatarExt", + "头像的额外信息。" + ], + [ + "level", + "否", + "GameLevel", + "游戏等级。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "avatarUpdateTime", + "否", + "Long", + "头像更新时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "avatarHash", + "否", + "String(64)", + "头像的SHA256值。 注意 avatarUpdateTime与avatarHash二选一,不可都为空。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "idx", + "是", + "String(128)", + "游戏等级的图片资源索引,即上下架游戏资源时的上报值。" + ], + [ + "name", + "是", + "String(32)", + "等级名称。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section163602521415" + } + ], + "title": "批量查询玩家基本信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:49.144Z", + "family": "gameplay", + "endpoint": "basic-info" +} diff --git a/pkg/domain/reference/gameplay/basic-info.parameters.json b/pkg/domain/reference/gameplay/basic-info.parameters.json new file mode 100644 index 0000000..57e6bd0 --- /dev/null +++ b/pkg/domain/reference/gameplay/basic-info.parameters.json @@ -0,0 +1,92 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 32 + }, + { + "name": "timestamp", + "in": "header", + "type": "string", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 32 + }, + { + "name": "nonce", + "in": "header", + "type": "string", + "required": true, + "description": "随机字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 64 + }, + { + "name": "sign", + "in": "header", + "type": "string", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section157181352024", + "maxLength": 1024 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "maxLength": 32 + }, + { + "name": "userIds", + "in": "body", + "type": "array", + "required": true, + "description": "玩家标识列表,最多返回20个玩家信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "itemsType": "object", + "itemsProperties": [ + { + "name": "userId", + "in": "body", + "type": "string", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "type": "integer", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + } + ] + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,用于获取不同语言的玩家信息,至少需要支持zh_CN(中文)和en_US(英文)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322#section54371514181416", + "maxLength": 20 + } +] diff --git a/pkg/domain/reference/gameplay/label.json b/pkg/domain/reference/gameplay/label.json new file mode 100644 index 0000000..8ed781a --- /dev/null +++ b/pkg/domain/reference/gameplay/label.json @@ -0,0 +1,359 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section1168614731019", + "text": "请求示例\nPOST {接口url} \nHost: xxx \nContent-Type: application/json \nheaders:\nappId: 165***568\ntimestamp: 1729479182505\nnonce: ABC***123\nsign: cnVub29i5Y********cndlcXI=\n{ \n \"appId\": \"165***568\", \n \"lang\": \"zh_CN\" \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section239825451012", + "text": "响应示例\nHTTP/1.1 200 OK \nContent-Type: application/json;charset=UTF-8\n{ \n \"result\": 0,\n \"tags\": [\n {\n \"name\": \"全部模式\",\n \"value\": \"1\"\n },\n {\n \"name\": \"团战模式\",\n \"value\": \"2\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/get-public-key-0000001050164350", + "title": "获取验签公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#ZH-CN_TOPIC_0000001985625670__zh-cn_topic_0000001896789828_p2154121433112", + "title": "分类标签名称" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#ZH-CN_TOPIC_0000001985625670__zh-cn_topic_0000001896789828_p26732703020", + "title": "CategoryTag" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#ZH-CN_TOPIC_0000001985625670__zh-cn_topic_0000001896789828_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p1798415810255", + "title": "查询战绩" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/query-game-info-0000001050164346", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", + "title": "查询游戏概要信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", + "title": "分页查询玩家战绩" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section19331230181011", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8751936131014", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8202184551317", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section1168614731019", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section4102155161010", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section239825451012", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section19331230181011", + "text": "华为游戏服务器调用此接口查询玩家在玩游戏战绩的筛选标签,并将信息展示在游戏中心的“在玩”页面上。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "text": "Header参数" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section4102155161010", + "text": "CategoryTag" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "将Header参数中的appId、timestamp、nonce字段依次拼接成一个待验签的字符串。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "对待验签字符串使用SHA256WithRSA/PSS算法进行签名。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "将签名后的字符串经过Base64编码,得到的字符串与sign字段中的签名字符串进行一致性验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "Java示例代码如下:" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "// 从Header中取出appId,timestamp,nonce,拼接成待签名的字符串" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "String rawStr = appId + timestamp + nonce;" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "// 获取验签公钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "String publicKey = \"xxxxxxxxx\";" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "// 验签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "PublicKey publicK = keyFactory.generatePublic(pkcs8KeySpec);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "signature.initVerify(key);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "signature.update(rawStr.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section205561419163916", + "text": "signature.verify(Base64.decodeBase64(sign)); // sign是Header中的字段,即请求时传递的签名" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为游戏服务器 -> 开发者服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<500ms" + ], + [ + "接口URL", + "URL由华为运营联系您获取。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8751936131014" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "timestamp", + "是", + "String(32)", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "nonce", + "是", + "String(64)", + "随机字符串。" + ], + [ + "sign", + "是", + "String(1024)", + "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "lang", + "是", + "String(20)", + "语言,用于获取不同语言的分类标签名称,至少需要支持zh_CN(中文)和en_US(英文)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8202184551317" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "result", + "是", + "Integer", + "操作结果。 0:表示成功 1:验签失败 2:超时 3:业务信息错误 31:游戏号不存在 94:系统错误 95:IO错误 96:错误的url 97:错误的响应 98:参数错误 99:其他错误" + ], + [ + "tags", + "否", + "List", + "战绩分类标签,最多返回20个战绩标签。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "name", + "是", + "String(16)", + "分类标签名称,语言版本应与请求参数中的lang参数指定的一致。" + ], + [ + "value", + "是", + "String(16)", + "分类标签值。 说明 该值用于查询战绩接口的传参。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section4102155161010" + } + ], + "title": "查询战绩筛选标签", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:52.248Z", + "family": "gameplay", + "endpoint": "label" +} diff --git a/pkg/domain/reference/gameplay/label.parameters.json b/pkg/domain/reference/gameplay/label.parameters.json new file mode 100644 index 0000000..ec5d8b0 --- /dev/null +++ b/pkg/domain/reference/gameplay/label.parameters.json @@ -0,0 +1,56 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 32 + }, + { + "name": "timestamp", + "in": "header", + "type": "string", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 32 + }, + { + "name": "nonce", + "in": "header", + "type": "string", + "required": true, + "description": "随机字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 64 + }, + { + "name": "sign", + "in": "header", + "type": "string", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section133671740131017", + "maxLength": 1024 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8202184551317", + "maxLength": 32 + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,用于获取不同语言的分类标签名称,至少需要支持zh_CN(中文)和en_US(英文)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670#section8202184551317", + "maxLength": 20 + } +] diff --git a/pkg/domain/reference/gameplay/resources.json b/pkg/domain/reference/gameplay/resources.json new file mode 100644 index 0000000..720957c --- /dev/null +++ b/pkg/domain/reference/gameplay/resources.json @@ -0,0 +1,411 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section1168614731019", + "text": "请求示例\nPOST /gameservice/api/gbClientApi\nHost: jos-open-api.cloud.huawei.com\nContent-Type: application/x-www-form-urlencoded\nmethod=external.hms.gs.syncGameResources&appId=135***568&resources=[{\"index\":\"123445667\",\"name\":\"皮肤-彩虹大聪明\",\"type\":1,\"url\":\"https://***example.jpg\",\"updateTime\":1716349620000,\"resourceHash\":\"AKHSJ******AHDO\",\"operType\":0}]&ts=1670841860308&sign=**************" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section239825451012", + "text": "响应示例\nHTTP/1.1 200 OK \nContent-Type: application/json;charset=UTF-8 \n{\n \"rtnCode\": \"0\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#ZH-CN_TOPIC_0000002022105725__zh-cn_topic_0000001900949436_p1228021816231", + "title": "Resources" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "title": "签名机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/query-game-info-0000001050164346", + "title": "获取游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", + "title": "批量查询玩家角色信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", + "title": "查询游戏概要信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section19331230181011", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8751936131014", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section133671740131017", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section1168614731019", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section4102155161010", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section239825451012", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "title": "签名机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section19331230181011", + "text": "开发者服务器调用此接口同步华为服务器的游戏资源,用于上传或下架“在玩”页面上的图片或视频。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "text": "Resources" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "为了确保HTTPS传输的安全性,防止请求参数被篡改,应用需要在调用接口时携带请求参数的签名字符串,用于华为服务器对请求参数进行校验。签名字符串的生成规则如下所示:" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "将请求参数Body中除sign以外的参数,按参数名首字母的ASCII码将参数升序排序。若遇到相同首字母,则比较第二个字母,以此类推。" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "排序完成之后,将所有参与签名的参数值进行urlencode之后以“&”字符连接成字符串,例如“a=xxxxxx&b=xxxxxxx&c=xxxxxx”,此字符串便是待签名字符串。 Java示例代码如下: // 组装body内除sign以外的参数,此处参数值仅为示例 Map paramsMap = new HashMap<>(); paramsMap.put(\"appId\", \"appId\"); paramsMap.put(\"reqId\", \"reqId\"); paramsMap.put(\"status\", \"1\"); paramsMap.put(\"ts\", \"111111111\"); // 对参数进行字典序排序 Map tempMap = new TreeMap<>(params); // 拼接参数 for (Map.Entry entry : tempMap.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); base.append(key).append('=').append(null == value ? '' : URLEncoder.encode(value, \"UTF-8\")).append('&'); } if (base.length() > 0) { base.deleteCharAt(base.length() - 1); }" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "// 组装body内除sign以外的参数,此处参数值仅为示例" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "Map paramsMap = new HashMap<>();" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "paramsMap.put(\"appId\", \"appId\");" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "paramsMap.put(\"reqId\", \"reqId\");" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "paramsMap.put(\"status\", \"1\");" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "paramsMap.put(\"ts\", \"111111111\");" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "// 对参数进行字典序排序" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "Map tempMap = new TreeMap<>(params);" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "// 拼接参数" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "for (Map.Entry entry : tempMap.entrySet()) {" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "String key = entry.getKey();" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "String value = entry.getValue();" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "base.append(key).append('=').append(null == value ? '' : URLEncoder.encode(value, \"UTF-8\")).append('&');" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "}" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "if (base.length() > 0) {" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "base.deleteCharAt(base.length() - 1);" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "将待签名字符串使用游戏私钥按照RSA算法(SHA256WithRSA/PSS)进行签名,将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 说明 游戏私钥在开通游戏服务后生成,获取请参见获取游戏服务信息。 golang默认使用PSSSaltLengthAuto,需换成PSSSaltLengthEqualsHash。 Java示例代码如下: // 获取签名私钥,具体实现方法由开发者自行决定,此处仅为接口示例 String privateKey = \"xxxxxx\"; // 加签,BouncyCastleProvider的创建较耗费性能,建议写成单例 byte[] keyBytes = Base64.decodeBase64(privateKey); PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec); Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider()); signature.initSign(privateK); signature.update(sortedParams.getBytes(StandardCharsets.UTF_8)); String sign = Base64.encodeBase64String(signature.sign());" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "游戏私钥在开通游戏服务后生成,获取请参见获取游戏服务信息。" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "golang默认使用PSSSaltLengthAuto,需换成PSSSaltLengthEqualsHash。" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "Java示例代码如下:" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "// 获取签名私钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "String privateKey = \"xxxxxx\";" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "// 加签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "byte[] keyBytes = Base64.decodeBase64(privateKey);" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec);" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "signature.initSign(privateK);" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "signature.update(sortedParams.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "签名机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section16341195442212", + "text": "String sign = Base64.encodeBase64String(signature.sign());" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为游戏服务器" + ], + [ + "接口URL", + "https://jos-open-api.cloud.huawei.com/gameservice/api/gbClientApi" + ], + [ + "数据格式", + "请求:Content-Type: application/x-www-form-urlencoded(表单方式) 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8751936131014" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "method", + "是", + "String(64)", + "固定传入“external.hms.gs.syncGameResources”。" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "resources", + "是", + "String(300000)", + "图片或视频资源,JSON字符串,JSON类型List,最大支持50个资源。" + ], + [ + "ts", + "是", + "Long", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "sign", + "是", + "String(1024)", + "用于华为游戏服务器对请求参数验签的签名字符串。 为防止请求被篡改,游戏需要根据签名机制中的方法生成签名字符串,华为服务器在收到请求后会对签名字符串进行验签,验签成功后才会进行后续处理,否则将返回失败错误码。请求中除sign、resources以外的所有Body参数均参与签名。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "index", + "是", + "String(128)", + "资源索引,取值由开发者定义,在该游戏内必须全局唯一。" + ], + [ + "name", + "是", + "String(128)", + "资源名称。" + ], + [ + "type", + "是", + "Integer", + "资源类型。 1:图片,大小不超过500KB,格式支持jpg、jpeg、bmp、png。 2:视频,大小不超过500MB,格式支持mp4、avi、mov。 说明 请按要求上传如下特殊位置的图片,否则页面展示可能会失真: 要求各勋章图片均保持相同的尺寸和1:1的宽高比。 用于战绩信息背景的皮肤要求大小不超过500KB,尺寸为1080*1440。" + ], + [ + "url", + "否", + "String(2048)", + "可以公网访问的资源地址,需支持资源下载。 说明 上传游戏资源时,此参数必填。要求url中必须携带文件的后缀,并且图片地址需要https格式,例如https://test.abc.com/testPath/test.png。" + ], + [ + "updateTime", + "否", + "Long", + "更新时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "resourceHash", + "否", + "String(64)", + "图片资源的SHA256值。 说明 resourceHash和updateTime二选一,建议优先使用updateTime。如果资源的更新时间无法获取,则再传图片的散列值。" + ], + [ + "operType", + "是", + "Integer", + "对资源的操作。 0:上传资源 1:下架资源" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "rtnCode", + "是", + "String", + "服务端结果说明。 0:成功 -1:失败 1:接口鉴权失败" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section4102155161010" + } + ], + "title": "上传/下架游戏资源", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:54.087Z", + "family": "gameplay", + "endpoint": "resources" +} diff --git a/pkg/domain/reference/gameplay/resources.parameters.json b/pkg/domain/reference/gameplay/resources.parameters.json new file mode 100644 index 0000000..db2f044 --- /dev/null +++ b/pkg/domain/reference/gameplay/resources.parameters.json @@ -0,0 +1,141 @@ +[ + { + "name": "method", + "in": "body", + "type": "string", + "required": true, + "description": "固定传入“external.hms.gs.syncGameResources”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 64, + "enum": [ + "external.hms.gs.syncGameResources" + ] + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 32 + }, + { + "name": "resources", + "in": "body", + "type": "string", + "required": true, + "description": "图片或视频资源,JSON字符串,JSON类型List,最大支持50个资源。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 300000, + "encodedJson": { + "type": "array", + "itemsType": "object", + "maxItems": 50, + "itemsProperties": [ + { + "name": "index", + "in": "body", + "type": "string", + "required": true, + "description": "资源索引,取值由开发者定义,在该游戏内必须全局唯一。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 128 + }, + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "description": "资源名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 128 + }, + { + "name": "type", + "in": "body", + "type": "integer", + "required": true, + "description": "资源类型。 1:图片,大小不超过500KB,格式支持jpg、jpeg、bmp、png。 2:视频,大小不超过500MB,格式支持mp4、avi、mov。 说明 请按要求上传如下特殊位置的图片,否则页面展示可能会失真: 要求各勋章图片均保持相同的尺寸和1:1的宽高比。 用于战绩信息背景的皮肤要求大小不超过500KB,尺寸为1080*1440。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "enum": [ + "1", + "2" + ] + }, + { + "name": "url", + "in": "body", + "type": "string", + "required": false, + "description": "可以公网访问的资源地址,需支持资源下载。 说明 上传游戏资源时,此参数必填。要求url中必须携带文件的后缀,并且图片地址需要https格式,例如https://test.abc.com/testPath/test.png。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 2048 + }, + { + "name": "updateTime", + "in": "body", + "type": "integer", + "required": false, + "description": "更新时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "format": "int64" + }, + { + "name": "resourceHash", + "in": "body", + "type": "string", + "required": false, + "description": "图片资源的SHA256值。 说明 resourceHash和updateTime二选一,建议优先使用updateTime。如果资源的更新时间无法获取,则再传图片的散列值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 64 + }, + { + "name": "operType", + "in": "body", + "type": "integer", + "required": true, + "description": "对资源的操作。 0:上传资源 1:下架资源", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "enum": [ + "0", + "1" + ] + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "itemsRules": [ + { + "id": "upload-resource-url", + "kind": "required_if", + "field": "body.url", + "when": { + "field": "body.operType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "message": "url is required when uploading a resource.", + "suggestion": "Supply a publicly downloadable resource URL with its file extension." + } + ] + } + }, + { + "name": "ts", + "in": "body", + "type": "integer", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "format": "int64" + }, + { + "name": "sign", + "in": "body", + "type": "string", + "required": true, + "description": "用于华为游戏服务器对请求参数验签的签名字符串。 为防止请求被篡改,游戏需要根据签名机制中的方法生成签名字符串,华为服务器在收到请求后会对签名字符串进行验签,验签成功后才会进行后续处理,否则将返回失败错误码。请求中除sign、resources以外的所有Body参数均参与签名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725#section8202184551317", + "maxLength": 1024 + } +] diff --git a/pkg/domain/reference/gameplay/role-info.json b/pkg/domain/reference/gameplay/role-info.json new file mode 100644 index 0000000..2c5477f --- /dev/null +++ b/pkg/domain/reference/gameplay/role-info.json @@ -0,0 +1,424 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section109281921420", + "text": "请求示例\nPOST {接口url} \nHost: xxx \nContent-Type: application/json \nheaders:\nappId: 165***568\ntimestamp: 1729479182505\nnonce: ABC***123\nsign: cnVub29i5Y********cndlcXI=\n{ \n \"appId\": \"165***568\",\n \"userId\": \"886***126\", \n \"userIdType\": 4, \n \"lang\": \"zh_CN\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section12681228131415", + "text": "响应示例\n{\n \"result\": 0,\n \"roles\": [\n {\n \"roleId\": \"4563971\",\n \"roleName\": \"测试1号\",\n \"serverId\": \"1232654\",\n \"serverName\": \"官服一区\",\n \"avatar\": {\n \"imgUrl\": \"https://test.jpg\",\n \"updateTime\": 1729584156,\n \"imgHash\": \"d5f9fd84e81*****7aef63b093a75\"\n }\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/get-public-key-0000001050164350", + "title": "获取验签公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#ZH-CN_TOPIC_0000002075016173__zh-cn_topic_0000001850302325_p031535817384", + "title": "玩家角色信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#ZH-CN_TOPIC_0000002075016173__zh-cn_topic_0000001850302325_p26732703020", + "title": "PlayerRoleInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#ZH-CN_TOPIC_0000002075016173__zh-cn_topic_0000001850302325_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#ZH-CN_TOPIC_0000002075016173__p613810596546", + "title": "PlayerAvatar" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/query-game-info-0000001050164346", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basic-info-0000002038975322", + "title": "批量查询玩家基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725", + "title": "上传/下架游戏资源" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section85026377136", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section1994120406138", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section78935915145", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "title": "Header参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section109281921420", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section163602521415", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section12681228131415", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section85026377136", + "text": "华为游戏服务器调用此接口批量查询玩家角色信息。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section163602521415", + "text": "PlayerRoleInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section163602521415", + "text": "PlayerAvatar" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "将Header参数中的appId、timestamp、nonce字段依次拼接成一个待验签的字符串。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "对待验签字符串使用SHA256WithRSA/PSS算法进行签名。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "将签名后的字符串经过Base64编码,得到的字符串与sign字段中的签名字符串进行一致性验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "Java示例代码如下:" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "// 从Header中取出appId,timestamp,nonce,拼接成待签名的字符串" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "String rawStr = appId + timestamp + nonce;" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "// 获取验签公钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "String publicKey = \"xxxxxxxxx\";" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "// 验签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "PublicKey publicK = keyFactory.generatePublic(pkcs8KeySpec);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "signature.initVerify(key);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "signature.update(rawStr.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section205561419163916", + "text": "signature.verify(Base64.decodeBase64(sign)); // sign是Header中的字段,即请求时传递的签名" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为游戏服务器 -> 开发者服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<500ms" + ], + [ + "接口URL", + "URL由华为运营联系您获取。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section1994120406138" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "timestamp", + "是", + "String(32)", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "nonce", + "是", + "String(64)", + "随机字符串。" + ], + [ + "sign", + "是", + "String(1024)", + "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "userId", + "是", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "是", + "Integer", + "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + ], + [ + "lang", + "是", + "String(20)", + "语言,用于获取不同语言的玩家角色信息,至少需要支持zh_CN(中文)和en_US(英文)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "result", + "是", + "Integer", + "操作结果: 0:表示成功 1:验签失败 2:超时 3:业务信息错误 31:游戏号不存在 94:系统错误 95:IO错误 96:错误的url 97:错误的响应 98:参数错误 99:其他错误" + ], + [ + "roles", + "否", + "List", + "玩家角色信息,最多返回20个角色信息,按照最近登录时间倒序排序。语言版本应与请求参数中的lang参数指定的一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section163602521415" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "roleId", + "是", + "String(32)", + "角色ID。" + ], + [ + "roleName", + "是", + "String(64)", + "角色昵称。" + ], + [ + "serverId", + "否", + "String(32)", + "区服ID。若涉及多个区服可不传。" + ], + [ + "serverName", + "否", + "String(64)", + "区服名称。若涉及多个区服可不传。" + ], + [ + "avatar", + "是", + "PlayerAvatar", + "头像信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section163602521415" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "imgUrl", + "是", + "String(256)", + "头像图片的URL。头像图片支持jpg、jpeg、bmp、png格式,URL需要携带图片的后缀,并且图片地址需要https格式,例如https://test.abc.com/testPath/test.png。" + ], + [ + "updateTime", + "否", + "Long", + "头像更新时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "imgHash", + "否", + "String(64)", + "头像SHA256值。 注意 updateTime与imgHash二选一,不可都为空。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section163602521415" + } + ], + "title": "批量查询玩家角色信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:55.831Z", + "family": "gameplay", + "endpoint": "role-info" +} diff --git a/pkg/domain/reference/gameplay/role-info.parameters.json b/pkg/domain/reference/gameplay/role-info.parameters.json new file mode 100644 index 0000000..ab8b382 --- /dev/null +++ b/pkg/domain/reference/gameplay/role-info.parameters.json @@ -0,0 +1,81 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 32 + }, + { + "name": "timestamp", + "in": "header", + "type": "string", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 32 + }, + { + "name": "nonce", + "in": "header", + "type": "string", + "required": true, + "description": "随机字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 64 + }, + { + "name": "sign", + "in": "header", + "type": "string", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section192471642124115", + "maxLength": 1024 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "maxLength": 32 + }, + { + "name": "userId", + "in": "body", + "type": "string", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "type": "integer", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,用于获取不同语言的玩家角色信息,至少需要支持zh_CN(中文)和en_US(英文)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-role-info-0000002075016173#section54371514181416", + "maxLength": 20 + } +] diff --git a/pkg/domain/reference/gameplay/scores.json b/pkg/domain/reference/gameplay/scores.json new file mode 100644 index 0000000..b10aea3 --- /dev/null +++ b/pkg/domain/reference/gameplay/scores.json @@ -0,0 +1,537 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section1168614731019", + "text": "请求示例\nPOST {接口url} \nHost: xxx \nContent-Type: application/json \nheaders:\nappId: 165***568\ntimestamp: 1729479182505\nnonce: ABC***123\nsign: cnVub29i5Y********cndlcXI=\n{ \n \"appId\": \"165***568\", \n \"userId\": \"978273948ASKJHAK362\",\n \"userIdType\": 4, \n \"serverId\": \"123456\",\n \"roleId\": \"4563971\", \n \"tag\": \"1\",\n \"pageNo\": 1,\n \"pageSize\": 20\n \"lang\": \"zh_CN\" \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section239825451012", + "text": "响应示例\nHTTP/1.1 200 OK \nContent-Type: application/json;charset=UTF-8\n{\n \"result\": 0,\n \"card\": {\n \"title\": \"最近对局\",\n \"data\": {\n \"hasNext\": false,\n \"records\": [\n {\n \"profile\": \"第1名\",\n \"tagName\": \"团战模式\",\n \"result\": \"6/2/4\",\n \"hero\": {\n \"name\": \"角色名1\",\n \"idx\": \"角色图片索引1\"\n },\n \"mvp\": {\n \"name\": \"mvp资源名称\",\n \"idx\": \"mvp资源图片索引\"\n },\n \"battleTime\": 1716970989687,\n \"achievements\": [\n {\n \"name\": \"五杀\",\n \"idx\": \"五杀图片索引\"\n },\n {\n \"name\": \"超神\",\n \"idx\": \"超神图片索引\"\n }\n ]\n }\n ]\n }\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/get-public-key-0000001050164350", + "title": "获取验签公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p1617824193011", + "title": "战绩卡片信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p26732703020", + "title": "BattleRecordCard" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p748751611719", + "title": "BattleRecordCardData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p32140253327", + "title": "BattleRecord" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p1654914113312", + "title": "GameResource" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p1654914113312", + "title": "GameResource" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#ZH-CN_TOPIC_0000001985465938__zh-cn_topic_0000001937309441_p1654914113312", + "title": "GameResource" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/query-game-info-0000001050164346", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", + "title": "查询战绩筛选标签" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-asset-summary-0000002022105729", + "title": "查询资产概要" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section19331230181011", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8751936131014", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section1168614731019", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section239825451012", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section19331230181011", + "text": "华为游戏服务器调用此接口分页查询玩家在玩游戏的战绩数据,并将信息展示在游戏中心的“在玩”页面上。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "text": "Header参数" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010", + "text": "BattleRecordCard" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010", + "text": "BattleRecordCardData" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010", + "text": "BattleRecord" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010", + "text": "GameResource" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "将Header参数中的appId、timestamp、nonce字段依次拼接成一个待验签的字符串。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "对待验签字符串使用SHA256WithRSA/PSS算法进行签名。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "将签名后的字符串经过Base64编码,得到的字符串与sign字段中的签名字符串进行一致性验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "Java示例代码如下:" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "// 从Header中取出appId,timestamp,nonce,拼接成待签名的字符串" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "String rawStr = appId + timestamp + nonce;" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "// 获取验签公钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "String publicKey = \"xxxxxxxxx\";" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "// 验签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "PublicKey publicK = keyFactory.generatePublic(pkcs8KeySpec);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "signature.initVerify(key);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "signature.update(rawStr.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section205561419163916", + "text": "signature.verify(Base64.decodeBase64(sign)); // sign是Header中的字段,即请求时传递的签名" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为游戏服务器 -> 开发者服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<500ms" + ], + [ + "接口URL", + "URL由华为运营联系您获取。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8751936131014" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "timestamp", + "是", + "String(32)", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "nonce", + "是", + "String(64)", + "随机字符串。" + ], + [ + "sign", + "是", + "String(1024)", + "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "userId", + "是", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "是", + "Integer", + "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + ], + [ + "serverId", + "否", + "String(32)", + "区服ID。" + ], + [ + "roleId", + "否", + "String(32)", + "角色ID。" + ], + [ + "tag", + "否", + "String(32)", + "分类标签值。" + ], + [ + "pageNo", + "是", + "Integer", + "页码。起始页码为1。" + ], + [ + "pageSize", + "是", + "Integer", + "每页数量,默认20个,最大100个。" + ], + [ + "lang", + "是", + "String(20)", + "语言,用于获取不同语言的战绩卡片信息,至少需要支持zh_CN(中文)和en_US(英文)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "result", + "是", + "Integer", + "操作结果。 0:表示成功 1:验签失败 2:超时 3:业务信息错误 31:游戏号不存在 94:系统错误 95:IO错误 96:错误的url 97:错误的响应 98:参数错误 99:其他错误" + ], + [ + "card", + "否", + "BattleRecordCard", + "战绩卡片信息,语言版本应与请求参数中的lang参数指定的一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "title", + "是", + "String(16)", + "战绩卡片标题,例“最近30天对局”。" + ], + [ + "data", + "否", + "BattleRecordCardData", + "战绩卡片数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "hasNext", + "是", + "Boolean", + "是否还有下一页。 true:是 false:否" + ], + [ + "records", + "否", + "List", + "战绩数据。要求按照倒序时间返回战绩数据,且最多返回100组战绩数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "profile", + "是", + "String(16)", + "战局概要信息,例如:“胜利”、“第一名”。" + ], + [ + "tagName", + "否", + "String(16)", + "战局标签,例如:“团战模式”。" + ], + [ + "result", + "否", + "String(64)", + "战局成绩,例如:“6/2/4”,“3298932丨103杀”。" + ], + [ + "hero", + "是", + "GameResource", + "英雄、皮肤或角色的图片资源。" + ], + [ + "mvp", + "否", + "GameResource", + "MVP图片资源。" + ], + [ + "battleTime", + "是", + "Long", + "游戏战局毫秒级时间戳。" + ], + [ + "achievements", + "否", + "List", + "游戏成就图片资源,最多返回10张成就图片。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "name", + "是", + "String(32)", + "资源名称。" + ], + [ + "idx", + "是", + "String(128)", + "资源索引。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section4102155161010" + } + ], + "title": "分页查询玩家战绩", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:57.386Z", + "family": "gameplay", + "endpoint": "scores" +} diff --git a/pkg/domain/reference/gameplay/scores.parameters.json b/pkg/domain/reference/gameplay/scores.parameters.json new file mode 100644 index 0000000..9ae801c --- /dev/null +++ b/pkg/domain/reference/gameplay/scores.parameters.json @@ -0,0 +1,126 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 32 + }, + { + "name": "timestamp", + "in": "header", + "type": "string", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 32 + }, + { + "name": "nonce", + "in": "header", + "type": "string", + "required": true, + "description": "随机字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 64 + }, + { + "name": "sign", + "in": "header", + "type": "string", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section133671740131017", + "maxLength": 1024 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32 + }, + { + "name": "userId", + "in": "body", + "type": "string", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "type": "integer", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + }, + { + "name": "serverId", + "in": "body", + "type": "string", + "required": false, + "description": "区服ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32 + }, + { + "name": "roleId", + "in": "body", + "type": "string", + "required": false, + "description": "角色ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32 + }, + { + "name": "tag", + "in": "body", + "type": "string", + "required": false, + "description": "分类标签值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 32 + }, + { + "name": "pageNo", + "in": "body", + "type": "integer", + "required": true, + "description": "页码。起始页码为1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "minimum": 1 + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": true, + "description": "每页数量,默认20个,最大100个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maximum": 100 + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,用于获取不同语言的战绩卡片信息,至少需要支持zh_CN(中文)和en_US(英文)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-scores-0000001985465938#section8202184551317", + "maxLength": 20 + } +] diff --git a/pkg/domain/reference/gameplay/summary.json b/pkg/domain/reference/gameplay/summary.json new file mode 100644 index 0000000..e2c9869 --- /dev/null +++ b/pkg/domain/reference/gameplay/summary.json @@ -0,0 +1,545 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section1168614731019", + "text": "请求示例\nPOST {接口url} \nHost: xxx \nContent-Type: application/json\nheaders:\nappId: 165***568\ntimestamp: 1729479182505\nnonce: ABC***123\nsign: cnVub29i5Y********cndlcXI=\n{ \n \"appId\": \"165***568\",\n \"userId\": \"886***126\", \n \"userIdType\": 4, \n \"serverId\": \"123456\",\n \"roleId\": \"4563971\",\n \"lang\": \"zh_CN\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section239825451012", + "text": "响应示例\nHTTP/1.1 200 OK \nContent-Type: application/json;charset=UTF-8\n{ \n \"result\": 0,\n \"player\": {\n \"id\": \"1231231\",\n \"name\": \"小艺123\",\n \"avatar\": \"https://picture/avatar/12\",\n \"level\": {\n \"idx\": \"12\",\n \"name\": \"倔强青铜\"\n },\n \"avatarExt\": {\n \"avatarUpdateTime\": 1716973619683,\n \"avatarHash\": \"JASGHD**JAHGSDK\"\n }\n },\n \"summary\": [\n {\n \"label\": \"MVP\",\n \"value\": \"66\"\n },\n {\n \"label\": \"无尽最长\",\n \"value\": \"999\"\n }\n ],\n \"detailTabs\": [\n {\n \"title\": \"战绩\",\n \"type\": 1\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-playing-api-0000001985465934", + "title": "在玩服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/get-public-key-0000001050164350", + "title": "获取验签公钥" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#ZH-CN_TOPIC_0000002022225249__zh-cn_topic_0000001850302325_p126594146336", + "title": "统计值描述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#ZH-CN_TOPIC_0000002022225249__zh-cn_topic_0000001850302325_p26732703020", + "title": "PlayerInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#ZH-CN_TOPIC_0000002022225249__zh-cn_topic_0000001850302325_p1654914113312", + "title": "GameStatistic" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#ZH-CN_TOPIC_0000002022225249__zh-cn_topic_0000001850302325_p561311162041", + "title": "GameDetailTab" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#ZH-CN_TOPIC_0000002022225249__zh-cn_topic_0000001850302325_p3525214107", + "title": "AvatarExt" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#ZH-CN_TOPIC_0000002022225249__zh-cn_topic_0000001850302325_p32140253327", + "title": "GameLevel" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#ZH-CN_TOPIC_0000002022225249__zh-cn_topic_0000001850302325_p43721152163812", + "title": "lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/query-game-info-0000001050164346", + "title": "查询游戏服务信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resources-0000002022105725", + "title": "上传/下架游戏资源" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-label-0000001985625670", + "title": "查询战绩筛选标签" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section19331230181011", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8751936131014", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "title": "Body参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section1168614731019", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section239825451012", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "title": "验签机制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section19331230181011", + "text": "华为游戏服务器调用此接口查询玩家在玩游戏的概要数据,并将信息展示在游戏中心的“在玩”页面上。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "text": "Header参数" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010", + "text": "PlayerInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010", + "text": "AvatarExt" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010", + "text": "GameLevel" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010", + "text": "GameStatistic" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010", + "text": "GameDetailTab" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "将Header参数中的appId、timestamp、nonce字段依次拼接成一个待验签的字符串。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "对待验签字符串使用SHA256WithRSA/PSS算法进行签名。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "将签名后的字符串经过Base64编码,得到的字符串与sign字段中的签名字符串进行一致性验证。 说明 游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "游戏公钥在开通游戏服务后生成,查询方法参见查询游戏服务信息。" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "Java示例代码如下:" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "// 从Header中取出appId,timestamp,nonce,拼接成待签名的字符串" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "String rawStr = appId + timestamp + nonce;" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "// 获取验签公钥,具体实现方法由开发者自行决定,此处仅为接口示例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "String publicKey = \"xxxxxxxxx\";" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "// 验签,BouncyCastleProvider的创建较耗费性能,建议写成单例" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "byte[] keyBytes = Base64.decodeBase64(publicKey.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "PublicKey publicK = keyFactory.generatePublic(pkcs8KeySpec);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "Signature signature = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "signature.initVerify(key);" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "signature.update(rawStr.getBytes(StandardCharsets.UTF_8));" + }, + { + "section": "验签机制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section205561419163916", + "text": "signature.verify(Base64.decodeBase64(sign)); // sign是Header中的字段,即请求时传递的签名" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为游戏服务器 -> 开发者服务器" + ], + [ + "性能指标", + "TPS>500" + ], + [ + "最大响应时间", + "<500ms" + ], + [ + "接口URL", + "URL由华为运营联系您获取。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8751936131014" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "timestamp", + "是", + "String(32)", + "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "nonce", + "是", + "String(64)", + "随机字符串。" + ], + [ + "sign", + "是", + "String(1024)", + "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "appId", + "是", + "String(32)", + "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。" + ], + [ + "userId", + "是", + "String(256)", + "华为账号登录游戏后生成的玩家标识。" + ], + [ + "userIdType", + "是", + "Integer", + "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId" + ], + [ + "serverId", + "否", + "String(32)", + "区服ID。" + ], + [ + "roleId", + "否", + "String(32)", + "角色ID。" + ], + [ + "lang", + "是", + "String(20)", + "语言,用于获取不同语言的统计值描述,至少需要支持zh_CN(中文)和en_US(英文)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317" + }, + { + "location": "", + "rows": [ + [ + "参数", + "是否必选", + "类型", + "说明" + ], + [ + "result", + "是", + "Integer", + "操作结果。 0:表示成功 1:验签失败 2:超时 3:业务信息错误 31:游戏号不存在 94:系统错误 95:IO错误 96:错误的url 97:错误的响应 98:参数错误 99:其他错误" + ], + [ + "player", + "是", + "PlayerInfo", + "游戏玩家信息。" + ], + [ + "summary", + "是", + "List", + "游戏统计概要数据。最少需返回3个数据,最多支持7个。 说明 在返回的概要数据中,前3个数据会展示在游戏头卡上,其他数据在详情页展示,所有数据将根据返回的顺序进行展示。" + ], + [ + "detailTabs", + "是", + "List", + "详情Tab页。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "id", + "是", + "String(256)", + "游戏生成的玩家ID。" + ], + [ + "name", + "是", + "String(128)", + "昵称。" + ], + [ + "avatar", + "是", + "String(256)", + "头像的URL。头像图片支持jpg、jpeg、bmp、png格式,URL需要携带图片的后缀,并且图片地址需要https格式,例如https://test.abc.com/testPath/test.png。" + ], + [ + "avatarExt", + "是", + "AvatarExt", + "头像的额外信息。" + ], + [ + "level", + "否", + "GameLevel", + "游戏等级。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "avatarUpdateTime", + "否", + "Long", + "头像更新时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。" + ], + [ + "avatarHash", + "否", + "String(64)", + "头像的SHA256值。 注意 avatarUpdateTime与avatarHash二选一,不可都为空。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "idx", + "是", + "String(128)", + "游戏等级的图片资源索引,即上下架游戏资源时的上报值。" + ], + [ + "name", + "是", + "String(128)", + "等级名称。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "label", + "是", + "String(16)", + "统计值描述,语言版本应与请求参数中的lang参数指定的一致。 说明 请提前联系华为运营人员商定,例如“赛季胜利”、“MVP”、“无尽最长”等。" + ], + [ + "value", + "是", + "String(16)", + "统计值数值。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "是否必选", + "参数类型", + "描述" + ], + [ + "title", + "是", + "String(16)", + "Tab名称,用于详情页的Tab展示。" + ], + [ + "type", + "是", + "Integer", + "Tab类型: 1:战绩" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section4102155161010" + } + ], + "title": "查询游戏概要信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:58.981Z", + "family": "gameplay", + "endpoint": "summary" +} diff --git a/pkg/domain/reference/gameplay/summary.parameters.json b/pkg/domain/reference/gameplay/summary.parameters.json new file mode 100644 index 0000000..7107ee8 --- /dev/null +++ b/pkg/domain/reference/gameplay/summary.parameters.json @@ -0,0 +1,99 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 32 + }, + { + "name": "timestamp", + "in": "header", + "type": "string", + "required": true, + "description": "当前时间的时间戳,即距离GMT时间1970年1月1号0时0分0秒所差的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 32 + }, + { + "name": "nonce", + "in": "header", + "type": "string", + "required": true, + "description": "随机字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 64 + }, + { + "name": "sign", + "in": "header", + "type": "string", + "required": true, + "description": "华为服务器在发送请求时的签名字符串,生成步骤如下: 将Header参数中的appId、timestamp、nonce字段依次拼接成一个待签名的字符串。 对待签名字符串使用SHA256WithRSA/PSS算法进行签名。 将签名后的字符串经过Base64编码,得到的字符串即为签名字符串。 您需要获取验签公钥,并根据加密算法使用公钥对签名字符串进行验签,验签方法参见验签机制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section133671740131017", + "maxLength": 1024 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏在AppGallery Connect中生成的APP ID,获取方法请参见查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 32 + }, + { + "name": "userId", + "in": "body", + "type": "string", + "required": true, + "description": "华为账号登录游戏后生成的玩家标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 256 + }, + { + "name": "userIdType", + "in": "body", + "type": "integer", + "required": true, + "description": "玩家标识类型: 1:playerId 2:openId 3:unionId 4:gamePlayerId 5:teamPlayerId 6:thirdOpenId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + }, + { + "name": "serverId", + "in": "body", + "type": "string", + "required": false, + "description": "区服ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 32 + }, + { + "name": "roleId", + "in": "body", + "type": "string", + "required": false, + "description": "角色ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 32 + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言,用于获取不同语言的统计值描述,至少需要支持zh_CN(中文)和en_US(英文)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-summary-0000002022225249#section8202184551317", + "maxLength": 20 + } +] diff --git a/pkg/domain/reference/hosting/archive-version.json b/pkg/domain/reference/hosting/archive-version.json new file mode 100644 index 0000000..479d380 --- /dev/null +++ b/pkg/domain/reference/hosting/archive-version.json @@ -0,0 +1,352 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section2382162510250", + "text": "请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/merge' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNy*****************-fJtzy94ALa19DKnc' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"5-uL04_HSAW2yKRN3iKqfw\"\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section69231586289", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"OK\",\n \"siteVersion\": {\n \"version\": \"VIT6OmERQLiJREDr589mwA\",\n \"baseVersion\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"tenantId\": \"258779603740930923\",\n \"versionStatus\": \"MERGING\",\n \"fileCount\": 0,\n \"zipFileSize\": 0,\n \"sourceSize\": 0,\n \"createDate\": 1634108083587,\n \"modifyDate\": 1634108083587,\n \"expireDate\": 9223372036854775807\n }\n}\n业务失败示例\n{\n \"code\": \"VERSION.0000\",\n \"message\": \"Can not find the SiteVersion.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#ZH-CN_TOPIC_0000002743192182__table139745893119", + "title": "siteVersion" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "title": "上传版本压缩包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484", + "title": "发布版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section5230614", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section21311101523", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section0118172185314", + "title": "业务失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section125581832175310", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section15494260", + "text": "版本包上传完成后,此接口用于对新版本进行归档。如果上传的是增量版本包,云托管对基线版本和增量版本包进行合并,归档为完整的新版本文件包。归档版本是异步操作,从开始到完成,版本的状态从“MERGING”变为“FINALIZED”。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section5230614", + "text": "只有“CREATED”状态下的版本才可以进行归档版本操作。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section5230614", + "text": "当归档版本完成后,不可以再上传版本压缩包。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section25434396", + "text": "siteVersion" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n归档版本\n归档版本\n更新时间: 2026-10-23 16:56\n功能介绍\n\n版本包上传完成后,此接口用于对新版本进行归档。如果上传的是增量版本包,云托管对基线版本和增量版本包进行合并,归档为完整的新版本文件包。归档版本是异步操作,从开始到完成,版本的状态从“MERGING”变为“FINALIZED”。\n\n使用约束\n只有“CREATED”状态下的版本才可以进行归档版本操作。\n当归档版本完成后,不可以再上传版本压缩包。\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/merge\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n云托管版本所在站点ID。\n\n可根据站点名称查询站点ID,获取方法参考查询站点信息。\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n当前版本的版本号(只支持“CREATED”状态)。\n\n请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/merge' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNy*****************-fJtzy94ALa19DKnc' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"5-uL04_HSAW2yKRN3iKqfw\"\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n\n\n\nsiteVersion\n\n\t\n\nO\n\n\t\n\nsiteVersion\n\n\t\n\n站点版本。\n\nsiteVersion\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点版本号。\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\nversionStatus\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n版本状态,参考版本状态码。\n\n归档版本包含状态:“MERGING”和“FINALIZED”\n\n\n\n\nfileCount\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n包含的文件数量。\n\n\n\n\nzipFileSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\nzip压缩包大小。\n\n\n\n\nsourceSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n解压缩后的资源总大小。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本修改时间。\n\n\n\n\nexpireDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本过期时间。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"OK\",\n \"siteVersion\": {\n \"version\": \"VIT6OmERQLiJREDr589mwA\",\n \"baseVersion\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"tenantId\": \"258779603740930923\",\n \"versionStatus\": \"MERGING\",\n \"fileCount\": 0,\n \"zipFileSize\": 0,\n \"sourceSize\": 0,\n \"createDate\": 1634108083587,\n \"modifyDate\": 1634108083587,\n \"expireDate\": 9223372036854775807\n }\n}\n业务失败示例\n{\n \"code\": \"VERSION.0000\",\n \"message\": \"Can not find the SiteVersion.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n上传版本压缩包\n发布版本\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n业务失败示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/merge 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + ], + [ + "version", + "M", + "String(64)", + "当前版本的版本号(只支持“CREATED”状态)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ], + [ + "siteVersion", + "O", + "siteVersion", + "站点版本。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "version", + "M", + "String", + "站点版本号。" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "versionStatus", + "M", + "String", + "版本状态,参考版本状态码。 归档版本包含状态:“MERGING”和“FINALIZED”" + ], + [ + "fileCount", + "M", + "Integer", + "包含的文件数量。" + ], + [ + "zipFileSize", + "M", + "Integer", + "zip压缩包大小。" + ], + [ + "sourceSize", + "M", + "Integer", + "解压缩后的资源总大小。" + ], + [ + "createDate", + "M", + "Long", + "版本创建时间。" + ], + [ + "modifyDate", + "M", + "Long", + "版本修改时间。" + ], + [ + "expireDate", + "M", + "Long", + "版本过期时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section25434396" + } + ], + "title": "归档版本", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/archive-version.parameters.json b/pkg/domain/reference/hosting/archive-version.parameters.json new file mode 100644 index 0000000..02d4a9f --- /dev/null +++ b/pkg/domain/reference/hosting/archive-version.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号(只支持“CREATED”状态)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520", + "in": "body", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/archive-version.rules.json b/pkg/domain/reference/hosting/archive-version.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/archive-version.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/create-environment.json b/pkg/domain/reference/hosting/create-environment.json new file mode 100644 index 0000000..00d90b4 --- /dev/null +++ b/pkg/domain/reference/hosting/create-environment.json @@ -0,0 +1,247 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section1981222217135", + "text": "请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/environment/create' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TR*********************c1iS0Ns2yGdRA' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"environmentId\": \"dev\"\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section168171722121315", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "title": "管理环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "title": "管理环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680", + "title": "查询站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section10807102271311", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section128071622171311", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section19807422151313", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section11808112261315", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section1981222217135", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2812322121314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section168171722121315", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section3885183716427", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section98171222181312", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section10807102271311", + "text": "此接口用于创建站点环境。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section128071622171311", + "text": "无" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理环境\n创建站点环境\n创建站点环境\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于创建站点环境。\n\n使用约束\n\n无\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/site/environment/create\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点ID。\n\n\n\n\nenvironmentId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n环境ID。\n\n请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/environment/create' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TR*********************c1iS0Ns2yGdRA' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"environmentId\": \"dev\"\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n管理环境\n查询站点环境\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/site/environment/create 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section19807422151313" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "站点ID。" + ], + [ + "environmentId", + "M", + "String(64)", + "环境ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2812322121314" + } + ], + "title": "创建站点环境", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/create-environment.parameters.json b/pkg/domain/reference/hosting/create-environment.parameters.json new file mode 100644 index 0000000..8c1768b --- /dev/null +++ b/pkg/domain/reference/hosting/create-environment.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "environmentId", + "type": "string", + "required": true, + "description": "环境ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131", + "in": "body", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/create-environment.rules.json b/pkg/domain/reference/hosting/create-environment.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/create-environment.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/create-site.json b/pkg/domain/reference/hosting/create-site.json new file mode 100644 index 0000000..d2fc497 --- /dev/null +++ b/pkg/domain/reference/hosting/create-site.json @@ -0,0 +1,413 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section1981222217135", + "text": "请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/create' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1*************F13GUGkqY' \\\n--data-raw '{\n \"siteName\": \"fly\",\n \"description\": \"1.0.0\"\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section168171722121315", + "text": "响应示例\n成功示例\n{\n \"site\": {\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"fly\",\n \"tenantId\": \"401697704419908702\",\n \"totalSize\": 0,\n \"optCount\": 0,\n \"status\": 1,\n \"description\": \"1.0.0\",\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"versionCount\": 0,\n \"businessType\": 0\n },\n \"siteDomains\": [\n {\n \"domain\": \"fly.hosting-drcn.agconnect.link\",\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"fly\",\n \"tenantId\": \"401697704419908702\",\n \"domainType\": 0,\n \"bandwidth\": 0,\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"certExpireTime\": 0,\n \"businessType\": 0\n }\n ],\n \"rejected\": false,\n \"secondLevelDomainSitesCount\": 0\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "title": "管理站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#ZH-CN_TOPIC_0000002743352066__table1381252211130", + "title": "Site" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#ZH-CN_TOPIC_0000002743352066__table381622281316", + "title": "siteDomain" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "title": "管理站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section10807102271311", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section128071622171311", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section19807422151313", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section11808112261315", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section1981222217135", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2812322121314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section168171722121315", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section168171722181317", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section98171222181312", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section10807102271311", + "text": "此接口用于创建泛域名站点。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section128071622171311", + "text": "无" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2812322121314", + "text": "Site" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2812322121314", + "text": "siteDomain" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理站点\n创建站点\n创建站点\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于创建泛域名站点。\n\n使用约束\n\n无\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/site/create\n\n其中{domain}依站点区分:\n\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteName\n\n\t\n\nM\n\n\t\n\nString(30)\n\n\t\n\n站点名。\n\n\n\n\ndescription\n\n\t\n\nO\n\n\t\n\nString(1000)\n\n\t\n\n站点描述信息。\n\n请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/create' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1*************F13GUGkqY' \\\n--data-raw '{\n \"siteName\": \"fly\",\n \"description\": \"1.0.0\"\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\nsite\n\n\t\n\nO\n\n\t\n\nSite\n\n\t\n\n站点信息。\n\n\n\n\nsiteDomains\n\n\t\n\nO\n\n\t\n\nsiteDomain\n\n\t\n\n域名模型。\n\n\n\n\nrejected\n\n\t\n\nO\n\n\t\n\nBoolean\n\n\t\n\n创建站点是否被拒绝。\n\n\n\n\nsecondLevelDomainSitesCount\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n二级域名下子域名数量(泛域名忽略此字段)。\n\nSite\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\nsiteName\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点名称。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\ntotalSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n站点内版本压缩包总大小。\n\n\n\n\nstatus\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n站点状态。\n\n\n\n\ncurVersion\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n当前版本号。\n\n\n\n\ndescription\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n描述。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n修改时间。\n\n\n\n\nbusinessType\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n托管类型:0-网站托管。\n\nsiteDomain\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\ndomain\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n域名。\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\nsiteName\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点名称。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\ndomainType\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n域名类型:0-泛域名。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n修改时间。\n\n\n\n\ncertExpireTime\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n域名证书过期时间。\n\n\n\n\nbusinessType\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n托管类型:0-网站托管。\n\n响应示例\n成功示例\n{\n \"site\": {\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"fly\",\n \"tenantId\": \"401697704419908702\",\n \"totalSize\": 0,\n \"optCount\": 0,\n \"status\": 1,\n \"description\": \"1.0.0\",\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"versionCount\": 0,\n \"businessType\": 0\n },\n \"siteDomains\": [\n {\n \"domain\": \"fly.hosting-drcn.agconnect.link\",\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"fly\",\n \"tenantId\": \"401697704419908702\",\n \"domainType\": 0,\n \"bandwidth\": 0,\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"certExpireTime\": 0,\n \"businessType\": 0\n }\n ],\n \"rejected\": false,\n \"secondLevelDomainSitesCount\": 0\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n管理站点\n查询站点\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/site/create 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section19807422151313" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteName", + "M", + "String(30)", + "站点名。" + ], + [ + "description", + "O", + "String(1000)", + "站点描述信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "site", + "O", + "Site", + "站点信息。" + ], + [ + "siteDomains", + "O", + "siteDomain", + "域名模型。" + ], + [ + "rejected", + "O", + "Boolean", + "创建站点是否被拒绝。" + ], + [ + "secondLevelDomainSitesCount", + "O", + "Integer", + "二级域名下子域名数量(泛域名忽略此字段)。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2812322121314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "siteName", + "M", + "String", + "站点名称。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "totalSize", + "M", + "Integer", + "站点内版本压缩包总大小。" + ], + [ + "status", + "M", + "Integer", + "站点状态。" + ], + [ + "curVersion", + "M", + "String", + "当前版本号。" + ], + [ + "description", + "M", + "String", + "描述。" + ], + [ + "createDate", + "M", + "Long", + "创建时间。" + ], + [ + "modifyDate", + "M", + "Long", + "修改时间。" + ], + [ + "businessType", + "M", + "Integer", + "托管类型:0-网站托管。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2812322121314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "domain", + "M", + "String", + "域名。" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "siteName", + "M", + "String", + "站点名称。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "domainType", + "M", + "Integer", + "域名类型:0-泛域名。" + ], + [ + "createDate", + "M", + "Long", + "创建时间。" + ], + [ + "modifyDate", + "M", + "Long", + "修改时间。" + ], + [ + "certExpireTime", + "M", + "Long", + "域名证书过期时间。" + ], + [ + "businessType", + "M", + "Integer", + "托管类型:0-网站托管。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2812322121314" + } + ], + "title": "创建站点", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/create-site.parameters.json b/pkg/domain/reference/hosting/create-site.parameters.json new file mode 100644 index 0000000..aae1c8c --- /dev/null +++ b/pkg/domain/reference/hosting/create-site.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteName", + "type": "string", + "required": true, + "description": "站点名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131", + "in": "body", + "maxLength": 30 + }, + { + "name": "description", + "type": "string", + "required": false, + "description": "站点描述信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131", + "in": "body", + "maxLength": 1000 + } +] diff --git a/pkg/domain/reference/hosting/create-site.rules.json b/pkg/domain/reference/hosting/create-site.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/create-site.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/create-version.json b/pkg/domain/reference/hosting/create-version.json new file mode 100644 index 0000000..8af23a2 --- /dev/null +++ b/pkg/domain/reference/hosting/create-version.json @@ -0,0 +1,347 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section2382162510250", + "text": "请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/create' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFm***************FEBJWctGVEI7hU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"HdPU2XH5QJCs6uyuLI3oEg\",\n \"baseVersion\": \"j7JxSO4xSMmGUD5aan-XWg\"\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section69231586289", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"Create the siteVersion successful\",\n \"siteVersion\": {\n \"version\": \"28OWrmy7S_SXzooBUrM9uw\",\n \"baseVersion\": \"j7JxSO4xSMmGUD5aan-XWg\",\n \"siteId\": \"HdPU2XH5QJCs6uyuLI3oEg\",\n \"tenantId\": \"258779603740930923\",\n \"versionStatus\": \"CREATED\",\n \"fileCount\": 0,\n \"zipFileSize\": 0,\n \"sourceSize\": 0,\n \"createDate\": 1638343324542,\n \"modifyDate\": 1638343324542,\n \"expireDate\": 9223372036854775807\n }\n}\n业务失败示例\n{\n \"code\":\"VERSION.0000\",\n \"message\":\"Verify base siteVersion failed.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#ZH-CN_TOPIC_0000002743352060__table139745893119", + "title": "siteVersion" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867", + "title": "修改版本文件列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section64571322151915", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section1635312722618", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section19782122010308", + "title": "业务失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section189825903215", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section15494260", + "text": "此接口用于创建云托管站点版本,已归档版本可作为新版本的基线版本。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section64571322151915", + "text": "仅支持版本状态为“FINALIZED”的版本作为基线版本。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section25434396", + "text": "siteVersion" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n创建版本\n创建版本\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于创建云托管站点版本,已归档版本可作为新版本的基线版本。\n\n使用约束\n\n仅支持版本状态为“FINALIZED”的版本作为基线版本。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/create\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n云托管版本所在的站点ID。\n\n可根据站点名称查询站点ID,获取方法参考查询站点信息。\n\n\n\n\nbaseVersion\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n基线版本号,基于该版本创建新的版本。\n\n仅支持版本状态为“FINALIZED”的版本作为基线版本。\n\n请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/create' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFm***************FEBJWctGVEI7hU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"HdPU2XH5QJCs6uyuLI3oEg\",\n \"baseVersion\": \"j7JxSO4xSMmGUD5aan-XWg\"\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n\n\n\nsiteVersion\n\n\t\n\nO\n\n\t\n\nsiteVersion\n\n\t\n\n版本信息。\n\nsiteVersion\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点版本号。\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\nversionStatus\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n版本状态,参考版本状态码。\n\n创建版本包含状态:“CREATING”和“CREATED”。\n\n\n\n\nfileCount\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n包含的文件数量。\n\n\n\n\nzipFileSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\nzip压缩包大小。\n\n\n\n\nsourceSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n解压缩后的资源总大小。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本修改时间。\n\n\n\n\nexpireDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本过期时间。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"Create the siteVersion successful\",\n \"siteVersion\": {\n \"version\": \"28OWrmy7S_SXzooBUrM9uw\",\n \"baseVersion\": \"j7JxSO4xSMmGUD5aan-XWg\",\n \"siteId\": \"HdPU2XH5QJCs6uyuLI3oEg\",\n \"tenantId\": \"258779603740930923\",\n \"versionStatus\": \"CREATED\",\n \"fileCount\": 0,\n \"zipFileSize\": 0,\n \"sourceSize\": 0,\n \"createDate\": 1638343324542,\n \"modifyDate\": 1638343324542,\n \"expireDate\": 9223372036854775807\n }\n}\n业务失败示例\n{\n \"code\":\"VERSION.0000\",\n \"message\":\"Verify base siteVersion failed.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n管理版本\n修改版本文件列表\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n业务失败示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/create 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + ], + [ + "baseVersion", + "O", + "String(64)", + "基线版本号,基于该版本创建新的版本。 仅支持版本状态为“FINALIZED”的版本作为基线版本。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ], + [ + "siteVersion", + "O", + "siteVersion", + "版本信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "version", + "M", + "String", + "站点版本号。" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "versionStatus", + "M", + "String", + "版本状态,参考版本状态码。 创建版本包含状态:“CREATING”和“CREATED”。" + ], + [ + "fileCount", + "M", + "Integer", + "包含的文件数量。" + ], + [ + "zipFileSize", + "M", + "Integer", + "zip压缩包大小。" + ], + [ + "sourceSize", + "M", + "Integer", + "解压缩后的资源总大小。" + ], + [ + "createDate", + "M", + "Long", + "版本创建时间。" + ], + [ + "modifyDate", + "M", + "Long", + "版本修改时间。" + ], + [ + "expireDate", + "M", + "Long", + "版本过期时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section25434396" + } + ], + "title": "创建版本", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/create-version.parameters.json b/pkg/domain/reference/hosting/create-version.parameters.json new file mode 100644 index 0000000..e2ac698 --- /dev/null +++ b/pkg/domain/reference/hosting/create-version.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "baseVersion", + "type": "string", + "required": false, + "description": "基线版本号,基于该版本创建新的版本。 仅支持版本状态为“FINALIZED”的版本作为基线版本。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520", + "in": "body", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/create-version.rules.json b/pkg/domain/reference/hosting/create-version.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/create-version.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/delete-environment.json b/pkg/domain/reference/hosting/delete-environment.json new file mode 100644 index 0000000..95877e4 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-environment.json @@ -0,0 +1,247 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section1981222217135", + "text": "请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/environment/delete' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TRzJ*********************mtnc1iS0Ns2yGdRA' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"environmentId\": \"dev\"\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section168171722121315", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "title": "管理环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680", + "title": "查询站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section10807102271311", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section128071622171311", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section19807422151313", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section11808112261315", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section1981222217135", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2812322121314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section168171722121315", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section242541710228", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section98171222181312", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section10807102271311", + "text": "此接口用于删除站点环境。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section128071622171311", + "text": "无" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理环境\n删除站点环境\n删除站点环境\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于删除站点环境。\n\n使用约束\n\n无\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/site/environment/delete\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点ID。\n\n\n\n\nenvironmentId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n环境ID。\n\n请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/environment/delete' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TRzJ*********************mtnc1iS0Ns2yGdRA' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"environmentId\": \"dev\"\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n查询站点环境\n管理版本\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/site/environment/delete 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section19807422151313" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "站点ID。" + ], + [ + "environmentId", + "M", + "String(64)", + "环境ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2812322121314" + } + ], + "title": "删除站点环境", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/delete-environment.parameters.json b/pkg/domain/reference/hosting/delete-environment.parameters.json new file mode 100644 index 0000000..444c44b --- /dev/null +++ b/pkg/domain/reference/hosting/delete-environment.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "environmentId", + "type": "string", + "required": true, + "description": "环境ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131", + "in": "body", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/delete-environment.rules.json b/pkg/domain/reference/hosting/delete-environment.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-environment.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/delete-site.json b/pkg/domain/reference/hosting/delete-site.json new file mode 100644 index 0000000..2918542 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-site.json @@ -0,0 +1,241 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section1981222217135", + "text": "请求示例\ncurl --location --request DELETE 'https://{domain}/api/cloudhosting/web/v1/site/InNd_8w-S8uYCW_AdCCilw' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TRzJ**********************1L8GMF13GUGkqY' \\" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section168171722121315", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "title": "管理站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359", + "title": "更新站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "title": "管理环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section10807102271311", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section128071622171311", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section19807422151313", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section11808112261315", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section2809102219131", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section1981222217135", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section2812322121314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section168171722121315", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section168171722181317", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section98171222181312", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section10807102271311", + "text": "此接口用于删除站点。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section128071622171311", + "text": "删除成功后不可恢复,请谨慎操作。" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理站点\n删除站点\n删除站点\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于删除站点。\n\n使用约束\n\n删除成功后不可恢复,请谨慎操作。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS DELETE\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/site/{siteId}\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nPath\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点信息。\n\n请求示例\ncurl --location --request DELETE 'https://{domain}/api/cloudhosting/web/v1/site/InNd_8w-S8uYCW_AdCCilw' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TRzJ**********************1L8GMF13GUGkqY' \\\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":*retcode*, \"msg\": \"*description*\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n更新站点\n管理环境\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nPath\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/site/{siteId} 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section19807422151313" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "站点信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section2809102219131" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":*retcode*, \"msg\": \"*description*\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section2812322121314" + } + ], + "title": "删除站点", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/delete-site.parameters.json b/pkg/domain/reference/hosting/delete-site.parameters.json new file mode 100644 index 0000000..71c5069 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-site.parameters.json @@ -0,0 +1,54 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section2809102219131", + "in": "path", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/delete-site.rules.json b/pkg/domain/reference/hosting/delete-site.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-site.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/delete-version.json b/pkg/domain/reference/hosting/delete-version.json new file mode 100644 index 0000000..dc25a09 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-version.json @@ -0,0 +1,245 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section2382162510250", + "text": "请求示例\ncurl --location --request DELETE 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/1VPshibmSymQkRedDJvxPQ' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmc*****************89S7yAXIhRP-nU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section69231586289", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"Delete the siteVersion successful\"\n}\n业务失败示例\n{\n \"code\": \"VERSION.0000\",\n \"message\": \"Can not find the SiteVersion\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869", + "title": "查询归档版本文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section5230614", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section17512144171520", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section8289174710611", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section178361262719", + "title": "业务失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section3414151814713", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section15494260", + "text": "此接口用于删除站点下非“上线”状态的版本。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section5230614", + "text": "删除成功后不可恢复,请谨慎操作。" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n删除版本\n删除版本\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于删除站点下非“上线”状态的版本。\n\n使用约束\n\n删除成功后不可恢复,请谨慎操作。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS DELETE\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/{versionId}\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nPath\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nversionId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点版本ID。\n\n请求示例\ncurl --location --request DELETE 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/1VPshibmSymQkRedDJvxPQ' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmc*****************89S7yAXIhRP-nU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n删除结果状态,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n删除结果描述。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"Delete the siteVersion successful\"\n}\n业务失败示例\n{\n \"code\": \"VERSION.0000\",\n \"message\": \"Can not find the SiteVersion\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n查询归档版本文件\n版本状态码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nPath\n请求示例\n响应参数\n响应示例\n成功示例\n业务失败示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/{versionId} 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(64)", + "站点版本ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "删除结果状态,参考状态码。" + ], + [ + "message", + "O", + "String", + "删除结果描述。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section25434396" + } + ], + "title": "删除版本", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/delete-version.parameters.json b/pkg/domain/reference/hosting/delete-version.parameters.json new file mode 100644 index 0000000..cb60216 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-version.parameters.json @@ -0,0 +1,54 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "versionId", + "type": "string", + "required": true, + "description": "站点版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section17512144171520", + "in": "path", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/delete-version.rules.json b/pkg/domain/reference/hosting/delete-version.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/delete-version.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/list-environments.json b/pkg/domain/reference/hosting/list-environments.json new file mode 100644 index 0000000..91f20f1 --- /dev/null +++ b/pkg/domain/reference/hosting/list-environments.json @@ -0,0 +1,312 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section1981222217135", + "text": "请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/environment/query' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TRz***********************usmtnc1iS0Ns2yGdRA' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\"\n }'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section168171722121315", + "text": "响应示例\n成功示例\n{\n \"siteEnvironmentVOList\": [\n {\n \"createDate\": 1646985225634,\n \"environment\": 1,\n \"environmentId\": \"default\",\n \"modifyDate\": 1646985225634,\n \"publishStatus\": \"SANDBOX_RELEASED\",\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"status\": 0,\n \"tenantId\": \"401697704419908702\",\n \"urlList\": [\n \"hosting-lzk-test005.hosting-testkappa-hwcdn.agconnect.link/sandbox/default/index.html\"\n ],\n \"version\": \"4b0RTB9cTf6pESOPoYAZeA\"\n }\n ]\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "title": "管理环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section1839293574110", + "title": "SiteEnvironmentVO" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720", + "title": "创建站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648", + "title": "删除站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section10807102271311", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section128071622171311", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section19807422151313", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section11808112261315", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section1981222217135", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2812322121314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section1839293574110", + "title": "SiteEnvironmentVO" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section168171722121315", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section7467121112212", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section98171222181312", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section10807102271311", + "text": "此接口用于查询站点环境。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section128071622171311", + "text": "无" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理环境\n查询站点环境\n查询站点环境\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于查询站点环境。\n\n使用约束\n\n无\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/site/environment/query\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点ID。\n\n\n\n\nenvironmentId\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n环境ID。\n\n请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/environment/query' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1TRz***********************usmtnc1iS0Ns2yGdRA' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\"\n }'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\nsiteEnvironmentVOList\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n站点环境集合。\n\nSiteEnvironmentVO\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点ID。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\nenvironment\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n环境类别:\n\n0-生产。\n1-沙箱。\n\n\n\nenvironmentId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n环境ID。\n\n\n\n\npublishStatus\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n版本发布状态。\n\n\n\n\nurlList\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n沙箱访问路径。\n\n\n\n\nversion\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n环境ID已关联的版本号。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n修改时间。\n\n响应示例\n成功示例\n{\n \"siteEnvironmentVOList\": [\n {\n \"createDate\": 1646985225634,\n \"environment\": 1,\n \"environmentId\": \"default\",\n \"modifyDate\": 1646985225634,\n \"publishStatus\": \"SANDBOX_RELEASED\",\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"status\": 0,\n \"tenantId\": \"401697704419908702\",\n \"urlList\": [\n \"hosting-lzk-test005.hosting-testkappa-hwcdn.agconnect.link/sandbox/default/index.html\"\n ],\n \"version\": \"4b0RTB9cTf6pESOPoYAZeA\"\n }\n ]\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n创建站点环境\n删除站点环境\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\nSiteEnvironmentVO\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/site/environment/query 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section19807422151313" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "站点ID。" + ], + [ + "environmentId", + "O", + "String(64)", + "环境ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "siteEnvironmentVOList", + "O", + "List", + "站点环境集合。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2812322121314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "站点ID。" + ], + [ + "tenantId", + "M", + "String(64)", + "租户ID,与项目ID一致。" + ], + [ + "environment", + "M", + "Integer", + "环境类别: 0-生产。 1-沙箱。" + ], + [ + "environmentId", + "M", + "String(64)", + "环境ID。" + ], + [ + "publishStatus", + "O", + "Integer", + "版本发布状态。" + ], + [ + "urlList", + "O", + "List", + "沙箱访问路径。" + ], + [ + "version", + "O", + "String(64)", + "环境ID已关联的版本号。" + ], + [ + "createDate", + "M", + "Long", + "创建时间。" + ], + [ + "modifyDate", + "M", + "Long", + "修改时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section1839293574110" + } + ], + "title": "查询站点环境", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/list-environments.parameters.json b/pkg/domain/reference/hosting/list-environments.parameters.json new file mode 100644 index 0000000..3a61380 --- /dev/null +++ b/pkg/domain/reference/hosting/list-environments.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "environmentId", + "type": "string", + "required": false, + "description": "环境ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131", + "in": "body", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/list-environments.rules.json b/pkg/domain/reference/hosting/list-environments.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/list-environments.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/list-sites.json b/pkg/domain/reference/hosting/list-sites.json new file mode 100644 index 0000000..6922004 --- /dev/null +++ b/pkg/domain/reference/hosting/list-sites.json @@ -0,0 +1,434 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section1981222217135", + "text": "请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/query' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1T*****************GMF13GUGkqY' \\\n--data-raw '{\n \"site\": {\n \"siteName\": \"fly\"\n },\n \"pageInfo\": {\n \"queryIndex\": 0,\n \"querySize\": 10\n }\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section168171722121315", + "text": "响应示例\n成功示例\n{\n \"sites\": [\n {\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"fly\",\n \"tenantId\": \"401697704419908702\",\n \"totalSize\": 0,\n \"optCount\": 0,\n \"status\": 1,\n \"description\": \"1.0.0\",\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"siteDomains\": [\n {\n \"domain\": \"fly.hosting-drcn.agconnect.link\",\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"hosting-lzk-test005\",\n \"tenantId\": \"401697704419908702\",\n \"domainType\": 0,\n \"bandwidth\": 0,\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"certExpireTime\": 0,\n \"businessType\": 0\n }\n ],\n \"versionCount\": 0,\n \"cleanSuffix\": 0,\n \"businessType\": 0\n }\n ],\n \"pageInfo\": {\n \"queryIndex\": 0,\n \"querySize\": 10,\n \"totalSize\": 1\n },\n \"siteVersionMaxCount\": 100\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "title": "管理站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#ZH-CN_TOPIC_0000002743352068__table8810132231316", + "title": "site" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#ZH-CN_TOPIC_0000002743352068__table9811112215136", + "title": "pageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#ZH-CN_TOPIC_0000002743352068__table78131522101318", + "title": "Site" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#ZH-CN_TOPIC_0000002743352068__table381622281316", + "title": "pageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466", + "title": "创建站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359", + "title": "更新站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section10807102271311", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section128071622171311", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section19807422151313", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section11808112261315", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section1981222217135", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2812322121314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section168171722121315", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section168171722181317", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section98171222181312", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section10807102271311", + "text": "此接口用于通过站点部分信息查询站点其他信息,例如通过站点名称查询站点ID。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section128071622171311", + "text": "无" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "text": "site" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "text": "pageInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2812322121314", + "text": "Site" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理站点\n查询站点\n查询站点\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于通过站点部分信息查询站点其他信息,例如通过站点名称查询站点ID。\n\n使用约束\n\n无\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/site/query\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsite\n\n\t\n\nM\n\n\t\n\nsite\n\n\t\n\n站点信息。\n\n\n\n\npageInfo\n\n\t\n\nO\n\n\t\n\npageInfo\n\n\t\n\n分页模型。\n\nsite\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteName\n\n\t\n\nO\n\n\t\n\nString(63)\n\n\t\n\n站点名称。\n\n可通过云托管站点名称查询站点完整信息。\n\n\n\n\nsiteId\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n站点ID。\n\n\n\n\ntenantId\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n租户ID,与项目ID一致。\n\npageInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nqueryIndex\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n索引查询,默认值为0。\n\n\n\n\nquerySize\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n每页查询数量。默认值为1000,最大值为1000\n\n请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/query' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1T*****************GMF13GUGkqY' \\\n--data-raw '{\n \"site\": {\n \"siteName\": \"fly\"\n },\n \"pageInfo\": {\n \"queryIndex\": 0,\n \"querySize\": 10\n }\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\nsites\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n站点信息集合。\n\n\n\n\npageInfo\n\n\t\n\nO\n\n\t\n\npageInfo\n\n\t\n\n分页模型。\n\n\n\n\nsiteVersionMaxCount\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n每个站点最大版本数量。默认值为100。\n\nSite\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\nsiteName\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点名称。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\ntotalSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n站点内版本解压后总大小。\n\n\n\n\nstatus\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n站点状态。\n\n\n\n\ncurVersion\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n当前版本号。\n\n\n\n\ndescription\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n描述。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n修改时间。\n\npageInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nqueryIndex\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n索引查询,默认值为0。\n\n\n\n\nquerySize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n每页数量,默认为1000,最大值为1000。\n\n\n\n\ntotalSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n总记录数。\n\n响应示例\n成功示例\n{\n \"sites\": [\n {\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"fly\",\n \"tenantId\": \"401697704419908702\",\n \"totalSize\": 0,\n \"optCount\": 0,\n \"status\": 1,\n \"description\": \"1.0.0\",\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"siteDomains\": [\n {\n \"domain\": \"fly.hosting-drcn.agconnect.link\",\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"siteName\": \"hosting-lzk-test005\",\n \"tenantId\": \"401697704419908702\",\n \"domainType\": 0,\n \"bandwidth\": 0,\n \"createDate\": 1646901458642,\n \"modifyDate\": 1646901458642,\n \"certExpireTime\": 0,\n \"businessType\": 0\n }\n ],\n \"versionCount\": 0,\n \"cleanSuffix\": 0,\n \"businessType\": 0\n }\n ],\n \"pageInfo\": {\n \"queryIndex\": 0,\n \"querySize\": 10,\n \"totalSize\": 1\n },\n \"siteVersionMaxCount\": 100\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n创建站点\n更新站点\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/site/query 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section19807422151313" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "site", + "M", + "site", + "站点信息。" + ], + [ + "pageInfo", + "O", + "pageInfo", + "分页模型。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteName", + "O", + "String(63)", + "站点名称。 可通过云托管站点名称查询站点完整信息。" + ], + [ + "siteId", + "O", + "String(64)", + "站点ID。" + ], + [ + "tenantId", + "O", + "String(64)", + "租户ID,与项目ID一致。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "queryIndex", + "O", + "Integer", + "索引查询,默认值为0。" + ], + [ + "querySize", + "O", + "Integer", + "每页查询数量。默认值为1000,最大值为1000" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "sites", + "O", + "List", + "站点信息集合。" + ], + [ + "pageInfo", + "O", + "pageInfo", + "分页模型。" + ], + [ + "siteVersionMaxCount", + "O", + "Integer", + "每个站点最大版本数量。默认值为100。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2812322121314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "siteName", + "M", + "String", + "站点名称。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "totalSize", + "M", + "Integer", + "站点内版本解压后总大小。" + ], + [ + "status", + "M", + "Integer", + "站点状态。" + ], + [ + "curVersion", + "M", + "String", + "当前版本号。" + ], + [ + "description", + "M", + "String", + "描述。" + ], + [ + "createDate", + "M", + "Long", + "创建时间。" + ], + [ + "modifyDate", + "M", + "Long", + "修改时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2812322121314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "queryIndex", + "M", + "Integer", + "索引查询,默认值为0。" + ], + [ + "querySize", + "M", + "Integer", + "每页数量,默认为1000,最大值为1000。" + ], + [ + "totalSize", + "M", + "Integer", + "总记录数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2812322121314" + } + ], + "title": "查询站点", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/list-sites.parameters.json b/pkg/domain/reference/hosting/list-sites.parameters.json new file mode 100644 index 0000000..7bb437b --- /dev/null +++ b/pkg/domain/reference/hosting/list-sites.parameters.json @@ -0,0 +1,109 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "site", + "type": "object", + "required": true, + "description": "站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "properties": [ + { + "name": "siteName", + "type": "string", + "required": false, + "description": "站点名称。 可通过云托管站点名称查询站点完整信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maxLength": 63 + }, + { + "name": "siteId", + "type": "string", + "required": false, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "tenantId", + "type": "string", + "required": false, + "description": "租户ID,与项目ID一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "name": "pageInfo", + "type": "object", + "required": false, + "description": "分页模型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "properties": [ + { + "name": "queryIndex", + "type": "integer", + "required": false, + "description": "索引查询,默认值为0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body" + }, + { + "name": "querySize", + "type": "integer", + "required": false, + "description": "每页查询数量。默认值为1000,最大值为1000", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maximum": 1000 + } + ] + } +] diff --git a/pkg/domain/reference/hosting/list-sites.rules.json b/pkg/domain/reference/hosting/list-sites.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/list-sites.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/list-version-files.json b/pkg/domain/reference/hosting/list-version-files.json new file mode 100644 index 0000000..bd776c8 --- /dev/null +++ b/pkg/domain/reference/hosting/list-version-files.json @@ -0,0 +1,368 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section2382162510250", + "text": "请求示例\ncurl --location --request POST 'https://10.31.26.167:18062/api/cloudhosting/web/v1/version/queryFiles' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUj*******************9889S7yAXIhRP-nU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\":\"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"1VPshibmSymQkRedDJvxPQ\",\n \"pageInfo\":{\n \"queryIndex\":0,\n \"querySize\":100\n }\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section69231586289", + "text": "响应示例\n成功示例\n{\n \"pageInfo\": {\n \"queryIndex\": 0,\n \"querySize\": 10,\n \"totalSize\": 4\n },\n \"versionFileMetataList\": [\n {\n \"filePath\": \"/css/move.css\",\n \"fileSha256\": \"ea50caa661c30cbe614e0571a5ef2778e2ccfd0e0fbf8168570c781c81241127\",\n \"fileSize\": 0\n },\n {\n \"filePath\": \"/index.html\",\n \"fileSha256\": \"7ba3327dce84a80f373b69a58de2b95f7245237ece6c784ea79dc6b149c9190e\",\n \"fileSize\": 0\n },\n {\n \"filePath\": \"/js/dot.js\",\n \"fileSha256\": \"5a3dc75a7acbda6e5afb1c91e55e0d2f061de9bdcd1a7141c662805de8967740\",\n \"fileSize\": 0\n },\n {\n \"filePath\": \"/js/raffle2.js\",\n \"fileSha256\": \"42acaaeea9382e678380b5a2b8dbe433fce3100c07caa30f65c1e2489604e165\",\n \"fileSize\": 0\n }\n ],\n \"code\": \"0\",\n \"message\": \"success to query version files\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#ZH-CN_TOPIC_0000002743352064__table4808103772018", + "title": "pageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#ZH-CN_TOPIC_0000002743352064__table0913114153220", + "title": "VersionFileMetata" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#ZH-CN_TOPIC_0000002743352064__table1527212065616", + "title": "pageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920", + "title": "查询版本列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944", + "title": "删除版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section5230614", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section1961417391324", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section224505812316", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section15494260", + "text": "此接口用于查询已归档版本的归档文件信息,为创建和修改版本提供基线版本内容的查询。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section5230614", + "text": "仅支持对一个月内已归档的版本进行查询。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "text": "pageInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section25434396", + "text": "VersionFileMetata" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n查询归档版本文件\n查询归档版本文件\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于查询已归档版本的归档文件信息,为创建和修改版本提供基线版本内容的查询。\n\n使用约束\n\n仅支持对一个月内已归档的版本进行查询。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/queryFiles\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n云托管版本所在站点ID。\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点版本ID。\n\n\n\n\npageInfo\n\n\t\n\nM\n\n\t\n\npageInfo\n\n\t\n\n分页模型。\n\npageInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nqueryIndex\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n索引查询,默认值为0。\n\n\n\n\nquerySize\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n每页查询数量,默认值为1000,最大值为1000。\n\n请求示例\ncurl --location --request POST 'https://10.31.26.167:18062/api/cloudhosting/web/v1/version/queryFiles' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUj*******************9889S7yAXIhRP-nU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\":\"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"1VPshibmSymQkRedDJvxPQ\",\n \"pageInfo\":{\n \"queryIndex\":0,\n \"querySize\":100\n }\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n查询结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n查询结果描述。\n\n\n\n\nversionFileMetataList\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n版本文件列表。\n\n\n\n\npageInfo\n\n\t\n\nO\n\n\t\n\npageInfo\n\n\t\n\n分页模型。\n\nVersionFileMetata\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nfilePath\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n版本文件的绝对路径。\n\n\n\n\nfileSha256\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n版本文件的Hash值。\n\npageInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nqueryIndex\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n索引查询,默认值为0。\n\n\n\n\nquerySize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n每页数量,默认为1000,最大值为1000。\n\n\n\n\ntotalSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n总记录数。\n\n响应示例\n成功示例\n{\n \"pageInfo\": {\n \"queryIndex\": 0,\n \"querySize\": 10,\n \"totalSize\": 4\n },\n \"versionFileMetataList\": [\n {\n \"filePath\": \"/css/move.css\",\n \"fileSha256\": \"ea50caa661c30cbe614e0571a5ef2778e2ccfd0e0fbf8168570c781c81241127\",\n \"fileSize\": 0\n },\n {\n \"filePath\": \"/index.html\",\n \"fileSha256\": \"7ba3327dce84a80f373b69a58de2b95f7245237ece6c784ea79dc6b149c9190e\",\n \"fileSize\": 0\n },\n {\n \"filePath\": \"/js/dot.js\",\n \"fileSha256\": \"5a3dc75a7acbda6e5afb1c91e55e0d2f061de9bdcd1a7141c662805de8967740\",\n \"fileSize\": 0\n },\n {\n \"filePath\": \"/js/raffle2.js\",\n \"fileSha256\": \"42acaaeea9382e678380b5a2b8dbe433fce3100c07caa30f65c1e2489604e165\",\n \"fileSize\": 0\n }\n ],\n \"code\": \"0\",\n \"message\": \"success to query version files\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n查询版本列表\n删除版本\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/queryFiles 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "云托管版本所在站点ID。" + ], + [ + "version", + "M", + "String(64)", + "站点版本ID。" + ], + [ + "pageInfo", + "M", + "pageInfo", + "分页模型。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "queryIndex", + "O", + "Integer", + "索引查询,默认值为0。" + ], + [ + "querySize", + "O", + "Integer", + "每页查询数量,默认值为1000,最大值为1000。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "查询结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "查询结果描述。" + ], + [ + "versionFileMetataList", + "O", + "List", + "版本文件列表。" + ], + [ + "pageInfo", + "O", + "pageInfo", + "分页模型。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "filePath", + "M", + "String", + "版本文件的绝对路径。" + ], + [ + "fileSha256", + "M", + "String", + "版本文件的Hash值。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "queryIndex", + "M", + "Integer", + "索引查询,默认值为0。" + ], + [ + "querySize", + "M", + "Integer", + "每页数量,默认为1000,最大值为1000。" + ], + [ + "totalSize", + "M", + "Integer", + "总记录数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section25434396" + } + ], + "title": "查询归档版本文件", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/list-version-files.parameters.json b/pkg/domain/reference/hosting/list-version-files.parameters.json new file mode 100644 index 0000000..6a3b600 --- /dev/null +++ b/pkg/domain/reference/hosting/list-version-files.parameters.json @@ -0,0 +1,90 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "站点版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "pageInfo", + "type": "object", + "required": true, + "description": "分页模型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "properties": [ + { + "name": "queryIndex", + "type": "integer", + "required": false, + "description": "索引查询,默认值为0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body" + }, + { + "name": "querySize", + "type": "integer", + "required": false, + "description": "每页查询数量,默认值为1000,最大值为1000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "maximum": 1000 + } + ] + } +] diff --git a/pkg/domain/reference/hosting/list-version-files.rules.json b/pkg/domain/reference/hosting/list-version-files.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/list-version-files.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/list-versions.json b/pkg/domain/reference/hosting/list-versions.json new file mode 100644 index 0000000..2d2ddd6 --- /dev/null +++ b/pkg/domain/reference/hosting/list-versions.json @@ -0,0 +1,416 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section2382162510250", + "text": "请求示例\ncurl --location --request POST 'https://10.31.26.167:18062/api/cloudhosting/web/v1/version/query' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmcHJ******************6pCcot18k5MDYE5vzY' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"version\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\":\"KCM647QqTvyk7AqvH49jqQ\"\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section69231586289", + "text": "响应示例\n成功示例\n{\n \"siteVersionList\": [\n {\n \"version\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"tenantId\": \"258779603740930923\",\n \"materialId\": \"v7qwdOzTSpGJTU0Ufb--aw\",\n \"metadataMaterialId\": \"na4XUrvvQtWEWt1AxiZaDw\",\n \"description\": \"\",\n \"versionStatus\": \"FINALIZED\",\n \"fileCount\": 10,\n \"zipFileSize\": 46365,\n \"sourceSize\": 143961,\n \"storageDir\": \"pub_9/hosting_OnlineVersion_904_9/8f/v3/dAFwm6XBSbyv9FcP3RGHiQ/neilS1WrRXqTsaiP1tsw_g/\",\n \"storageHost\": \"\",\n \"sandboxUrlPrefix\": \"xasaxas.***********.link/sandbox/28OWrmy7S_SXzooBUrM9uw/oC9OBUmTRJa2k4WVTs5kqg\",\n \"createDate\": 1633938240092,\n \"modifyDate\": 1633938242785,\n \"expireDate\": 9223372036854775807,\n \"siteVersionPublishList\": [\n {\n \"tenantId\": \"258779603740930923\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"environment\": 1,\n \"publishStatus\": \"SANDBOX_RELEASED\",\n \"mappingKey\": \"xasaxas.***********.link/sandbox/28OWrmy7S_SXzooBUrM9uw/oC9OBUmTRJa2k4WVTs5kqg\",\n \"createDate\": 1638349283920,\n \"modifyDate\": 1638349287554\n }\n ],\n }\n ]\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#ZH-CN_TOPIC_0000002743192176__table139745893119", + "title": "SiteVersion" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#ZH-CN_TOPIC_0000002743192176__p2213164919103", + "title": "SiteVersionPublish" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releasecode-0000001229838565", + "title": "发布状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484", + "title": "发布版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869", + "title": "查询归档版本文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section348619403016", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section55090117113", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section15494260", + "text": "此接口用于查询云托管站点下的版本列表。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section25434396", + "text": "SiteVersion" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section25434396", + "text": "SiteVersionPublish" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n查询版本列表\n查询版本列表\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于查询云托管站点下的版本列表。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/query\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n云托管版本所在站点ID。\n\n\n\n\ntenantId\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\nversion\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n版本ID。\n\n\n\n\nversionStatus\n\n\t\n\nO\n\n\t\n\nString(64)\n\n\t\n\n版本状态,参考版本状态码。\n\n请求示例\ncurl --location --request POST 'https://10.31.26.167:18062/api/cloudhosting/web/v1/version/query' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmcHJ******************6pCcot18k5MDYE5vzY' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"version\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\":\"KCM647QqTvyk7AqvH49jqQ\"\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\nsiteVersionList\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n版本信息集合。\n\nSiteVersion\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点版本号。\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\nversionStatus\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n版本状态,参考版本状态码。\n\n\n\n\nfileCount\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n包含的文件数量。\n\n\n\n\nzipFileSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\nzip压缩包大小。\n\n\n\n\nsourceSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n解压缩后的资源总大小。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nlong\n\n\t\n\n版本创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nlong\n\n\t\n\n版本修改时间。\n\n\n\n\nexpireDate\n\n\t\n\nM\n\n\t\n\nlong\n\n\t\n\n版本过期时间。\n\n\n\n\nsandboxUrlPrefix\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n沙箱版本访问前缀。\n\n\n\n\nsiteVersionPublishList\n\n\t\n\nM\n\n\t\n\nSiteVersionPublish\n\n\t\n\n版本发布信息。\n\nSiteVersionPublish\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点版本号。\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\npublishStatus\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n版本发布状态,参考发布状态码。\n\n\n\n\nenvironment\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n发布环境类型。\n\n0:生产\n1:沙箱\n\n\n\nmappingKey\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nzip压缩包大小。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nlong\n\n\t\n\n版本发布创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nlong\n\n\t\n\n版本发布修改时间。\n\n响应示例\n成功示例\n{\n \"siteVersionList\": [\n {\n \"version\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"tenantId\": \"258779603740930923\",\n \"materialId\": \"v7qwdOzTSpGJTU0Ufb--aw\",\n \"metadataMaterialId\": \"na4XUrvvQtWEWt1AxiZaDw\",\n \"description\": \"\",\n \"versionStatus\": \"FINALIZED\",\n \"fileCount\": 10,\n \"zipFileSize\": 46365,\n \"sourceSize\": 143961,\n \"storageDir\": \"pub_9/hosting_OnlineVersion_904_9/8f/v3/dAFwm6XBSbyv9FcP3RGHiQ/neilS1WrRXqTsaiP1tsw_g/\",\n \"storageHost\": \"\",\n \"sandboxUrlPrefix\": \"xasaxas.***********.link/sandbox/28OWrmy7S_SXzooBUrM9uw/oC9OBUmTRJa2k4WVTs5kqg\",\n \"createDate\": 1633938240092,\n \"modifyDate\": 1633938242785,\n \"expireDate\": 9223372036854775807,\n \"siteVersionPublishList\": [\n {\n \"tenantId\": \"258779603740930923\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"environment\": 1,\n \"publishStatus\": \"SANDBOX_RELEASED\",\n \"mappingKey\": \"xasaxas.***********.link/sandbox/28OWrmy7S_SXzooBUrM9uw/oC9OBUmTRJa2k4WVTs5kqg\",\n \"createDate\": 1638349283920,\n \"modifyDate\": 1638349287554\n }\n ],\n }\n ]\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n发布版本\n查询归档版本文件\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/query 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "O", + "String(64)", + "云托管版本所在站点ID。" + ], + [ + "tenantId", + "O", + "String(64)", + "租户ID,与项目ID一致。" + ], + [ + "version", + "O", + "String(64)", + "版本ID。" + ], + [ + "versionStatus", + "O", + "String(64)", + "版本状态,参考版本状态码。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "siteVersionList", + "O", + "List", + "版本信息集合。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "version", + "M", + "String", + "站点版本号。" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "versionStatus", + "M", + "String", + "版本状态,参考版本状态码。" + ], + [ + "fileCount", + "M", + "Integer", + "包含的文件数量。" + ], + [ + "zipFileSize", + "M", + "Integer", + "zip压缩包大小。" + ], + [ + "sourceSize", + "M", + "Integer", + "解压缩后的资源总大小。" + ], + [ + "createDate", + "M", + "long", + "版本创建时间。" + ], + [ + "modifyDate", + "M", + "long", + "版本修改时间。" + ], + [ + "expireDate", + "M", + "long", + "版本过期时间。" + ], + [ + "sandboxUrlPrefix", + "M", + "String", + "沙箱版本访问前缀。" + ], + [ + "siteVersionPublishList", + "M", + "SiteVersionPublish", + "版本发布信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "version", + "M", + "String", + "站点版本号。" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "publishStatus", + "M", + "String", + "版本发布状态,参考发布状态码。" + ], + [ + "environment", + "M", + "Integer", + "发布环境类型。 0:生产 1:沙箱" + ], + [ + "mappingKey", + "M", + "String", + "zip压缩包大小。" + ], + [ + "createDate", + "M", + "long", + "版本发布创建时间。" + ], + [ + "modifyDate", + "M", + "long", + "版本发布修改时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section25434396" + } + ], + "title": "查询版本列表", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/list-versions.parameters.json b/pkg/domain/reference/hosting/list-versions.parameters.json new file mode 100644 index 0000000..eeb705b --- /dev/null +++ b/pkg/domain/reference/hosting/list-versions.parameters.json @@ -0,0 +1,81 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": false, + "description": "云托管版本所在站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "tenantId", + "type": "string", + "required": false, + "description": "租户ID,与项目ID一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": false, + "description": "版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "versionStatus", + "type": "string", + "required": false, + "description": "版本状态,参考版本状态码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/hosting/list-versions.rules.json b/pkg/domain/reference/hosting/list-versions.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/list-versions.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/modify-files.json b/pkg/domain/reference/hosting/modify-files.json new file mode 100644 index 0000000..6f45efe --- /dev/null +++ b/pkg/domain/reference/hosting/modify-files.json @@ -0,0 +1,279 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section2382162510250", + "text": "请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/modifyFilelist' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyU************FEBJWctGVEI7hU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"VIT6OmERQLiJREDr589mwA\",\n \"deleteFiles\": [\n \"/js/abc.js\"\n ]\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section69231586289", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"OK\"\n}\n业务失败示例\n{\n \"code\":\"VERSION.0005\",\n \"message\":\"Invalid version status.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-restversion-0000001166577876#section62275462013", + "title": "删除版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-restversion-0000001166577876#section1547061019390", + "title": "创建版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196", + "title": "创建版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section1545363414017", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section143608811142", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section393444915335", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17845125193717", + "title": "业务失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section286515301383", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section15494260", + "text": "此接口用于对基线版本需要删除的文件做版本修改,标记需要删除文件的绝对路径,在归档版本时处理文件。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section1545363414017", + "text": "如果您的新版本是全新版本(未基于基线版本创建),或者基线版本内没有需要删除的版本文件,不需要调用该接口。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section1545363414017", + "text": "当新版本的版本状态为“CREATED”时,可调用该接口。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section1545363414017", + "text": "可多次标记基线版本文件,基线版本文件一旦标记为“待删除”,无法撤销和回退,需要删除版本后重新创建版本。" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n修改版本文件列表\n修改版本文件列表\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于对基线版本需要删除的文件做版本修改,标记需要删除文件的绝对路径,在归档版本时处理文件。\n\n使用约束\n如果您的新版本是全新版本(未基于基线版本创建),或者基线版本内没有需要删除的版本文件,不需要调用该接口。\n当新版本的版本状态为“CREATED”时,可调用该接口。\n可多次标记基线版本文件,基线版本文件一旦标记为“待删除”,无法撤销和回退,需要删除版本后重新创建版本。\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/modifyFilelist\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n云托管站点版本所在的站点ID。\n\n可根据站点名称查询站点ID,获取方法参考查询站点信息。\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n当前版本的版本号(仅支持版本状态为“CREATED”的版本)。\n\n\n\n\ndeleteFiles\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\n需要删除的文件列表(文件的绝对路径),一次最多删除1000个。\n\n请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/modifyFilelist' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyU************FEBJWctGVEI7hU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"VIT6OmERQLiJREDr589mwA\",\n \"deleteFiles\": [\n \"/js/abc.js\"\n ]\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n修改结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n修改结果描述。\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"OK\"\n}\n业务失败示例\n{\n \"code\":\"VERSION.0005\",\n \"message\":\"Invalid version status.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n创建版本\n获取版本压缩包上传地址\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n业务失败示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/modifyFilelist 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "云托管站点版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + ], + [ + "version", + "M", + "String(64)", + "当前版本的版本号(仅支持版本状态为“CREATED”的版本)。" + ], + [ + "deleteFiles", + "M", + "List", + "需要删除的文件列表(文件的绝对路径),一次最多删除1000个。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "String", + "修改结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "修改结果描述。" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section25434396" + } + ], + "title": "修改版本文件列表", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/modify-files.parameters.json b/pkg/domain/reference/hosting/modify-files.parameters.json new file mode 100644 index 0000000..4b11915 --- /dev/null +++ b/pkg/domain/reference/hosting/modify-files.parameters.json @@ -0,0 +1,73 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管站点版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号(仅支持版本状态为“CREATED”的版本)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "deleteFiles", + "type": "array", + "required": true, + "description": "需要删除的文件列表(文件的绝对路径),一次最多删除1000个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "in": "body", + "itemsType": "string", + "maxItems": 1000 + } +] diff --git a/pkg/domain/reference/hosting/modify-files.rules.json b/pkg/domain/reference/hosting/modify-files.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/modify-files.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/release-version.json b/pkg/domain/reference/hosting/release-version.json new file mode 100644 index 0000000..86176fc --- /dev/null +++ b/pkg/domain/reference/hosting/release-version.json @@ -0,0 +1,364 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section2382162510250", + "text": "请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/release' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmcH****************-fJtzy94ALa19DKnc' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"5-uL04_HSAW2yKRN3iKqfw\",\n \"environment\": 0\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section69231586289", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"The xxxx version is being released.\",\n \"siteVersion\": {\n \"version\": \"VIT6OmERQLiJREDr589mwA\",\n \"baseVersion\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"tenantId\": \"258779603740930923\",\n \"versionStatus\": \"FINALIZED\",\n \"lastPublishStatus\": \"SANDBOX_RELEASING\",\n \"fileCount\": 0,\n \"zipFileSize\": 0,\n \"sourceSize\": 0,\n \"createDate\": 1634108083587,\n \"modifyDate\": 1634108083587,\n \"expireDate\": 9223372036854775807\n }\n}\n业务失败示例\n{\n \"code\": \"VERSION.0009\",\n \"message\": \"Versions can be released only when they are offline.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#ZH-CN_TOPIC_0000002772871313__table139745893119", + "title": "siteVersion" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385", + "title": "归档版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920", + "title": "查询版本列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section5230614", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section067350145511", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section2941239205611", + "title": "业务失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section14357111112576", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section15494260", + "text": "此接口用于发布新版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section15494260", + "text": "归档后的版本可以发布到沙箱环境或者生产环境,每个站点只能有一个生产在线版本,每个版本只能发布到生产或者沙箱环境。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section5230614", + "text": "仅当版本状态为“FINALIZED”时,支持版本发布。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section25434396", + "text": "siteVersion" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n发布版本\n发布版本\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于发布新版本。\n\n归档后的版本可以发布到沙箱环境或者生产环境,每个站点只能有一个生产在线版本,每个版本只能发布到生产或者沙箱环境。\n\n使用约束\n\n仅当版本状态为“FINALIZED”时,支持版本发布。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/release\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n云托管版本所在站点ID。\n\n可根据站点名称查询站点ID,获取方法参考查询站点信息。\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n当前版本的版本号。\n\n\n\n\nenvironment\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n发布环境类型。\n\n0:生产\n1:沙箱\n请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/release' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmcH****************-fJtzy94ALa19DKnc' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"5-uL04_HSAW2yKRN3iKqfw\",\n \"environment\": 0\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n\n\n\nsiteVersion\n\n\t\n\nO\n\n\t\n\nsiteVersion\n\n\t\n\n站点版本信息,沙箱发布时响应该字段。\n\nsiteVersion\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点版本号。\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n站点ID。\n\n\n\n\ntenantId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n租户ID,与项目ID一致。\n\n\n\n\nversionStatus\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n版本状态,参考版本状态码。\n\n\n\n\nlastPublishStatus\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n发布状态。\n\n沙箱发布时响应:“SANDBOX_RELEASING”\n\n\n\n\nfileCount\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n包含的文件数量。\n\n\n\n\nzipFileSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\nzip压缩包大小。\n\n\n\n\nsourceSize\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n解压缩后的资源总大小。\n\n\n\n\ncreateDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本创建时间。\n\n\n\n\nmodifyDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本修改时间。\n\n\n\n\nexpireDate\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n版本过期时间。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"The xxxx version is being released.\",\n \"siteVersion\": {\n \"version\": \"VIT6OmERQLiJREDr589mwA\",\n \"baseVersion\": \"dAFwm6XBSbyv9FcP3RGHiQ\",\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"tenantId\": \"258779603740930923\",\n \"versionStatus\": \"FINALIZED\",\n \"lastPublishStatus\": \"SANDBOX_RELEASING\",\n \"fileCount\": 0,\n \"zipFileSize\": 0,\n \"sourceSize\": 0,\n \"createDate\": 1634108083587,\n \"modifyDate\": 1634108083587,\n \"expireDate\": 9223372036854775807\n }\n}\n业务失败示例\n{\n \"code\": \"VERSION.0009\",\n \"message\": \"Versions can be released only when they are offline.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n归档版本\n查询版本列表\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n业务失败示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/release 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + ], + [ + "version", + "M", + "String(64)", + "当前版本的版本号。" + ], + [ + "environment", + "M", + "Integer", + "发布环境类型。 0:生产 1:沙箱" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ], + [ + "siteVersion", + "O", + "siteVersion", + "站点版本信息,沙箱发布时响应该字段。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "version", + "M", + "String", + "站点版本号。" + ], + [ + "siteId", + "M", + "String", + "站点ID。" + ], + [ + "tenantId", + "M", + "String", + "租户ID,与项目ID一致。" + ], + [ + "versionStatus", + "M", + "String", + "版本状态,参考版本状态码。" + ], + [ + "lastPublishStatus", + "M", + "String", + "发布状态。 沙箱发布时响应:“SANDBOX_RELEASING”" + ], + [ + "fileCount", + "M", + "Integer", + "包含的文件数量。" + ], + [ + "zipFileSize", + "M", + "Integer", + "zip压缩包大小。" + ], + [ + "sourceSize", + "M", + "Integer", + "解压缩后的资源总大小。" + ], + [ + "createDate", + "M", + "Long", + "版本创建时间。" + ], + [ + "modifyDate", + "M", + "Long", + "版本修改时间。" + ], + [ + "expireDate", + "M", + "Long", + "版本过期时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section25434396" + } + ], + "title": "发布版本", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/release-version.parameters.json b/pkg/domain/reference/hosting/release-version.parameters.json new file mode 100644 index 0000000..72d7d10 --- /dev/null +++ b/pkg/domain/reference/hosting/release-version.parameters.json @@ -0,0 +1,75 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "environment", + "type": "integer", + "required": true, + "description": "发布环境类型。 0:生产 1:沙箱", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "in": "body", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference/hosting/release-version.rules.json b/pkg/domain/reference/hosting/release-version.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/release-version.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/update-site.json b/pkg/domain/reference/hosting/update-site.json new file mode 100644 index 0000000..28b1356 --- /dev/null +++ b/pkg/domain/reference/hosting/update-site.json @@ -0,0 +1,253 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section1981222217135", + "text": "请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/modify' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1*************3GUGkqY' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"description\": \"test123\",\n \"cleanSuffix\":0\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section168171722121315", + "text": "响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "title": "管理站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361", + "title": "删除站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section10807102271311", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section128071622171311", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section19807422151313", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section11808112261315", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section1981222217135", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2812322121314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section168171722121315", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section168171722181317", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section98171222181312", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section10807102271311", + "text": "此接口用于更新站点描述信息及控制是否开启简洁链接。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section128071622171311", + "text": "无" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理站点\n更新站点\n更新站点\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于更新站点描述信息及控制是否开启简洁链接。\n\n使用约束\n\n无\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/site/modify\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n站点信息。\n\n\n\n\ndescription\n\n\t\n\nO\n\n\t\n\nString(1000)\n\n\t\n\n描述信息内容,匹配中文、空格、下划线、中划线、点、英文字母及数字。\n\n\n\n\ncleanSuffix\n\n\t\n\nO\n\n\t\n\nInteger\n\n\t\n\n简洁链接:\n\n0-关闭。\n1-开启。\n请求示例\ncurl --location --request POST 'https://{domain}/api/cloudhosting/web/v1/site/modify' \\\n--header 'productId: 4016977****9908702' \\\n--header 'requestid: test' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer eyJraWQiOiI1QU1*************3GUGkqY' \\\n--data-raw '{\n \"siteId\": \"7HfJOkoUSIm_RYsfHkljpg\",\n \"description\": \"test123\",\n \"cleanSuffix\":0\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":*retcode*, \"msg\": \"*description*\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n响应示例\n成功示例\n{\n \"code\": \"0\",\n \"message\": \"success\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n查询站点\n删除站点\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/site/modify 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section19807422151313" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "站点信息。" + ], + [ + "description", + "O", + "String(1000)", + "描述信息内容,匹配中文、空格、下划线、中划线、点、英文字母及数字。" + ], + [ + "cleanSuffix", + "O", + "Integer", + "简洁链接: 0-关闭。 1-开启。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":*retcode*, \"msg\": \"*description*\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2812322121314" + } + ], + "title": "更新站点", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/update-site.parameters.json b/pkg/domain/reference/hosting/update-site.parameters.json new file mode 100644 index 0000000..f823b72 --- /dev/null +++ b/pkg/domain/reference/hosting/update-site.parameters.json @@ -0,0 +1,75 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "description", + "type": "string", + "required": false, + "description": "描述信息内容,匹配中文、空格、下划线、中划线、点、英文字母及数字。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "in": "body", + "maxLength": 1000 + }, + { + "name": "cleanSuffix", + "type": "integer", + "required": false, + "description": "简洁链接: 0-关闭。 1-开启。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "in": "body", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference/hosting/update-site.rules.json b/pkg/domain/reference/hosting/update-site.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/update-site.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/upload-url.json b/pkg/domain/reference/hosting/upload-url.json new file mode 100644 index 0000000..151cb01 --- /dev/null +++ b/pkg/domain/reference/hosting/upload-url.json @@ -0,0 +1,391 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section2382162510250", + "text": "请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/populateFiles' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmc************FEBJWctGVEI7hU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"VIT6OmERQLiJREDr589mwA\",\n \"materialInfos\":[\n {\n \"sceneId\":\"258779603740930923\",\n \"fileName\":\"test1.zip\",\n \"fileSha256\":\"20a390d44f078e805de31c2108a0b3b77384e50469396adfc9e6500b22a18e8b\",\n \"fileSize\":46365,\n \"contentType\":902\n }\n ]\n}'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section69231586289", + "text": "响应示例\n成功示例\n{\n \"materialRsps\": [\n {\n \"uploadInfo\": {\n \"url\": \"https://contentcenter-test-006.obs.cn-north-1.myhuaweicloud.com/hosting_HostVersion_900_9/7d/v3/4e74VN6tTJqFTjo-iFnLhg/test1.zip\",\n \"method\": \"PUT\",\n \"headers\": {\n \"Authorization\": \"AWS4-HMAC-SHA256 Credential=I06FNCS2OGN5YXWTTPZC/20211013/cn-north-1/s3/aws4_request, SignedHeaders=content-length;content-type;host;user-agent;x-amz-client-request-id;x-amz-content-sha256;x-amz-date, Signature=cc3822cfe3570b9790404dc81b3099bd2227b914d3d8a12d8d46d347f4bb1937\",\n \"x-amz-content-sha256\": \"20a390d44f078e805de31c2108a0b3b77384e50469396adfc9e6500b22a18e8b\",\n \"x-amz-client-request-id\": \"H7Mm88voTXihqT6YDbWyHQ\",\n \"x-amz-date\": \"20211013T083231Z\",\n \"connection\": \"close\",\n \"Host\": \"contentcenter-test-006.obs.cn-north-1.myhuaweicloud.com\",\n \"Content-Type\": \"application/zip\",\n }\n }\n }\n ]\n}\n业务失败示例\n{\n \"code\": \"MATERIAL.0000\",\n \"message\": \"The storage space reaches the upper limit.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID及项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudhost-getstarted-0000001166760172#section14162113625516", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#ZH-CN_TOPIC_0000002772871311__table208569963020", + "title": "MaterialInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#ZH-CN_TOPIC_0000002772871311__table1662019250386", + "title": "MaterialRsp" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#ZH-CN_TOPIC_0000002772871311__table13671116153911", + "title": "uploadInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "title": "上传版本压缩包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867", + "title": "修改版本文件列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "title": "上传版本压缩包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section5230614", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section066010664515", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section83815724510", + "title": "业务失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section410410316475", + "title": "鉴权失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section15494260", + "text": "此接口用于获取增量版本文件压缩包或全量版本文件压缩包的上传地址等信息,并完成增量版本包上传。您可以多次获取上传地址,以最后一次获取为最终增量版本。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section5230614", + "text": "您需要将新增和修改的文件按照目录结构,从根目录打包成zip压缩包。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "text": "MaterialInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section25434396", + "text": "MaterialRsp" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section25434396", + "text": "uploadInfo" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n获取版本压缩包上传地址\n获取版本压缩包上传地址\n更新时间: 2026-10-23 16:56\n功能介绍\n\n此接口用于获取增量版本文件压缩包或全量版本文件压缩包的上传地址等信息,并完成增量版本包上传。您可以多次获取上传地址,以最后一次获取为最终增量版本。\n\n使用约束\n\n您需要将新增和修改的文件按照目录结构,从根目录打包成zip压缩包。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/api/cloudhosting/web/v1/version/populateFiles\n\n其中{domain}依站点区分:\n中国:connect-api.cloud.huawei.com\n德国:connect-api-dre.cloud.huawei.com\n新加坡:connect-api-dra.cloud.huawei.com\n俄罗斯:connect-api-drru.cloud.huawei.com\n注意\n\n调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n认证鉴权信息。\n\n认证方式:Bearer token。\n\n格式:“Authorization: Bearer ${access_token}”。\n\naccess_token为获取Token中获取的access_token。\n\n\n\n\nproductId\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n项目ID,获取方法参考查询开发者账号ID及项目ID。\n\n\n\n\nrequestid\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n自定义的请求字符串,必须唯一标识此请求。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nservice\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nAPI业务标识。固定值:hosting。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsiteId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n云托管版本所在的站点ID。\n\n可根据站点名称查询站点ID,获取方法参考查询站点信息。\n\n\n\n\nversion\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n当前版本的版本号(只支持“CREATED”状态版本)\n\n\n\n\nmaterialInfos\n\n\t\n\nM\n\n\t\n\nList\n\n\t\n\nzip增量包参数信息。\n\nMaterialInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nsceneId\n\n\t\n\nM\n\n\t\n\nString(128)\n\n\t\n\n场景ID,与项目ID一致。\n\n\n\n\nfileName\n\n\t\n\nM\n\n\t\n\nString(256)\n\n\t\n\n文件名称。\n\n\n\n\nfileSha256\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\nzip增量的Hash值。\n\n\n\n\nfileSize\n\n\t\n\nM\n\n\t\n\nLong\n\n\t\n\n文件大小,参数最大限制10G。\n\n\n\n\ncontentType\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n上传资源类型。固定值为:902。\n\n请求示例\ncurl --location --request POST 'https://connect-api.cloud.huawei.com/api/cloudhosting/web/v1/version/populateFiles' \\\n--header 'productId: 258779603740930923' \\\n--header 'Authorization: Bearer eyJraWQiOiJJQXNyUjFmc************FEBJWctGVEI7hU' \\\n--header 'requestid: 876456' \\\n--header 'client_id: 7261907****1591808' \\\n--header 'service: hosting' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"siteId\": \"KCM647QqTvyk7AqvH49jqQ\",\n \"version\":\"VIT6OmERQLiJREDr589mwA\",\n \"materialInfos\":[\n {\n \"sceneId\":\"258779603740930923\",\n \"fileName\":\"test1.zip\",\n \"fileSha256\":\"20a390d44f078e805de31c2108a0b3b77384e50469396adfc9e6500b22a18e8b\",\n \"fileSize\":46365,\n \"contentType\":902\n }\n ]\n}'\n响应参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。\n\n\n\n\ncode\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果状态码,参考状态码。\n\n\n\n\nmessage\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n结果描述信息。\n\n\n\n\nmaterialRsps\n\n\t\n\nO\n\n\t\n\nList\n\n\t\n\n增量zip上传信息。包含请求地址、请求方法、请求头等。\n\nMaterialRsp\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nuploadInfo\n\n\t\n\nM\n\n\t\n\nuploadInfo\n\n\t\n\n素材上传信息。\n\nuploadInfo\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nurl\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n上传URL地址。\n\n\n\n\nmethod\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n请求方法。\n\n\n\n\nheaders\n\n\t\n\nM\n\n\t\n\nMap\n\n\t\n\n上传版本压缩包时,请求头所需的参数,为JSON结构,格式为:{\"Authorization\":\"***\",\"x-amz-content-sha256\":\"***\",\"x-amz-client-request-id\":\"***\",\"x-amz-date\":\"***\",\"Host\":\"***\",\"Content-Type\":\"***\"}。\n\n具体说明请参见上传版本压缩包接口。\n\n响应示例\n成功示例\n{\n \"materialRsps\": [\n {\n \"uploadInfo\": {\n \"url\": \"https://contentcenter-test-006.obs.cn-north-1.myhuaweicloud.com/hosting_HostVersion_900_9/7d/v3/4e74VN6tTJqFTjo-iFnLhg/test1.zip\",\n \"method\": \"PUT\",\n \"headers\": {\n \"Authorization\": \"AWS4-HMAC-SHA256 Credential=I06FNCS2OGN5YXWTTPZC/20211013/cn-north-1/s3/aws4_request, SignedHeaders=content-length;content-type;host;user-agent;x-amz-client-request-id;x-amz-content-sha256;x-amz-date, Signature=cc3822cfe3570b9790404dc81b3099bd2227b914d3d8a12d8d46d347f4bb1937\",\n \"x-amz-content-sha256\": \"20a390d44f078e805de31c2108a0b3b77384e50469396adfc9e6500b22a18e8b\",\n \"x-amz-client-request-id\": \"H7Mm88voTXihqT6YDbWyHQ\",\n \"x-amz-date\": \"20211013T083231Z\",\n \"connection\": \"close\",\n \"Host\": \"contentcenter-test-006.obs.cn-north-1.myhuaweicloud.com\",\n \"Content-Type\": \"application/zip\",\n }\n }\n }\n ]\n}\n业务失败示例\n{\n \"code\": \"MATERIAL.0000\",\n \"message\": \"The storage space reaches the upper limit.\"\n}\n鉴权失败示例\n{\n \"ret\": {\n \"code\": 205524993,\n \"msg\": \"client token auth failed\"\n }\n}\n修改版本文件列表\n上传版本压缩包\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n业务失败示例\n鉴权失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/cloudhosting/web/v1/version/populateFiles 其中{domain}依站点区分: 中国:connect-api.cloud.huawei.com 德国:connect-api-dre.cloud.huawei.com 新加坡:connect-api-dra.cloud.huawei.com 俄罗斯:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如欧洲站点使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。" + ], + [ + "productId", + "M", + "String", + "项目ID,获取方法参考查询开发者账号ID及项目ID。" + ], + [ + "requestid", + "M", + "String", + "自定义的请求字符串,必须唯一标识此请求。" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "service", + "M", + "String", + "API业务标识。固定值:hosting。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String(64)", + "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。" + ], + [ + "version", + "M", + "String(64)", + "当前版本的版本号(只支持“CREATED”状态版本)" + ], + [ + "materialInfos", + "M", + "List", + "zip增量包参数信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "sceneId", + "M", + "String(128)", + "场景ID,与项目ID一致。" + ], + [ + "fileName", + "M", + "String(256)", + "文件名称。" + ], + [ + "fileSha256", + "M", + "String(64)", + "zip增量的Hash值。" + ], + [ + "fileSize", + "M", + "Long", + "文件大小,参数最大限制10G。" + ], + [ + "contentType", + "M", + "Integer", + "上传资源类型。固定值为:902。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "code", + "O", + "String", + "结果状态码,参考状态码。" + ], + [ + "message", + "O", + "String", + "结果描述信息。" + ], + [ + "materialRsps", + "O", + "List", + "增量zip上传信息。包含请求地址、请求方法、请求头等。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "uploadInfo", + "M", + "uploadInfo", + "素材上传信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section25434396" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "url", + "M", + "String", + "上传URL地址。" + ], + [ + "method", + "M", + "String", + "请求方法。" + ], + [ + "headers", + "M", + "Map", + "上传版本压缩包时,请求头所需的参数,为JSON结构,格式为:{\"Authorization\":\"***\",\"x-amz-content-sha256\":\"***\",\"x-amz-client-request-id\":\"***\",\"x-amz-date\":\"***\",\"Host\":\"***\",\"Content-Type\":\"***\"}。 具体说明请参见上传版本压缩包接口。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section25434396" + } + ], + "title": "获取版本压缩包上传地址", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/upload-url.parameters.json b/pkg/domain/reference/hosting/upload-url.parameters.json new file mode 100644 index 0000000..a1b0455 --- /dev/null +++ b/pkg/domain/reference/hosting/upload-url.parameters.json @@ -0,0 +1,123 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号(只支持“CREATED”状态版本)", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "materialInfos", + "type": "array", + "required": true, + "description": "zip增量包参数信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "sceneId", + "type": "string", + "required": true, + "description": "场景ID,与项目ID一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 128 + }, + { + "name": "fileName", + "type": "string", + "required": true, + "description": "文件名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 256 + }, + { + "name": "fileSha256", + "type": "string", + "required": true, + "description": "zip增量的Hash值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 64, + "pattern": "^[a-fA-F0-9]{64}$" + }, + { + "name": "fileSize", + "type": "integer", + "required": true, + "description": "文件大小,参数最大限制10G。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "minimum": 0, + "maximum": 10737418240 + }, + { + "name": "contentType", + "type": "integer", + "required": true, + "description": "上传资源类型。固定值为:902。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "enum": [ + "902" + ] + } + ] + } +] diff --git a/pkg/domain/reference/hosting/upload-url.rules.json b/pkg/domain/reference/hosting/upload-url.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/upload-url.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/hosting/upload-version.json b/pkg/domain/reference/hosting/upload-version.json new file mode 100644 index 0000000..66a6d8a --- /dev/null +++ b/pkg/domain/reference/hosting/upload-version.json @@ -0,0 +1,255 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section2382162510250", + "text": "请求示例\ncurl --location --request PUT 'https://content***********.com/hosting_HostVersion_904_9/23/v3/M3qacR6QTt27PLe47x4FAA/test1.zip' \\\n--header 'Authorization: AWS4-HMAC-SHA256 Credential=I06FN**********************_request, SignedHeaders=content-length;content-type;host;user-agent;x-amz-client-request-id;x-amz-content-sha256;x-amz-date, Signature=6faf12cf49a84e536e884677a6c2d43206bb2cea5dbe4be2f8eca93624c80ff7' \\\n--header 'x-amz-content-sha256: 20a390d44f078e805de31c2108a0b3b77384e50469396adfc9e6500b22a18e8b' \\\n--header 'x-amz-client-request-id: MaU70G-8S62Y-ZtCuMKDjQ' \\\n--header 'x-amz-date: 20210824T061826Z' \\\n--header 'Host: content***********.com' \\\n--header 'Content-Type: application/zip' \\\n--header 'connection: close' \\\n--data-binary '@/C:/Users/Desktop/hosting/test1.zip'" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section69231586289", + "text": "响应示例\n成功示例\nHTTPS/1.1 200 OK\n失败示例\nHTTPS/1.1 403 Forbidden\n\n\nRequestTimeTooSkewedThe difference between the request time and the current time is too large.0000017C7CCDB5B7804FB8999087250Bb2mYGM1RhdcyhPNXOpuOSYVonBRXWAowp5FlInLyRzUOf9pJq1g02DoSkcewFIKF90000020210824T061826Z2021-10-14T03:17:08.663Z" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#ZH-CN_TOPIC_0000002743192178__table8419125694713", + "title": "请求头" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#ZH-CN_TOPIC_0000002772871311__table13671116153911", + "title": "uploadInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385", + "title": "归档版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section15494260", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section5230614", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section55021827", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section2382162510250", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section25434396", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section69231586289", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section1867336204918", + "title": "成功示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section97741350154917", + "title": "失败示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section15494260", + "text": "通过获取上传地址的响应请求地址、请求方法、请求头信息,上传版本压缩包至云托管。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section5230614", + "text": "在获取上传地址时响应的请求头中,“Authorization”参数的token有效期为30分钟。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section25434396", + "text": "成功上传后会返回 “200 OK HTTPS” 响应,无响应体。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section25434396", + "text": "上传失败响应内容:" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n上传版本压缩包\n上传版本压缩包\n更新时间: 2026-10-23 16:56\n功能介绍\n\n通过获取上传地址的响应请求地址、请求方法、请求头信息,上传版本压缩包至云托管。\n\n使用约束\n\n在获取上传地址时响应的请求头中,“Authorization”参数的token有效期为30分钟。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS PUT\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\n${uploadInfo.url}\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\nAuthorization\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n校验信息,对应获取版本压缩包上传地址接口返回的headers参数中的Authorization。\n\n\n\n\nx-amz-content-sha256\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n文件对象内容的SHA256哈希值,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-content-sha256。\n\n\n\n\nx-amz-client-request-id\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n文件上传的唯一标识,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-client-request-id。\n\n\n\n\nx-amz-date\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n文件上传地址生成的时间,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-date。\n\n\n\n\nHost\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n上传服务器地址,对应获取版本压缩包上传地址接口返回的headers参数中的Host。\n\n\n\n\nContent-Type\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n对象内容的类型,对应获取版本压缩包上传地址接口返回的headers参数中的Content-Type。\n\nBody\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n类型\n\n\t\n\n参数说明\n\n\n\n\n${file}\n\n\t\n\nM\n\n\t\n\nBinary\n\n\t\n\n增量版本文件。\n\n请求示例\ncurl --location --request PUT 'https://content***********.com/hosting_HostVersion_904_9/23/v3/M3qacR6QTt27PLe47x4FAA/test1.zip' \\\n--header 'Authorization: AWS4-HMAC-SHA256 Credential=I06FN**********************_request, SignedHeaders=content-length;content-type;host;user-agent;x-amz-client-request-id;x-amz-content-sha256;x-amz-date, Signature=6faf12cf49a84e536e884677a6c2d43206bb2cea5dbe4be2f8eca93624c80ff7' \\\n--header 'x-amz-content-sha256: 20a390d44f078e805de31c2108a0b3b77384e50469396adfc9e6500b22a18e8b' \\\n--header 'x-amz-client-request-id: MaU70G-8S62Y-ZtCuMKDjQ' \\\n--header 'x-amz-date: 20210824T061826Z' \\\n--header 'Host: content***********.com' \\\n--header 'Content-Type: application/zip' \\\n--header 'connection: close' \\\n--data-binary '@/C:/Users/Desktop/hosting/test1.zip'\n响应参数\n\n成功上传后会返回 “200 OK HTTPS” 响应,无响应体。\n\n上传失败响应内容:\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n参数说明\n\n\n\n\nxml\n\n\t\n\nO\n\n\t\n\n上传失败的描述。\n\n响应示例\n成功示例\nHTTPS/1.1 200 OK\n失败示例\nHTTPS/1.1 403 Forbidden\n\n\nRequestTimeTooSkewedThe difference between the request time and the current time is too large.0000017C7CCDB5B7804FB8999087250Bb2mYGM1RhdcyhPNXOpuOSYVonBRXWAowp5FlInLyRzUOf9pJq1g02DoSkcewFIKF90000020210824T061826Z2021-10-14T03:17:08.663Z\n获取版本压缩包上传地址\n归档版本\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\nHeader\nBody\n请求示例\n响应参数\n响应示例\n成功示例\n失败示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "${uploadInfo.url}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "校验信息,对应获取版本压缩包上传地址接口返回的headers参数中的Authorization。" + ], + [ + "x-amz-content-sha256", + "M", + "String", + "文件对象内容的SHA256哈希值,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-content-sha256。" + ], + [ + "x-amz-client-request-id", + "M", + "String", + "文件上传的唯一标识,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-client-request-id。" + ], + [ + "x-amz-date", + "M", + "String", + "文件上传地址生成的时间,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-date。" + ], + [ + "Host", + "M", + "String", + "上传服务器地址,对应获取版本压缩包上传地址接口返回的headers参数中的Host。" + ], + [ + "Content-Type", + "M", + "String", + "对象内容的类型,对应获取版本压缩包上传地址接口返回的headers参数中的Content-Type。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "${file}", + "M", + "Binary", + "增量版本文件。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "类型", + "必选(M)/可选(O)", + "参数说明" + ], + [ + "xml", + "O", + "上传失败的描述。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section25434396" + } + ], + "title": "上传版本压缩包", + "updatedAt": "2026-10-23 16:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/hosting/upload-version.parameters.json b/pkg/domain/reference/hosting/upload-version.parameters.json new file mode 100644 index 0000000..40070d8 --- /dev/null +++ b/pkg/domain/reference/hosting/upload-version.parameters.json @@ -0,0 +1,64 @@ +[ + { + "name": "Authorization", + "type": "string", + "required": true, + "description": "校验信息,对应获取版本压缩包上传地址接口返回的headers参数中的Authorization。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "x-amz-content-sha256", + "type": "string", + "required": true, + "description": "文件对象内容的SHA256哈希值,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-content-sha256。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "x-amz-client-request-id", + "type": "string", + "required": true, + "description": "文件上传的唯一标识,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-client-request-id。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "x-amz-date", + "type": "string", + "required": true, + "description": "文件上传地址生成的时间,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-date。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "Host", + "type": "string", + "required": true, + "description": "上传服务器地址,对应获取版本压缩包上传地址接口返回的headers参数中的Host。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "Content-Type", + "type": "string", + "required": true, + "description": "对象内容的类型,对应获取版本压缩包上传地址接口返回的headers参数中的Content-Type。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "uploadUrl", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813" + }, + { + "name": "file", + "in": "file", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813" + } +] diff --git a/pkg/domain/reference/hosting/upload-version.rules.json b/pkg/domain/reference/hosting/upload-version.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/hosting/upload-version.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/management/browser-review.json b/pkg/domain/reference/management/browser-review.json new file mode 100644 index 0000000..606ad1e --- /dev/null +++ b/pkg/domain/reference/management/browser-review.json @@ -0,0 +1,5122 @@ +[ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "private static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p16276124912475", + "title": "方式一" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p131976468508", + "title": "方式二" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#ZH-CN_TOPIC_0000002779309279__p159471258125610", + "title": "方式三" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "title": "配置管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-overview-0000001367568657", + "title": "总览查看" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "title": "获取云缓存信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "title": "Java" + } + ], + "notes": [ + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "用户名:用于客户端访问云缓存时的用户名。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "获取云缓存信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section143624018503", + "text": "如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。" + }, + { + "section": "使用云缓存", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section118031216118", + "text": "您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。" + }, + { + "section": "Node.js", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section1722572531210", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "提供了三种方式,可根据业务情况选择合适的方式:" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式一:使用原生的jedis客户端连接云缓存。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式二:使用Spring封装的RedisTemplate能力。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式一】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式二】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "【方式三】" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0" + }, + { + "section": "Java", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416#section66462053154116", + "text": "在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}" + } + ], + "renderedText": "指南\n云缓存\n使用云缓存\n使用云缓存\n更新时间: 2026-10-23 16:58\n获取云缓存信息\n\n在使用云缓存之前,您需要先获取云缓存的域名、端口、用户名和密码,以便后续在应用中连接云缓存后使用云缓存。\n\n获取用户名、域名和端口。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n复制“用户名”、“内网地址”。\n用户名:用于客户端访问云缓存时的用户名。\n内网地址:agcp-drcn.hispace.dbankcloud.cn即为域名,16380为端口,用于在生产环境中使用云缓存。\n\n获取密码。\n密码为开通云缓存时设置的密码。如果忘记密码,可以重置访问密码(重置的密码最长需要30分钟后才能生效)。\n注意\n\n如果已经有其他业务使用云缓存,重置密码将导致这些业务无法使用云缓存,请修改业务中的密码并重新部署。\n\n使用云缓存\n\n您可以根据使用的开发语言,选择不同方式连接云缓存后,参考Redis文档使用云缓存。\n\nNode.js\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\n\n const Redis = require('ioredis');\n const redisClient = new Redis({\n port: Number(16380),\n host: 'agcp-drcn.hispace.dbankcloud.cn',\n username: 'TODO:填写当前使用的项目ID',\n password: 'TODO:填写为设置的云缓存密码',\n enableReadyCheck: false,});\n\n let myHandler = async function(event, context, callback, logger) {\n let res = new context.HTTPResponse({\"simple\": \"example\"}, {\n \"res-type\": \"simple example\",\n \"faas-content-type\": \"json\"\n }, \"application/json\", \"200\");\n let ret = await redisClient.get('name');\n logger.info(\"redis get name result:\" + ret);\n\n //send response\n callback(res);\n };\n\n module.exports.myHandler = myHandler;\nJava\n\n提供了三种方式,可根据业务情况选择合适的方式:\n\n方式一:使用原生的jedis客户端连接云缓存。\n方式二:使用Spring封装的RedisTemplate能力。\n方式三:对于Spring Boot工程,可以不显式的创建RedisTemplate对象,通过@Autowired 注入相关配置信息。\n\n【方式一】\n\n在pom文件中添加依赖。\n\n\tredis.clients\n\tjedis\n \n\t3.8.0\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static final JedisPool JEDIS_POOL = getRedisPool();\n\nprivate static JedisPool getRedisPool() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();\n // 当资源池连接用尽后,客户端最大等待时间\n jedisPoolConfig.setMaxWait(Duration.ofSeconds(5));\n // jedisPoolConfig其他参数保持默认值即可\n return new JedisPool(jedisPoolConfig, redisHost, redisPort, timeout, redisUser, redisPwd);\n}\n\npublic void cloudRedis() {\n try (Jedis jedis = JEDIS_POOL.getResource()) {\n String ret = jedis.get(\"name\");\n log.info(\"redis get name result:\" + ret);\n }\n}\n\n【方式二】\n\n在pom文件中添加依赖。\n\n org.springframework.data\n spring-data-redis\n 2.7.1\n\n\n org.springframework\n spring-core\n 5.3.23\n\n在需要使用云缓存的地方参考如下代码,即可连接云缓存。\nprivate static StringRedisTemplate redisTemplate = getRedisClient();\n\nprivate static StringRedisTemplate getRedisClient() {\n // 云缓存的域名\n String redisHost = \"agcp-drcn.hispace.dbankcloud.cn\";\n // 云缓存的端口号\n int redisPort = 16380;\n // 云缓存链接和读写超时时间\n int timeout = 3000;\n // 云缓存的用户名\n String redisUser = \"填写当前用户名\";\n // 设置的云缓存密码\n String redisPwd = \"填写设置的云缓存密码\";\n RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(redisHost, redisPort);\n standaloneConfig.setPassword(RedisPassword.of(redisPwd));\n standaloneConfig.setUsername(redisUser);\n JedisClientConfiguration clientConfig = JedisClientConfiguration.builder()\n .readTimeout(Duration.ofMillis(timeout))\n .connectTimeout(Duration.ofMillis(timeout))\n .usePooling()\n .build();\n JedisConnectionFactory connectionFactory = new JedisConnectionFactory(standaloneConfig, clientConfig);\n connectionFactory.afterPropertiesSet();\n\n StringRedisTemplate redis = new StringRedisTemplate();\n redis.setConnectionFactory(connectionFactory);\n redis.afterPropertiesSet();\n\n return redis;\n}\n\npublic void cloudRedis() {\n String ret = redisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n\n【方式三】\n\n在配置文件application.properties增加redis相关配置信息。\n# 云缓存的用户名\nspring.redis.username=填写当前用户名\n# 云缓存密码\nspring.redis.password=填写设置的云缓存密码\n# 云缓存的域名\nspring.redis.host=agcp-drcn.hispace.dbankcloud.cn\n# 云缓存的端口号\nspring.redis.port=16380\n# 连接超时时间 单位 ms(毫秒)\nspring.redis.timeout=3000\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-active=4\n# 连接池资源耗尽时,连接尝试分配阻塞时间,超时即抛出异常。(负值表示无限期阻塞)\nspring.redis.lettuce.pool.max-wait=-1\n# 连接池可以分配的最大连接数。(负值表示无限制)\nspring.redis.lettuce.pool.max-idle=5\n# 连接池最小空闲连接数\nspring.redis.lettuce.pool.min-idle=0\n在需要使用云缓存的地方参考如下代码。\n@Autowired\nStringRedisTemplate stringRedisTemplate;\n\npublic void cloudRedis() {\n String ret = stringRedisTemplate.opsForValue().get(\"name\");\n log.info(\"redis get name result:\" + ret);\n}\n配置管理\n总览查看\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n获取云缓存信息\n使用云缓存\nNode.js\nJava\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "status": "browser-read", + "tables": [], + "title": "使用云缓存" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "title": "Web CLI命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-use-0000001485525416", + "title": "使用云缓存" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "title": "访问命令行工具" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "title": "重置访问密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "title": "查看用户名、内网地址" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "text": "云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "访问命令行工具", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section1955219512915", + "text": "云缓存目前支持的命令请参见“Web CLI命令”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码不能为空。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码必须以字母开头。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "密码长度在8到32位之间。" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "小写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "大写字母" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "数字(0-9)" + }, + { + "section": "重置访问密码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section18626153133319", + "text": "特殊字符(-~!@#%^*_=+?$&()|<>{}[])" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "点击左上角切换至项目控制台,在项目列表中点击您的项目。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "左侧导航栏选择“开放能力配置 > 云缓存”。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "进入云缓存页面,点击“管理”页签。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>" + }, + { + "section": "查看用户名、内网地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633#section10148145418336", + "text": "您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。" + } + ], + "renderedText": "配置管理\n更新时间: 2026-10-23 16:58\n\n云缓存服务提供可视化的配置管理,您可以在HarmonyOS 开发者中心进行访问命令行工具、重置访问密码、查看并复制内网访问地址和用户名的操作。\n\n访问命令行工具\n\n云缓存服务提供命令行工具Web CLI,您可以直接对缓存数据进行读写操作来排查、定位问题。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“访问命令行工具”,云缓存即可自动连接缓存实例,并进入Web CLI界面。\n说明\n\n云缓存目前支持的命令请参见“Web CLI命令”。\n\n重置访问密码\n\n云缓存提供重置访问密码功能,如您忘记之前设置的访问密码,可以进行密码重置。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“管理操作”模块点击“重置访问密码”,在弹出的“重置访问密码”窗口设置新的缓存访问密码。\n注意\n云缓存对访问密码有严格的限制:\n密码不能为空。\n密码必须以字母开头。\n密码长度在8到32位之间。\n必须包含如下四种字符:\n小写字母\n大写字母\n数字(0-9)\n特殊字符(-~!@#%^*_=+?$&()|<>{}[])\n\n查看用户名、内网地址\n\n云缓存服务可以获取您的用户名、内网地址,这些信息可用于在Redis客户端自行连接缓存实例,也可用于在应用中连接并使用云缓存。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n\n点击左上角切换至项目控制台,在项目列表中点击您的项目。\n\n左侧导航栏选择“开放能力配置 > 云缓存”。\n进入云缓存页面,点击“管理”页签。\n在“访问信息”模块,查看并复制用户名、内网地址。\n您可以在Redis客户端执行如下命令,自行连接缓存实例。\n./redis-cli -h <内网地址> -p <端口号> -a <缓存访问密码>\n您可以在应用中,根据使用的开发语言,选择不同方式连接并使用云缓存。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n访问命令行工具\n重置访问密码\n查看用户名、内网地址\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-configure-0000001367208633", + "status": "browser-read", + "tables": [], + "title": "配置管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-usage-0000001316079964", + "title": "用量统计" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "本章节主要介绍Web CLI工具支持的命令列表。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "当value值为空时,执行get命令返回nil。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "text": "各个命令的详细语法请前往Redis官方网站查看。" + } + ], + "renderedText": "指南\n云缓存\nWeb CLI命令\nWeb CLI命令\n更新时间: 2026-10-23 16:58\n\n本章节主要介绍Web CLI工具支持的命令列表。\n\n说明\n当前在Web CLI下所有命令参数暂不支持中文,且key和value不支持空格。命令行最多字符数不能超过4096。\n当value值为空时,执行get命令返回nil。\n各个命令的详细语法请前往Redis官方网站查看。\n\nKeys\n\n\t\n\nString\n\n\t\n\nList\n\n\t\n\nSet\n\n\t\n\nHash\n\n\n\n\nDEL\n\n\t\n\nAPPEND\n\n\t\n\nLINDEX\n\n\t\n\nSADD\n\n\t\n\nHDEL\n\n\n\n\nEXISTS\n\n\t\n\nDECR\n\n\t\n\nLLEN\n\n\t\n\nSCARD\n\n\t\n\nHEXISTS\n\n\n\n\nEXPIRE\n\n\t\n\nDECRBY\n\n\t\n\nLPOP\n\n\t\n\nSISMEMBER\n\n\t\n\nHGET\n\n\n\n\nPEXPIRE\n\n\t\n\nGET\n\n\t\n\nLPUSH\n\n\t\n\nSMEMBERS\n\n\t\n\nHGETALL\n\n\n\n\nTTL\n\n\t\n\nGETSET\n\n\t\n\nLRANGE\n\n\t\n\nSPOP\n\n\t\n\nHINCRBY\n\n\n\n\nTYPE\n\n\t\n\nINCR\n\n\t\n\nLREM\n\n\t\n\nSRANDMEMBER\n\n\t\n\nHLEN\n\n\n\n\n-\n\n\t\n\nINCRBY\n\n\t\n\nLSET\n\n\t\n\nSREM\n\n\t\n\nHKEYS\n\n\n\n\n-\n\n\t\n\nMGET\n\n\t\n\nLTRIM\n\n\t\n\n-\n\n\t\n\nHMGET\n\n\n\n\n-\n\n\t\n\nMSET\n\n\t\n\nRPOP\n\n\t\n\n-\n\n\t\n\nHMSET\n\n\n\n\n-\n\n\t\n\nMSETNX\n\n\t\n\nRPUSH\n\n\t\n\n-\n\n\t\n\nHSET\n\n\n\n\n-\n\n\t\n\nSET\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\nHVALS\n\n\n\n\n-\n\n\t\n\nSETEX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\n-\n\n\t\n\nSETNX\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n-\n\n用量统计\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Keys", + "String", + "List", + "Set", + "Hash" + ], + [ + "DEL", + "APPEND", + "LINDEX", + "SADD", + "HDEL" + ], + [ + "EXISTS", + "DECR", + "LLEN", + "SCARD", + "HEXISTS" + ], + [ + "EXPIRE", + "DECRBY", + "LPOP", + "SISMEMBER", + "HGET" + ], + [ + "PEXPIRE", + "GET", + "LPUSH", + "SMEMBERS", + "HGETALL" + ], + [ + "TTL", + "GETSET", + "LRANGE", + "SPOP", + "HINCRBY" + ], + [ + "TYPE", + "INCR", + "LREM", + "SRANDMEMBER", + "HLEN" + ], + [ + "-", + "INCRBY", + "LSET", + "SREM", + "HKEYS" + ], + [ + "-", + "MGET", + "LTRIM", + "-", + "HMGET" + ], + [ + "-", + "MSET", + "RPOP", + "-", + "HMSET" + ], + [ + "-", + "MSETNX", + "RPUSH", + "-", + "HSET" + ], + [ + "-", + "SET", + "-", + "-", + "HVALS" + ], + [ + "-", + "SETEX", + "-", + "-", + "-" + ], + [ + "-", + "SETNX", + "-", + "-", + "-" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudcache-webcli-guide-0000001386233729" + } + ], + "title": "Web CLI命令" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86", + "title": "工作原理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%85%B8%E5%9E%8B%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF", + "title": "典型应用场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%8F%90%E5%8D%87%E5%BA%94%E7%94%A8%E9%A6%96%E5%BC%80%E9%80%9F%E5%BA%A6", + "title": "提升应用首开速度" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%AE%9E%E7%8E%B0%E8%8A%82%E6%97%A5%E4%B8%BB%E9%A2%98%E5%8D%B3%E5%8F%91%E5%8D%B3%E7%8E%B0", + "title": "实现节日主题即发即现" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E7%BA%A6%E6%9D%9F%E4%B8%8E%E9%99%90%E5%88%B6", + "title": "约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E8%AE%BE%E5%A4%87%E9%99%90%E5%88%B6", + "title": "设备限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%95%B0%E6%8D%AE%E9%99%90%E5%88%B6", + "title": "数据限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E9%85%8D%E9%A2%9D%E9%99%90%E5%88%B6", + "title": "配额限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "当前支持如下三种预加载类型:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "提升应用首开速度", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#提升应用首开速度", + "text": "在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。" + }, + { + "section": "实现节日主题即发即现", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#实现节日主题即发即现", + "text": "很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。" + }, + { + "section": "设备限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#设备限制", + "text": "支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n概述\n概述\n更新时间: 2026-06-12 14:54\n复制页面\n\n从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。\n\n预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。\n\n当前支持如下三种预加载类型:\n\n安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。\n\n周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。\n\n跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。\n\n工作原理\n\n预加载服务根据配置的数据预加载策略从应用后台获取数据。\n\n预加载服务将获取的数据在本地进行缓存。\n\n应用使用获取的缓存数据,进行页面渲染。\n\n典型应用场景\n提升应用首开速度\n\n在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。\n\n实现节日主题即发即现\n\n很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。\n\n约束与限制\n设备限制\n\n支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。\n\n数据限制\n限制项\t说明\n数据类型\t仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。\n配额限制\n配额类型\t配额\n安装预加载缓存大小\t2MB\n周期性预加载缓存大小\t3MB\n跳链安装预加载缓存大小\t3MB\n预加载\n开发流程\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n工作原理\n典型应用场景\n提升应用首开速度\n实现节日主题即发即现\n约束与限制\n设备限制\n数据限制\n配额限制\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "限制项", + "说明" + ], + [ + "数据类型", + "仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。" + ] + ], + "section": "数据限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#数据限制" + }, + { + "location": "", + "rows": [ + [ + "配额类型", + "配额" + ], + [ + "安装预加载缓存大小", + "2MB" + ], + [ + "周期性预加载缓存大小", + "3MB" + ], + [ + "跳链安装预加载缓存大小", + "3MB" + ] + ], + "section": "配额限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#配额限制" + } + ], + "title": "概述" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-installprefetch", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载,总体流程如下:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发流程\n开发流程\n更新时间: 2026-04-20 14:34\n复制页面\n\n开发预加载,总体流程如下:\n\n配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。\n\n开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。\n\n调用预加载:在工程代码文件中调用预加载。\n\n概述\n配置预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "status": "browser-read", + "tables": [], + "title": "开发流程" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "数据来源为云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E7%BB%91%E5%AE%9A%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "绑定云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "数据来源为开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6-1", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E9%85%8D%E7%BD%AE%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9C%B0%E5%9D%80", + "title": "配置服务器地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "对于不同类型的开发者,支持的数据来源方式有所不同:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "下文介绍如何配置两种数据来源方式的预加载实现。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件-1", + "text": "已开通预加载服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "需要注意以下几点:" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n配置预加载\n配置预加载\n更新时间: 2026-04-24 16:10\n复制页面\n\n安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。\n\n对于不同类型的开发者,支持的数据来源方式有所不同:\n\n个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。\n\n非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。\n\n下文介绍如何配置两种数据来源方式的预加载实现。\n\n数据来源为云函数\n前提条件\n\n已开通预加载服务。\n\n已创建函数。\n\n绑定云函数\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。\n\n点击“保存”完成周期性预加载配置。\n\n若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。\n\n数据来源为开发者服务器\n前提条件\n\n已开通预加载服务。\n\n配置服务器地址\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n点击“下载地址”后的“修改”。\n\n以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。\n\n若配置“安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。\n\n开发流程\n开发预加载资源接口\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n数据来源为云函数\n前提条件\n绑定云函数\n数据来源为开发者服务器\n前提条件\n配置服务器地址\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "status": "browser-read", + "tables": [], + "title": "配置预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-develop-function-nodejs", + "title": "开发函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-test-function", + "title": "测试函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-deveco-studio/agc-harmonyos-clouddev-funccoding", + "title": "端云一体化工程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-call", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "云函数接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B-1", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let token = body.token;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let link = body.link; // 跳链安装预加载link信息" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",link:\" + link);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "开发者服务器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器", + "text": "开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "定义名称为prefetchData的接口,示例如下:" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发预加载资源接口\n开发预加载资源接口\n更新时间: 2026-09-01 11:59\n复制页面\n\n使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。\n\n云函数\n\n开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:\n\n开发函数:按照云函数接口规范开发函数。\n\n创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。\n\n测试函数:对函数进行测试,以确保函数代码运行正常。\n\n云函数接口规范\n预加载类型\tAPI名称\t说明\t参数\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tevent.body.appId:应用ID,获取方法请参见查看应用信息。\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.link:可选,跳链安装预加载延迟链接。\n\n\t自定义JSON字符串\n示例\n\n端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。\n\n安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n开发者服务器\n\n开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。\n\n开发者服务器接口规范\n预加载类型\tAPI/PATH名称\t说明\t参数\t请求方式\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tappId:应用ID,获取方法请参见查看应用信息。\tGET\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\tGET\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- link:可选,跳链安装预加载延迟链接。\n\n\tGET\t自定义JSON字符串\n示例\n\n定义名称为prefetchData的接口,示例如下:\n\nhttps://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy\n配置预加载\n调用预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n云函数\n云函数接口规范\n示例\n开发者服务器\n开发者服务器接口规范\n示例\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "预加载类型", + "API名称", + "说明", + "参数", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "event.body.appId:应用ID,获取方法请参见查看应用信息。", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.link:可选,跳链安装预加载延迟链接。", + "自定义JSON字符串" + ] + ], + "section": "云函数接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数接口规范" + }, + { + "location": "", + "rows": [ + [ + "预加载类型", + "API/PATH名称", + "说明", + "参数", + "请求方式", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "appId:应用ID,获取方法请参见查看应用信息。", + "GET", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "GET", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - link:可选,跳链安装预加载延迟链接。", + "GET", + "自定义JSON字符串" + ] + ], + "section": "开发者服务器接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器接口规范" + } + ], + "title": "开发预加载资源接口" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-install-and-periodic-prefetch", + "title": "调用全部预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "调试周期性预加载" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "错误码" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n(可选)使用命令行工具调试周期性预加载\n更新时间: 2026-10-10 20:02\n复制页面\n调试周期性预加载\n\n错误码\n\n调用全部预加载\n调试周期性预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "status": "browser-read", + "tables": [], + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-call-via-httptrigger-0000001512012404", + "title": "通过HTTP触发器调用函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/call-function-via-httptrigger-harmony-ts-api6-0000001603898345", + "title": "HarmonyOS(TypeScript API 6)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-function-harmony-ts-api6-0000001603903557", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/develop-func-introduction-0000001664954020#ZH-CN_TOPIC_0000002769573333", + "title": "开发函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/develop-func-introduction-0000001664954020#ZH-CN_TOPIC_0000002769573333", + "title": "开发函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#ZH-CN_TOPIC_0000002740173732__zh-cn_topic_0000001658831162_p13419714105311", + "title": "WebIDE" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "title": "创建层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/view-function-instances-0000001681828396", + "title": "查看函数实例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/modify-function-advanced-config-0000001734287937", + "title": "修改函数高级配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-ts-api6-create-func-preparations-0000001712005997", + "title": "配置前准备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/configure-func-manage-api6-0000001663966422", + "title": "配置函数管理功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section15530732134", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "title": "函数配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section898842219323", + "title": "触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411", + "title": "函数代码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "title": "层配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section366910579499", + "title": "更多信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "创建函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section15530732134", + "text": "开通云函数服务后,您首先需要在HarmonyOS 开发者中心创建函数,并添加函数执行的代码。" + }, + { + "section": "创建函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section15530732134", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "创建函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section15530732134", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要创建云函数的项目。" + }, + { + "section": "创建函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section15530732134", + "text": "在左侧导航栏选择“开放能力配置 > 云函数”,进入云函数主界面。" + }, + { + "section": "创建函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section15530732134", + "text": "选择“函数”页签,点击“创建函数”。" + }, + { + "section": "创建函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section15530732134", + "text": "页面右侧抽屉式滑出“创建函数”窗口,按照“函数配置 -> 触发器 -> 函数代码 -> 层配置”引导顺序配置函数。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "在“函数配置”页面,配置“函数名称”、“触发方式”、“超时时长”等函数信息。\n\n配置项\n\n\t\n\n说明\n\n\n\n\n函数名称\n\n\t\n\n函数的名称。\n\n\n\n\n描述\n\n\t\n\n函数的描述信息。\n\n\n\n\n触发方式\n\n\t\n\n请配置为“事件调用”。\n\n“事件调用”表示通过触发器方式调用函数。\n\n\n\n\n超时时长\n\n\t\n\n函数最大运行时长,超过该时长,则默认函数执行失败,单位为秒,取值范围为1~1800。\n\n说明\n“同步”调用方式时,函数最大运行时长为55秒。\n“异步”调用方式时,函数最大运行时长为1800秒。\n\n\n\n实例并发\n\n\t\n\n函数请求并发量上限,单位为个,取值范围为1~10000。\n\n\n\n\n环境变量\n\n\t\n\nkey-value形式,您可以将需要的变量配置信息传入函数执行环境中,用于函数在运行时读取和使用。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "(可选)您可根据需要添加环境变量,支持表单格式和JSON格式两种编辑方式。添加完成后,您还可以点击“JSON格式导出”,导出以“函数名称.json”格式命名的环境变量文件,以备后续使用。\n说明\n环境变量的key值具有唯一性,且“PROJECT_CREDENTIAL”和“AGC_”为系统级环境变量标识,不允许添加以其命名或以其为前缀的环境变量。\n环境变量总数不超过1000个。\n表单格式编辑\n\n点击“新增变量”,输入key和value值,如下图中所示,env1为环境变量的key值,test为value值。点击可将变量删除。\n\nJSON格式编辑\n\n选中“JSON格式编辑”,在文本框中以key-value键值对JSON格式添加环境变量。当添加的环境变量比较多时,为了方便核对,可点击“format”对变量进行格式化排列。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "环境变量的key值具有唯一性,且“PROJECT_CREDENTIAL”和“AGC_”为系统级环境变量标识,不允许添加以其命名或以其为前缀的环境变量。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "环境变量总数不超过1000个。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "表单格式编辑\n\n点击“新增变量”,输入key和value值,如下图中所示,env1为环境变量的key值,test为value值。点击可将变量删除。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "点击“新增变量”,输入key和value值,如下图中所示,env1为环境变量的key值,test为value值。点击可将变量删除。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "JSON格式编辑\n\n选中“JSON格式编辑”,在文本框中以key-value键值对JSON格式添加环境变量。当添加的环境变量比较多时,为了方便核对,可点击“format”对变量进行格式化排列。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "选中“JSON格式编辑”,在文本框中以key-value键值对JSON格式添加环境变量。当添加的环境变量比较多时,为了方便核对,可点击“format”对变量进行格式化排列。" + }, + { + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331", + "text": "“函数配置”页面配置完成后点击“下一步”。" + }, + { + "section": "触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section898842219323", + "text": "进入“触发器”页面,您可基于函数触发场景配置需要的触发器,本场景下添加HTTP触发器。“触发器类型”和“请求方式”保持默认选择,并配置“认证类型”,配置完成后点击“下一步”。" + }, + { + "section": "函数代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411", + "text": "进入“函数代码”页面,配置“运行环境”、“内存配置”、“代码输入类型”等信息,配置完成后点击“下一步”。" + }, + { + "section": "函数代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411", + "text": "WebIDE" + }, + { + "section": "函数代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411", + "text": "当“代码输入类型”配置项选择“在线编辑”时,创建函数界面中集成了WebIDE功能,支持在线编辑函数代码。" + }, + { + "section": "函数代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411", + "text": "如果在函数实例已经运行的情况下进行函数代码或配置更新,云函数后台会滚动更新函数实例,请您耐心等待10-20秒。" + }, + { + "section": "函数代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411", + "text": "WebIDE从左至右分两个部分:目录树、代码编辑器和最大化,如下图所示。编辑完成后平台会生成部署包并上传。" + }, + { + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "text": "层可以为您提供公共依赖库的发布与部署能力。您可以将函数依赖的公共库和相关依赖项提炼到层,通过为函数绑定层,便可以在函数中使用库,而不必将库包含在函数的代码包中,从而达到缩小函数代码包体积与缩短函数部署时间的效果,也避免了使用函数代码安装和打包依赖项时可能出现的错误。详细的层管理功能,请参见层管理。" + }, + { + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "text": "如果您尚未创建层,可跳过下述步骤,直接点击页面底部的“创建”完成函数定义,后续创建层之后可在函数详情页再进行层配置,为函数绑定层。如果您在创建函数之前已创建层,可按照下述步骤进行操作。" + }, + { + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "text": "进入“层配置”页面,点击“绑定层”。" + }, + { + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "text": "在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。一个函数最多可以绑定5个层。\n说明\n\n选择层时,层的兼容运行时需与函数运行环境相符,系统会自动完成过滤。若无匹配的层供您选择,请参考创建层创建相同运行环境的层后再进行绑定。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。" + }, + { + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "text": "选择层时,层的兼容运行时需与函数运行环境相符,系统会自动完成过滤。若无匹配的层供您选择,请参考创建层创建相同运行环境的层后再进行绑定。" + }, + { + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "text": "返回到“层配置”界面,绑定成功的层将展示在层列表中。若您需要解除层与函数的绑定关系,点击“解绑”即可。" + }, + { + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416", + "text": "按照“函数配置 -> 触发器 -> 函数代码 -> 层配置”顺序配置过程中,您若需要修改前面步骤中的配置,可点击“上一步”进行回退,配置完成后点击“创建”提交函数定义。" + }, + { + "section": "更多信息", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section366910579499", + "text": "函数配置完成后,您可以查看函数实例、修改函数高级配置。" + } + ], + "renderedText": "指南\n云函数\n通过HTTP触发器调用函数\nHarmonyOS(TypeScript API 6)\n创建函数\n创建并配置函数\n创建并配置函数\n更新时间: 2026-10-20 16:24\n创建函数\n\n开通云函数服务后,您首先需要在HarmonyOS 开发者中心创建函数,并添加函数执行的代码。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要创建云函数的项目。\n在左侧导航栏选择“开放能力配置 > 云函数”,进入云函数主界面。\n选择“函数”页签,点击“创建函数”。\n\n页面右侧抽屉式滑出“创建函数”窗口,按照“函数配置 -> 触发器 -> 函数代码 -> 层配置”引导顺序配置函数。\n\n函数配置\n在“函数配置”页面,配置“函数名称”、“触发方式”、“超时时长”等函数信息。\n\n配置项\n\n\t\n\n说明\n\n\n\n\n函数名称\n\n\t\n\n函数的名称。\n\n\n\n\n描述\n\n\t\n\n函数的描述信息。\n\n\n\n\n触发方式\n\n\t\n\n请配置为“事件调用”。\n\n“事件调用”表示通过触发器方式调用函数。\n\n\n\n\n超时时长\n\n\t\n\n函数最大运行时长,超过该时长,则默认函数执行失败,单位为秒,取值范围为1~1800。\n\n说明\n“同步”调用方式时,函数最大运行时长为55秒。\n“异步”调用方式时,函数最大运行时长为1800秒。\n\n\n\n实例并发\n\n\t\n\n函数请求并发量上限,单位为个,取值范围为1~10000。\n\n\n\n\n环境变量\n\n\t\n\nkey-value形式,您可以将需要的变量配置信息传入函数执行环境中,用于函数在运行时读取和使用。\n\n(可选)您可根据需要添加环境变量,支持表单格式和JSON格式两种编辑方式。添加完成后,您还可以点击“JSON格式导出”,导出以“函数名称.json”格式命名的环境变量文件,以备后续使用。\n说明\n环境变量的key值具有唯一性,且“PROJECT_CREDENTIAL”和“AGC_”为系统级环境变量标识,不允许添加以其命名或以其为前缀的环境变量。\n环境变量总数不超过1000个。\n表单格式编辑\n\n点击“新增变量”,输入key和value值,如下图中所示,env1为环境变量的key值,test为value值。点击可将变量删除。\n\nJSON格式编辑\n\n选中“JSON格式编辑”,在文本框中以key-value键值对JSON格式添加环境变量。当添加的环境变量比较多时,为了方便核对,可点击“format”对变量进行格式化排列。\n\n“函数配置”页面配置完成后点击“下一步”。\n触发器\n\n进入“触发器”页面,您可基于函数触发场景配置需要的触发器,本场景下添加HTTP触发器。“触发器类型”和“请求方式”保持默认选择,并配置“认证类型”,配置完成后点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n函数代码\n\n进入“函数代码”页面,配置“运行环境”、“内存配置”、“代码输入类型”等信息,配置完成后点击“下一步”。\n\n配置项\n\n\t\n\n说明\n\n\n\n\n运行环境\n\n\t\n\n函数容器的运行环境。\n\n因业务调整需要,新创建的函数不再支持java、python、custom-runtime运行环境,仅支持选择nodejs 20.x/latest(选择latest时表示使用最新版本)。\n\n\n\n\n内存配置\n\n\t\n\n函数容器所占有的内存大小,单位为MB,取值范围:500,1000,2000,4000。\n\n\n\n\n代码输入类型\n\n\t\n\n包括“在线编辑”与“*.zip文件”两种方式,默认值为“在线编辑”。\n\n运行环境java和custom-runtime仅支持ZIP包上传。\n如选择“*.zip文件”方式部署云函数,入口方法文件的编写方法和函数部署包结构,请参见“开发函数”下对应运行环境的“入口方法”和“准备函数部署包”章节。\n\n\n\n函数入口\n\n\t\n\n包括入口文件名称和入口方法名称,通过“.”连接。例如handler.myHandler,其中handler为入口文件名称,myHandler为入口方法名称。\n\nnodejs和python运行环境下入口文件必须放置在函数部署包的根目录下。具体请参见“开发函数”下对应运行环境的“准备函数部署包”章节。\njava运行环境下函数入口支持包名.入口类::入口方法和包名.入口类两种格式,包名、类名、方法名均以字母或下划线开头,支持数字字母下划线,且长度不能超过64个字符,包的层级不超过16。例如faas.HelloPojo::handleRequest,其中faas为包名,HelloPojo为入口类名,handleRequest为入口方法名。\ncustom-runtime运行环境下函数入口默认为\"/invoke\",且不支持修改。\n\n\n\n代码文件\n\n\t\n\n用于在线编辑函数代码或上传函数部署包。\n\n“代码输入类型”配置项选择“在线编辑”时,您可在创建函数界面集成的WebIDE区域在线编辑函数代码。WebIDE的详细使用方法请参见WebIDE。\n“代码输入类型”配置项选择“*.zip文件”时,点击即可上传函数部署包,也可直接拖曳zip文件至虚线框内。\n\nWebIDE\n\n当“代码输入类型”配置项选择“在线编辑”时,创建函数界面中集成了WebIDE功能,支持在线编辑函数代码。\n\n注意\n\n如果在函数实例已经运行的情况下进行函数代码或配置更新,云函数后台会滚动更新函数实例,请您耐心等待10-20秒。\n\nWebIDE从左至右分两个部分:目录树、代码编辑器和最大化,如下图所示。编辑完成后平台会生成部署包并上传。\n\n组成\n\n\t\n\n说明\n\n\n\n\n目录树\n\n\t\n\n目录树支持如下能力:\n\n新增文件夹:选中一个文件或文件夹,点击右上角新增文件夹按钮“”。若选中的是文件夹,则新增一个子文件夹。若选中的是文件,则新增一个同级文件夹。\n新增文件:选中一个文件或文件夹,点击右上角新增文件按钮“”。若选中的是文件夹,则新增一个子文件。若选中的是文件,则新增一个同级文件。\n删除文件:选中一个文件或文件夹,点击右侧删除按钮“”,删除文件或文件夹。不允许删除根目录。\n重命名:双击文件或文件夹,输入新名称(仅支持字母、数字、下划线和中划线),完毕后按Enter键完成重命名。\n\n\n\n编辑器\n\n\t\n\n编辑器具有如下能力:\n\n语法高亮:按照node.js或python语法高亮显示代码。\n语法校验:语法有错误时会给出错误提示。\n代码提示:输出代码自动给出相关代码提示。\n代码填充:选择后系统代码可自动填充。\n格式化:快捷键Ctrl+Shift+B。\n支持快捷键操作:Ctrl+v, Ctrl+c, Ctrl+z, Ctrl+x, Ctrl+f, Ctrl+/等。\n\n\n\n最大化\n\n\t\n\n点击最大化按钮,可以最大化在线编辑区,再次点击按钮或按ESC键退出最大化。\n\n层配置\n\n层可以为您提供公共依赖库的发布与部署能力。您可以将函数依赖的公共库和相关依赖项提炼到层,通过为函数绑定层,便可以在函数中使用库,而不必将库包含在函数的代码包中,从而达到缩小函数代码包体积与缩短函数部署时间的效果,也避免了使用函数代码安装和打包依赖项时可能出现的错误。详细的层管理功能,请参见层管理。\n\n如果您尚未创建层,可跳过下述步骤,直接点击页面底部的“创建”完成函数定义,后续创建层之后可在函数详情页再进行层配置,为函数绑定层。如果您在创建函数之前已创建层,可按照下述步骤进行操作。\n\n进入“层配置”页面,点击“绑定层”。\n\n在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。一个函数最多可以绑定5个层。\n说明\n\n选择层时,层的兼容运行时需与函数运行环境相符,系统会自动完成过滤。若无匹配的层供您选择,请参考创建层创建相同运行环境的层后再进行绑定。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。\n\n返回到“层配置”界面,绑定成功的层将展示在层列表中。若您需要解除层与函数的绑定关系,点击“解绑”即可。\n\n按照“函数配置 -> 触发器 -> 函数代码 -> 层配置”顺序配置过程中,您若需要修改前面步骤中的配置,可点击“上一步”进行回退,配置完成后点击“创建”提交函数定义。\n更多信息\n\n函数配置完成后,您可以查看函数实例、修改函数高级配置。\n\n配置前准备\n配置函数管理功能\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n创建函数\n函数配置\n触发器\n函数代码\n层配置\n更多信息\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "配置项", + "说明" + ], + [ + "函数名称", + "函数的名称。" + ], + [ + "描述", + "函数的描述信息。" + ], + [ + "触发方式", + "请配置为“事件调用”。 “事件调用”表示通过触发器方式调用函数。" + ], + [ + "超时时长", + "函数最大运行时长,超过该时长,则默认函数执行失败,单位为秒,取值范围为1~1800。 说明 “同步”调用方式时,函数最大运行时长为55秒。 “异步”调用方式时,函数最大运行时长为1800秒。" + ], + [ + "实例并发", + "函数请求并发量上限,单位为个,取值范围为1~10000。" + ], + [ + "环境变量", + "key-value形式,您可以将需要的变量配置信息传入函数执行环境中,用于函数在运行时读取和使用。" + ] + ], + "section": "函数配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1642414486331" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section898842219323" + }, + { + "location": "", + "rows": [ + [ + "配置项", + "说明" + ], + [ + "运行环境", + "函数容器的运行环境。 因业务调整需要,新创建的函数不再支持java、python、custom-runtime运行环境,仅支持选择nodejs 20.x/latest(选择latest时表示使用最新版本)。" + ], + [ + "内存配置", + "函数容器所占有的内存大小,单位为MB,取值范围:500,1000,2000,4000。" + ], + [ + "代码输入类型", + "包括“在线编辑”与“*.zip文件”两种方式,默认值为“在线编辑”。 运行环境java和custom-runtime仅支持ZIP包上传。 如选择“*.zip文件”方式部署云函数,入口方法文件的编写方法和函数部署包结构,请参见“开发函数”下对应运行环境的“入口方法”和“准备函数部署包”章节。" + ], + [ + "函数入口", + "包括入口文件名称和入口方法名称,通过“.”连接。例如handler.myHandler,其中handler为入口文件名称,myHandler为入口方法名称。 nodejs和python运行环境下入口文件必须放置在函数部署包的根目录下。具体请参见“开发函数”下对应运行环境的“准备函数部署包”章节。 java运行环境下函数入口支持包名.入口类::入口方法和包名.入口类两种格式,包名、类名、方法名均以字母或下划线开头,支持数字字母下划线,且长度不能超过64个字符,包的层级不超过16。例如faas.HelloPojo::handleRequest,其中faas为包名,HelloPojo为入口类名,handleRequest为入口方法名。 custom-runtime运行环境下函数入口默认为\"/invoke\",且不支持修改。" + ], + [ + "代码文件", + "用于在线编辑函数代码或上传函数部署包。 “代码输入类型”配置项选择“在线编辑”时,您可在创建函数界面集成的WebIDE区域在线编辑函数代码。WebIDE的详细使用方法请参见WebIDE。 “代码输入类型”配置项选择“*.zip文件”时,点击即可上传函数部署包,也可直接拖曳zip文件至虚线框内。" + ] + ], + "section": "函数代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411" + }, + { + "location": "", + "rows": [ + [ + "组成", + "说明" + ], + [ + "目录树", + "目录树支持如下能力: 新增文件夹:选中一个文件或文件夹,点击右上角新增文件夹按钮“”。若选中的是文件夹,则新增一个子文件夹。若选中的是文件,则新增一个同级文件夹。 新增文件:选中一个文件或文件夹,点击右上角新增文件按钮“”。若选中的是文件夹,则新增一个子文件。若选中的是文件,则新增一个同级文件。 删除文件:选中一个文件或文件夹,点击右侧删除按钮“”,删除文件或文件夹。不允许删除根目录。 重命名:双击文件或文件夹,输入新名称(仅支持字母、数字、下划线和中划线),完毕后按Enter键完成重命名。" + ], + [ + "编辑器", + "编辑器具有如下能力: 语法高亮:按照node.js或python语法高亮显示代码。 语法校验:语法有错误时会给出错误提示。 代码提示:输出代码自动给出相关代码提示。 代码填充:选择后系统代码可自动填充。 格式化:快捷键Ctrl+Shift+B。 支持快捷键操作:Ctrl+v, Ctrl+c, Ctrl+z, Ctrl+x, Ctrl+f, Ctrl+/等。" + ], + [ + "最大化", + "点击最大化按钮,可以最大化在线编辑区,再次点击按钮或按ESC键退出最大化。" + ] + ], + "section": "函数代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section199191428193411" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "版本", + "存在多个层版本时,选择函数绑定的层版本。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。 nodejs java python custom-runtime" + ], + [ + "层描述", + "层的附加说明,长度不超过1024位。" + ] + ], + "section": "层配置", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304#section1054343663416" + } + ], + "title": "创建并配置函数" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip\n |---相关配置项" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-management-0000001517922200", + "title": "函数管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-flow-manage-0000001658598194", + "title": "流量治理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "title": "创建层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "title": "更新层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "title": "删除层版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "title": "删除层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "title": "查询层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "title": "将函数绑定层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "title": "将函数解绑层" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "云函数支持一个函数最多可以绑定5个层。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Node.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---nodemodule.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---node_modules" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---moment //相关依赖项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Java层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---libdemo.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---config" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---application.properties //相关配置文件" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---lib" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---*.jar //相关jar依赖" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "Python层结构:\n|---layer.zip\n |---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---layer.zip" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "|---相关配置项" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发者开发云函数代码,通过相对路径的形式引用依赖。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section14923122414189", + "text": "开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在云函数主界面,选择“层”页签。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "在层管理页面,点击“创建层”。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572", + "text": "点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击您已创建的层,进入层详情页面。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。" + }, + { + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570", + "text": "点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "删除层版本,已经绑定在函数中的层不会失效。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "在您已创建的层列表中,找到待删除的层,点击层进入详情页。" + }, + { + "section": "删除层版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section35926165914", + "text": "点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。" + }, + { + "section": "删除层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section163581231182117", + "text": "删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "我的:开发者自己创建的。" + }, + { + "section": "查询层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1281515482110", + "text": "共享:同项目+同团队下共享的。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "一个函数最多可以绑定5个层。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。" + }, + { + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174", + "text": "返回到“层配置”界面,绑定成功的层将展示在层列表中。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + }, + { + "section": "将函数解绑层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section725011614010", + "text": "此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。" + } + ], + "renderedText": "指南\n云函数\n函数管理\n层管理\n层管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n层是包含库和相关依赖项的ZIP存档包。通过为函数绑定层,您可以在函数中使用库,而不必将库包含在云函数的部署程序包中。\n\n云函数支持层的管理,为您提供公共依赖库的部署与发布能力。通过层来管理具有通用性或不变性的依赖、静态文件等,以此精炼云函数代码,从而达到缩小代码包大小与缩短部署时间的效果。\n\n云函数支持一个函数最多可以绑定5个层。\n\n注意\n\n上传的层包大小限制在150MB以内,解压后的层包大小限制在300MB以内。\n\nNode.js层结构:\n|---nodemodule.zip\n |---相关配置项\n |---node_modules\n |---moment //相关依赖项\nJava层结构:\n|---libdemo.zip\n |---config\n |---application.properties //相关配置文件\n |---lib\n |---*.jar //相关jar依赖\nPython层结构:\n|---layer.zip\n |---相关配置项\n\n具体使用场景举例如下:\n\n开发者开发云函数代码,通过相对路径的形式引用依赖。\n依赖打包:按照层文件要求,将依赖单独封装为一个zip包,创建层layer1时上传此zip包。\n函数打包:按照函数打包要求,将其余未打包的代码文件,单独封装成一个函数zip包,创建云函数并上传。\n开发创建第二个云函数,可直接引用层layer1中的依赖。一份依赖文件不需要在两个云函数的代码包中重复上传,从而减少了函数代码包的大小和部署时间。\n创建层\n在云函数主界面,选择“层”页签。\n在层管理页面,点击“创建层”。\n\n页面右侧抽屉式滑出“创建层”窗口,配置“层名称”、“层范围”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n层描述\n\n\t\n\n对正在创建层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n团队内共享\n项目内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入类型,仅支持上传zip文件。\n\n说明\n\nZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“创建层”,保存层信息,您已创建的层将展示在层列表中。\n\n更新层\n\n发布的层版本会按序累加,例如:最新的层版本是1,删除版本1后,再发布层版本,此时版本是2。\n\n点击您已创建的层,进入层详情页面。\n点击右侧“发布”,右侧抽屉式滑出“发布层版本”窗口。\n在“发布层版本”窗口中配置“层范围”、“兼容运行时”、“代码输入类型”等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层描述\n\n\t\n\n对正在创建的层的附加说明。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。支持多选。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n代码输入类型\n\n\t\n\n代码输入的文件类型,zip文件。\n\n说明\n\nZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。\n\n\n\n\n选择文件\n\n\t\n\n选择上传的zip文件。\n\n点击右下角“发布层版本”,保存层的版本信息,您已创建的新版本层将展示在层详情页版本列表中。\n\n删除层版本\n\n删除层版本,已经绑定在函数中的层不会失效。\n\n在您已创建的层列表中,找到待删除的层,点击层进入详情页。\n点击待删除层版本右侧“操作”列的“删除”,即可删除层版本。当所有层版本被删除时,层即被删除。\n\n删除层\n\n在您已创建的层列表中,找到待删除的层,点击右侧对应“操作”列的“删除”。\n\n注意\n\n删除层将同步删除层中的所有版本,不可恢复,请您谨慎操作。\n\n查询层\n进入层列表管理页面,在搜索框中通过层名称进行模糊搜索。\n如果您需要选择模糊搜索的范围,您可以通过点击“我的”和“共享”两个页签来进行过滤,在层列表中将展示相应的查询结果。\n我的:开发者自己创建的。\n共享:同项目+同团队下共享的。\n\n将函数绑定层\n在函数别表中点击函数名称,进入函数详情页面。选择“层配置”页签,点击右上角的“绑定层”。\n\n在右侧弹出的“绑定层”界面中,下拉框选择“层名称”和“版本”,“层范围”等信息根据层的配置将被自动填充,完成层绑定后点击“确定”。\n注意\n一个函数最多可以绑定5个层。\n选择层时,层的兼容运行时需与函数运行环境相符,否则系统报错,绑定层失败。\n\n参数\n\n\t\n\n说明\n\n\n\n\n层名称\n\n\t\n\n层的名称。重复时自动在同名的层中创建一个新版本。\n\n\n\n\n版本\n\n\t\n\n存在多个层版本时,选择函数绑定的层版本。\n\n\n\n\n层范围\n\n\t\n\n层的共享范围。\n\n项目内共享\n团队内共享\n\n\n\n兼容运行时\n\n\t\n\n层使用的语言环境。\n\nnodejs\njava\npython\ncustom-runtime\n\n\n\n层描述\n\n\t\n\n层的附加说明,长度不超过1024位。\n\n返回到“层配置”界面,绑定成功的层将展示在层列表中。\n\n将函数解绑层\n进入函数详情页,选择“层配置”页签。可在文本框中输入层名称进行模糊筛选。\n\n点击层名称对应“操作”列的“解绑”,然后在“提示”弹出框中点击“确定”,函数与层解绑成功。\n说明\n\n此处只是解除了函数与层的绑定关系,并没有真正删除层数据。如果您需要真正删除层数据,具体请参见删除层。\n\n流量治理\n触发器管理\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建层\n更新层\n删除层版本\n删除层\n查询层\n将函数绑定层\n将函数解绑层\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "层描述", + "对正在创建层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 团队内共享 项目内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入类型,仅支持上传zip文件。 说明 ZIP包大小最大为150MB,解压后最大300MB,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "创建层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section11358162018572" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层描述", + "对正在创建的层的附加说明。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。支持多选。 nodejs java python custom-runtime" + ], + [ + "代码输入类型", + "代码输入的文件类型,zip文件。 说明 ZIP包大小最大为150M,解压后最大300M,文件数最多不超过30000个。" + ], + [ + "选择文件", + "选择上传的zip文件。" + ] + ], + "section": "更新层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section1788095013570" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "层名称", + "层的名称。重复时自动在同名的层中创建一个新版本。" + ], + [ + "版本", + "存在多个层版本时,选择函数绑定的层版本。" + ], + [ + "层范围", + "层的共享范围。 项目内共享 团队内共享" + ], + [ + "兼容运行时", + "层使用的语言环境。 nodejs java python custom-runtime" + ], + [ + "层描述", + "层的附加说明,长度不超过1024位。" + ] + ], + "section": "将函数绑定层", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624#section377305318174" + } + ], + "title": "层管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-call-via-httptrigger-0000001512012404", + "title": "通过HTTP触发器调用函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/call-function-via-httptrigger-harmony-ts-api6-0000001603898345", + "title": "HarmonyOS(TypeScript API 6)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-function-harmony-ts-api6-0000001603903557", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-version-0000001301351404", + "title": "版本管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949", + "title": "别名管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-environment-0000001706997573", + "title": "环境变量" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-flow-manage-0000001658598194", + "title": "流量治理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-api6-create-and-config-func-0000001665128304", + "title": "创建并配置函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/harmony-ts-api6-test-func-0000001603906413", + "title": "测试函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/configure-func-manage-api6-0000001663966422", + "text": "完成创建云函数后,开发者可以根据需要选择配置版本管理、别名管理、环境变量、流量治理、层管理的函数管理功能。" + } + ], + "renderedText": "指南\n云函数\n通过HTTP触发器调用函数\nHarmonyOS(TypeScript API 6)\n创建函数\n配置函数管理功能\n配置函数管理功能\n更新时间: 2024-11-06 16:42\n\n完成创建云函数后,开发者可以根据需要选择配置版本管理、别名管理、环境变量、流量治理、层管理的函数管理功能。\n\n功能\n\n\t\n\n说明\n\n\n\n\n版本管理\n\n\t\n\n开发者可通过发布多个版本完成函数的迭代开发,以维护版本的形式来完成函数的更新与回退,提高运维的效率。\n\n通常同一个函数需要创建第二个版本时,则需要配置此功能。\n\n\n\n\n别名管理\n\n\t\n\n开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n\n\n\n环境变量\n\n\t\n\n开发者可配置环境变量,将需要的变量配置信息传入函数执行环境,用于函数在运行时读取和使用。\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n\n\n\n流量治理\n\n\t\n\n流量治理为系统可靠运行提供保障。您可以针对云函数常见故障模式,选择负载均衡、重试、熔断等策略进行配置。\n\n建议您在业务运行期间,根据业务运行状态和指标,动态更新流量治理策略。\n\n\n\n\n层管理\n\n\t\n\n开发者可通过层来管理具有通用性或不变性的依赖、静态文件等以此精炼云函数代码,从而达到减少云函数代码包大小与部署时间的效果。\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n创建并配置函数\n测试函数\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/configure-func-manage-api6-0000001663966422", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "功能", + "说明" + ], + [ + "版本管理", + "开发者可通过发布多个版本完成函数的迭代开发,以维护版本的形式来完成函数的更新与回退,提高运维的效率。 通常同一个函数需要创建第二个版本时,则需要配置此功能。" + ], + [ + "别名管理", + "开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。 此功能为可选功能,请开发者根据实际需要来选择使用。" + ], + [ + "环境变量", + "开发者可配置环境变量,将需要的变量配置信息传入函数执行环境,用于函数在运行时读取和使用。 此功能为可选功能,请开发者根据实际需要来选择使用。" + ], + [ + "流量治理", + "流量治理为系统可靠运行提供保障。您可以针对云函数常见故障模式,选择负载均衡、重试、熔断等策略进行配置。 建议您在业务运行期间,根据业务运行状态和指标,动态更新流量治理策略。" + ], + [ + "层管理", + "开发者可通过层来管理具有通用性或不变性的依赖、静态文件等以此精炼云函数代码,从而达到减少云函数代码包大小与部署时间的效果。 此功能为可选功能,请开发者根据实际需要来选择使用。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/configure-func-manage-api6-0000001663966422" + } + ], + "title": "配置函数管理功能" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "字母(A-Z或a-z)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "数字(0-9)" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "getcache" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/registration-and-verification-0000001053628148", + "title": "账号注册认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-debug-cert-0000002283256797", + "title": "申请调试证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E8%AE%BE%E5%A4%87%E8%BF%9E%E6%8E%A5%E7%AE%A1%E7%90%86", + "title": "设备连接管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98", + "title": "常见问题" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%87%86%E5%A4%87", + "title": "调试准备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%88%87%E6%8D%A2shell%E7%8E%AF%E5%A2%83", + "title": "切换shell环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "调试命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E6%A0%BC%E5%BC%8F", + "title": "命令格式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E9%80%89%E9%A1%B9", + "title": "命令选项" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E6%AD%A3%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "正常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "prefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "当前命令行工具支持的命令集如下:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "使用命令行工具调试周期性预加载之前,需要完成以下准备工作:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "prefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "调试命令", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试命令", + "text": "命令名“getcache”,提供获取周期性预加载数据的能力。" + }, + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n调试周期性预加载\n调试周期性预加载\n更新时间: 2026-04-20 14:34\n复制页面\n\nprefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。\n\n当前命令行工具支持的命令集如下:\n\n命令名\t描述\ngetcache\t提供获取周期性预加载数据的能力。\n调试准备\n\n使用命令行工具调试周期性预加载之前,需要完成以下准备工作:\n\n您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。\n\n您已在本地安装DevEco Studio 5.0.3 Release及以上版本。\n\n手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。\n\n设置HAP包的“Build Mode”为“debug”,且已申请调试证书。\n\n切换shell环境\n\nprefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。\n\nPC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。\n\n打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。\n\n输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。\n\n调试命令\n\n命令名“getcache”,提供获取周期性预加载数据的能力。\n\n命令格式\ncf_prefetch getcache -m \n命令选项\n命令选项\t必填(M)/选填(O)\t描述\t示例\n-m\tM\t应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。\tcf_prefetch getcache -m com.huawei.hms.xs.test\n调用示例\n正常场景\n\n输入cf_prefetch help,获取命令行工具的使用说明。\n\n输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。\n\n输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。\n\n异常场景\n\n链路不通,例如无网络情况;或周期性预加载配置不正确。\n\n命令行工具内部错误。\n\nHAP包非debug调试模式。\n\n应用包名输入错误。\n\n(可选)使用命令行工具调试周期性预加载\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n调试准备\n切换shell环境\n调试命令\n命令格式\n命令选项\n调用示例\n正常场景\n异常场景\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "命令名", + "描述" + ], + [ + "getcache", + "提供获取周期性预加载数据的能力。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug" + }, + { + "location": "", + "rows": [ + [ + "命令选项", + "必填(M)/选填(O)", + "描述", + "示例" + ], + [ + "-m", + "M", + "应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。", + "cf_prefetch getcache -m com.huawei.hms.xs.test" + ] + ], + "section": "命令选项", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令选项" + } + ], + "title": "调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "title": "功能概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "title": "创建别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "title": "查看别名列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "title": "删除别名" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "title": "基于别名的灰度能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "title": "权重策略" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "title": "规则策略" + } + ], + "notes": [ + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "此功能为可选功能,请开发者根据实际需要来选择使用。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "具体使用场景举例如下:" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。" + }, + { + "section": "功能概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1546919259159", + "text": "如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "名称:别名名称,此函数下必须唯一。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "描述:别名描述,长度不超过64个字符。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "主版本:别名指向的主版本,创建后支持修改。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。" + }, + { + "section": "创建别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section92991051103413", + "text": "创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "查看别名列表有两种方式:" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "查看别名列表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section203872584342", + "text": "方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。" + }, + { + "section": "删除别名", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section1393987193515", + "text": "点击右侧“操作”列的“删除”即可删除别名。" + }, + { + "section": "基于别名的灰度能力", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section173761114132110", + "text": "别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "权重策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section15783432183", + "text": "图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "“灰度规则模板”选择“新建模板”。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。" + }, + { + "section": "规则策略", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949#section8669202315446", + "text": "配置完成后,点击“保存”。" + } + ], + "renderedText": "别名管理\n更新时间: 2026-10-20 16:24\n功能概述\n注意\n\n此功能为可选功能,请开发者根据实际需要来选择使用。\n\n别名是可以指向一个或两个版本的指针,是函数的一种资源,且别名无法脱离函数或版本单独存在。云函数支持别名管理功能,基于云函数的版本功能,管理调用云函数的流量控制。开发者可通过创建的别名来控制要访问的云函数版本,基于别名来管理函数调用,避免了切换版本时要反复修改调用云函数部分的代码。\n\n具体使用场景举例如下:\n\n发布版本1\n\n在创建函数($latest 版本)后,先发布版本1,然后创建名为alias1且指向版本1的别名。\n开发者开发客户端代码,通过使用别名alias1的方式,访问函数的版本1,开始提供服务。\n发布版本2\n\n当函数需要升级时,先更新$latest 版本,发布更新后的稳定版本(版本 2),将alias1别名从指向版本1变更为指向版本2,开发者(调用方)无需变动调用函数的代码即可完成版本切换。\n如果发现问题,可以通过将alias1别名重新指向版本1,即可轻松将版本回滚到版本1。\n创建别名\n在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,点击“创建”。\n\n在右侧抽屉式滑出的“创建别名”界面中,输入别名的名称、描述、路由方法与关联版本,完成后点击“创建”。\n名称:别名名称,此函数下必须唯一。\n描述:别名描述,长度不超过64个字符。\n主版本:别名指向的主版本,创建后支持修改。\n路由方法:支持权重(按配置的权重比例来分配流量)和规则(按配置的特定规则来分配流量)两种。\n灰度版本:别名支持两个版本间的灰度能力,通过权重或者规则配置,将别名上的流量按比例或者按规则在两个版本之间转移,具体参见基于别名的灰度能力。\n\n创建别名后,在别名列表中点击别名名称进入别名详情页,可在不同页签下修改别名描述、关联版本、路由方法,以及在别名上配置触发器。\n\n查看别名列表\n\n查看别名列表有两种方式:\n\n方式一:在函数列表中点击函数名称右侧“操作”列的“别名”,直接跳转至别名详情页面,可以查看函数的别名列表及关联的版本信息。\n\n方式二:在函数列表中点击函数名称,进入函数详情页面。选择“别名”页签,可以查看函数的别名列表及关联的版本信息。\n\n删除别名\n在函数详情页面,选择“别名”页签。在文本框中输入需要删除的别名关联的主版本,对别名进行筛选。\n点击右侧“操作”列的“删除”即可删除别名。\n\n基于别名的灰度能力\n\n别名支持版本间的灰度能力,您可以为别名指向的两个版本配置路由策略,别名上的流量将按您配置的策略流向不同版本,帮助您轻松实现发布、回滚以及灰度发布等需求。\n\n权重策略\n\n通过权重配置,将别名上的流量按比例指向不同版本,满足业务实现版本灰度上线与版本流量切换的场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“权重”,“灰度版本”选中需要转移流量的版本,通过为两个版本配置“权重”实现转移流量的目标。\n\n图中所示,alias1别名指向版本1,同时分流百分之20的流量到版本$latest上。配置完成后点击“保存”。\n\n规则策略\n\n通过规则配置,将别名上的流量按灰度规则指向特定版本,满足业务特定灰度场景。\n\n在函数详情页面,选择“别名”页签。在别名列表中,点击需要配置的别名,进入编译别名页面。\n\n选择“路由”页签,“路由方法”选择“规则”。当存在多个配置子项时,可通过“配置子项关系”配置匹配方式。规则信息可直接编辑,也可选择或者新增灰度规则模板。\n直接编辑灰度规则\n\n“灰度规则模板”保持为空,选择“配置子项关系”,设置请求头header的userid为“1001“,符合此条件的数据请求会灰度到函数版本1。\n\n新建灰度规则模板,且支持再编辑\n“灰度规则模板”选择“新建模板”。\n\n在右侧弹出的“创建灰度规则模板”页面中,选择“配置子项关系”,配置规则子项,比如设置请求头header的userid为“1002“,然后点击“创建”完成模板定义。\n\n返回到“路由策略”页签,“灰度规则模板”选择“tep1”,规则子项将被自动填充,且可点击子项右边的添加新的规则子项,符合条件的数据请求会灰度到函数版本1。\n\n配置完成后,点击“保存”。\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能概述\n创建别名\n查看别名列表\n删除别名\n基于别名的灰度能力\n权重策略\n规则策略\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-aliasname-0000001568841949", + "status": "browser-read", + "tables": [], + "title": "别名管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "title": "HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-authtrigger-0000001658717860", + "title": "认证服务触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-cloudstorage-trigger-0000001706837169", + "title": "云存储触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "title": "定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-trigger-event-0000001620581529", + "title": "event对象" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-layer-0000001517762624", + "title": "层管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "概述" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "HTTP触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云数据库触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "认证服务触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "云存储触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "远程配置触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "定时触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "删除触发器" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "text": "event对象" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n触发器管理\n更新时间: 2026-04-16 14:17\n概述\n\nHTTP触发器\n\n云数据库触发器\n\n认证服务触发器\n\n云存储触发器\n\n远程配置触发器\n\n定时触发器\n\n删除触发器\n\nevent对象\n\n层管理\n概述\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "status": "browser-read", + "tables": [], + "title": "触发器管理" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "title": "管理模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "title": "Serverless模板开发" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477", + "title": "主要功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719", + "title": "使用流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "text": "HarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。" + } + ], + "renderedText": "指南\nServerless模板\n业务介绍\n业务介绍\n更新时间: 2026-10-20 16:24\n\nHarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。\n\n主要功能\n\n主要功能\n\n\t\n\n功能描述\n\n\n\n\n构建丰富的Serverless能力\n\n\t\n\n基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。\n\n\n\n\n简化开发与运维\n\n\t\n\n快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。\n\n使用流程\n\n序号\n\n\t\n\n步骤\n\n\t\n\n详情\n\n\n\n\n1\n\n\t\n\n部署Serverless模板\n\n\t\n\n您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。\n\n\n\n\n2\n\n\t\n\n管理Serverless模板\n\n\t\n\n您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。\n\n\n\n\n3\n\n\t\n\n使用Serverless模板\n\n\t\n\n您可以根据模板中的使用指导使用模板。\n\nServerless模板开发\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n主要功能\n使用流程\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "主要功能", + "功能描述" + ], + [ + "构建丰富的Serverless能力", + "基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。" + ], + [ + "简化开发与运维", + "快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。" + ] + ], + "section": "主要功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477" + }, + { + "location": "", + "rows": [ + [ + "序号", + "步骤", + "详情" + ], + [ + "1", + "部署Serverless模板", + "您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。" + ], + [ + "2", + "管理Serverless模板", + "您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。" + ], + [ + "3", + "使用Serverless模板", + "您可以根据模板中的使用指导使用模板。" + ] + ], + "section": "使用流程", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719" + } + ], + "title": "业务介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/create-and-configure-func-andrioid-0000001665054330", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/trigger-introduction-0000001706837165", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-clouddbtrigger-0000001658558540", + "title": "云数据库触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "title": "创建HTTP触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "text": "您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + }, + { + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\nHTTP触发器\nHTTP触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置HTTP触发器,配置完成后会生成触发URL,在您向该URL发起HTTP请求时将触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建HTTP触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,右侧弹出触发器创建界面。\n在“添加触发器”弹出框中,“触发器类型”选择“HTTP触发器”,并配置“请求方式”和“认证类型”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\nHTTP触发器。\n\n\n\n\n请求方式\n\n\t\n\nHTTP触发器目前仅支持POST请求方式。\n\n\n\n\n认证类型\n\n\t\n\nHTTP触发器的认证类型。\n\nAPI客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。\nAPI客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。\n\n\n\n启用decode\n\n\t\n\n通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到HTTP触发器图框。\n概述\n云数据库触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建HTTP触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "HTTP触发器。" + ], + [ + "请求方式", + "HTTP触发器目前仅支持POST请求方式。" + ], + [ + "认证类型", + "HTTP触发器的认证类型。 API客户端鉴权(Client适用):端侧网关认证,适用于来自APP客户端侧(即本地应用或者项目)的函数调用。 API客户端鉴权(Server适用):云侧网关认证,适用于来自APP服务器侧(即云函数)的函数调用。" + ], + [ + "启用decode", + "通过HTTP触发器触发函数时,对于contentType为“application/x-www-form-urlencoded”的触发请求,是否使用URLDecoder对请求body进行解码再传入到函数中。" + ] + ], + "section": "创建HTTP触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-httptrigger-0000001706957925#section797692814338" + } + ], + "title": "HTTP触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloud-function-trigger-manage-0000001658717856", + "title": "触发器管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/cron-create-and-config-func-0000001664968592", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-remoteconfig-trigger-0000001658558544", + "title": "远程配置触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-deletetrigger-0000001706837173", + "title": "删除触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "title": "创建定时触发器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "text": "您可以为云函数配置定时触发器,在指定的时间点触发云函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section1569311183819", + "text": "您已创建函数。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "点击“触发器”页签下的“添加触发器”,显示触发器创建界面。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + }, + { + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550", + "text": "触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。" + } + ], + "renderedText": "指南\n云函数\n触发器管理\n定时触发器\n定时触发器\n更新时间: 2025-12-05 15:25\n\n您可以为云函数配置定时触发器,在指定的时间点触发云函数。\n\n前提条件\n\n您已创建函数。\n\n创建定时触发器\n在函数列表中点击函数名称进入函数详情页面。如果点击函数名称右侧“操作”列的“别名”,则在别名列表中点击别名名称,进入别名详情页。\n\n点击“触发器”页签下的“添加触发器”,显示触发器创建界面。\n在“添加触发器”页面,“触发器类型”选择“定时触发器”,并配置“触发器名称”、“日程表”、“调用方式”和“启用”状态等信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n触发器类型\n\n\t\n\n定时触发器。\n\n\n\n\n触发器名称\n\n\t\n\n触发器的名称,仅起到显示作用。\n\n\n\n\n事件值\n\n\t\n\n触发函数时传入的事件,即函数的入参。格式为JSON字符串。\n\n\n\n\n日程表\n\n\t\n\n触发函数的时间计划。支持如下两种格式:\n\nEvery表达式\n\n@every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。\n\nCron表达式\ncron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式\nMinutes:值范围0-59,支持括号内的特殊字符(, - * /)\nHours:值范围0-23,支持括号内的特殊字符(, - * /)\nDay-of-month:值范围1-31,支持括号内的特殊字符(, - * /)\nMonth-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /)\nDay-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * )\n说明\n\ncron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。\n\n\n\n\n调用方式\n\n\t\n\n支持同步调用和异步调用。\n\n\n\n\n启用\n\n\t\n\n是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。\n\n触发器配置完成后点击“确定”保存触发器,则回到触发器列表,可看到定时触发器图框。\n\n远程配置触发器\n删除触发器\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n前提条件\n创建定时触发器\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "触发器类型", + "定时触发器。" + ], + [ + "触发器名称", + "触发器的名称,仅起到显示作用。" + ], + [ + "事件值", + "触发函数时传入的事件,即函数的入参。格式为JSON字符串。" + ], + [ + "日程表", + "触发函数的时间计划。支持如下两种格式: Every表达式 @every value unit格式,其中value为一个正整数,unit可以为“s”、“m”、“h”,表示每隔value unit的时间触发一次函数。例如,“@every 6m” 表示每隔6分钟触发一次函数。 Cron表达式 cron(Minute Hour Day-of-month Month-of-year Day-of-week)格式,即kubernetes cronjob支持的标准的cron表达式的形式 Minutes:值范围0-59,支持括号内的特殊字符(, - * /) Hours:值范围0-23,支持括号内的特殊字符(, - * /) Day-of-month:值范围1-31,支持括号内的特殊字符(, - * /) Month-of-year:值范围1-12或JAN-DEC,支持括号内的特殊字符(, - * /) Day-of-week:值范围0-6或SUN-SAT,支持括号内的特殊字符(, - * ) 说明 cron在欧洲站点以UTC时间运行,在非欧洲站点以北京时间运行。" + ], + [ + "调用方式", + "支持同步调用和异步调用。" + ], + [ + "启用", + "是否启用该触发器,默认为不启用。由于定时触发器配置完成后暂不支持修改启用状态,请配置为“是”以启用触发器。" + ] + ], + "section": "创建定时触发器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-cloudfunction-crontrigger-0000001658717864#section176113174550" + } + ], + "title": "定时触发器" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-imgcrop-0000001269535810", + "title": "图片尺寸调整模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-clearuser-0000001318455685", + "title": "用户数据删除模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-maxrow-0000001269535814", + "title": "数据库记录数限制模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-shortenurl-0000001270513938", + "title": "短URL生成模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-0000001322811985", + "title": "游戏排行榜模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "title": "业务介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "抽奖活动模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "图片尺寸调整模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "用户数据删除模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "数据库记录数限制模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "短URL生成模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "游戏排行榜模板" + } + ], + "renderedText": "指南\nServerless模板\nServerless模板开发\nServerless模板开发\n更新时间: 2025-08-13 09:38\n抽奖活动模板\n\n图片尺寸调整模板\n\n用户数据删除模板\n\n数据库记录数限制模板\n\n短URL生成模板\n\n游戏排行榜模板\n\n业务介绍\n抽奖活动模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "status": "browser-read", + "tables": [], + "title": "Serverless模板开发" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-restrict-0000001272332252", + "title": "使用限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-use_template-0000001320585441", + "title": "使用模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "title": "升级版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "title": "重试部署" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "text": "当模板发布新版本时,还可以选择升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "查看新版本模板的版本说明,确认后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "配置该Serverless服务需要的参数,配置完成后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在升级版本页面,点击“开始升级”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。" + }, + { + "section": "重试部署", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "text": "当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。" + } + ], + "renderedText": "指南\nServerless模板\n管理模板\n管理模板\n更新时间: 2026-10-20 16:24\n\n当模板发布新版本时,还可以选择升级模板。\n\n升级版本\n\n当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。\n选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。\n\n查看新版本模板的版本说明,确认后点击“下一步”。\n\n配置该Serverless服务需要的参数,配置完成后点击“下一步”。\n\n在升级版本页面,点击“开始升级”。\n\n注意\n\n如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。\n\n重试部署\n\n当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。\n\n使用限制\n使用模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n升级版本\n重试部署\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "status": "browser-read", + "tables": [], + "title": "管理模板" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001080569968#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-clouddbzonequery-0000001490956316#section674451616598", + "title": "CloudDBZoneQueryPolicy" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#ZH-CN_TOPIC_0000002735248088__zh-cn_topic_0000001080429120_table5159841103210", + "title": "权限配置表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-startfromhere-0000001569428721", + "title": "从这里开始" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-createfirstclouddb-0000001569588629", + "title": "创建第一个数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "Android应用请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "HarmonyOS(Java)请参见CloudDBZoneQueryPolicy" + }, + { + "section": "概述", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section141567855717", + "text": "基于云数据库的应用开发流程如下图所示。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。" + }, + { + "section": "数据模型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section11041459175716", + "text": "对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。" + }, + { + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114", + "text": "云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "在缓存模式的如下场景,端侧用户的数据操作权限如下所示:" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "云数据库定义了如下表所示角色和权限。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。" + }, + { + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "text": "应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。" + } + ], + "renderedText": "指南\n云数据库 for Object\n从这里开始\n数据库模型介绍\n数据库模型介绍\n更新时间: 2026-10-21 17:20\n概述\n\n云数据库的数据同步模式包括缓存模式和本地模式,数据同步以存储区为粒度进行设置。在开发应用时,您可以根据应用需求为每个存储区选择不同的数据同步模式。应用可以仅使用缓存模式或者本地模式,也可以同时使用缓存模式和本地模式。缓存模式和本地模式的具体信息如下:\n\n缓存模式\n\n在该模式下,您可实现数据的端云协同管理,实现端云、多端之间的数据同步。应用数据将储存在云侧,端侧数据是云侧数据的子集,如果允许持久化,云数据库支持将查询的结果自动缓存至端侧。缓存数据时,不会覆盖本地未同步完成的数据。\n\n本地模式\n\n在该模式下,用户仅可操作端侧所包含的本地数据,无法实现数据在端云、多端间的同步。目前Android应用和HarmonyOS(Java)支持配置仅使用本地模式。\n\nAndroid应用请参见CloudDBZoneQueryPolicy\nHarmonyOS(Java)请参见CloudDBZoneQueryPolicy\n\n基于云数据库的应用开发流程如下图所示。\n\n数据模型\n\n云数据库是一款基于对象模型的数据库,采用存储区、对象类型和对象三级结构。在开发应用时,每个应用都会实例化一个云数据库实例,基于该实例,您可以创建多个存储区。\n\n存储区(CloudDBZone)是一个独立的数据存储区域,多个数据存储区相互独立。每个存储区拥有完全相同的对象类型定义,您可以根据业务的需要自定义存储区中存储的对象。\n对象类型(ObjectType)用于定义存储对象的集合,不同的对象类型对应的不同数据结构。每创建一个对象类型,云数据库会在每个存储区实例化一个与之结构相对应的对象类型,用于存储对应的数据。\n对象(CloudDBZoneObject)是云数据库的基本操作单元,每一个对象,都是一条完整的数据记录。\n数据类型\n\n云数据库支持多种数据类型,如下表所示,描述了支持的各种数据类型及其排序说明。\n\n数据类型\n\n\t\n\n描述\n\n\t\n\n取值范围\n\n\t\n\n说明\n\n\t\n\n排序方式\n\n\n\n\nString\n\n\t\n\n字符串类型\n\n\t\n\n最大长度200\n\n\t\n\n如果字符串长度超过200,建议使用Text类型。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nBoolean\n\n\t\n\n布尔类型\n\n\t\ntrue:真\nfalse:假\n\t\n\n-\n\n\t\n\nfalse < true\n\n\n\n\nByte\n\n\t\n\n单字节整型\n\n\t\n\n-128 ~ +127\n\n\t\n\n-\n\n\t\n\n数字顺序\n\n\n\n\nShort\n\n\t\n\n双字节整型\n\n\t\n\n-32,768 ~ +32,767\n\n\t\n\n-\n\n\n\n\nInteger\n\n\t\n\n四字节整型\n\n\t\n\n-2,147,483,648 ~ +2,147,483,647\n\n\t\n\n-\n\n\n\n\nLong\n\n\t\n\n八字节整型\n\n\t\n\n-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807\n\n\t\n\n由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。\n\n\n\n\nFloat\n\n\t\n\n单精度浮点数\n\n\t\n\n-3.40E+38 ~ +3.40E+38,6位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nDouble\n\n\t\n\n双精度浮点数\n\n\t\n\n-1.79E+308 ~ +1.79E+308,15位十进制有效数字。\n\n\t\n\n-\n\n\n\n\nByteArray\n\n\t\n\n字节数组\n\n\t\n\n-\n\n\t\n\n一般用于文件类型的数据存储,如图片、文档和视频等。\n\n在端侧时,使用Android开发应用时,以byte[]表示为字节数组。\n\n\t\n\n采用 UTF-8 编码的字节顺序\n\n\n\n\nText\n\n\t\n\n文本类型\n\n\t\n\n-\n\n\t\n\n-\n\n\n\n\nDate\n\n\t\n\n日期类型\n\n\t\n\n-\n\n\t\n\n-\n\n\t\n\n时间顺序\n\n\n\n\nIntAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Integer类型(四字节整型)。\n\n\t\n\n1~ 2,147,483,647\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n\n\n\nLongAutoIncrement\n\n\t\n\n自增类型,从1开始自增,Long类型(八字节整型)。\n\n\t\n\n1~ 9,223,372,036,854,775,807\n\n\t\n\nAndroid、HarmonyOS(Java)和iOS不支持此数据类型。\n\n\t\n\n数字顺序\n\n权限管理\n\n云数据库支持对所有用户的访问进行鉴权,保障应用数据的安全。云侧访问云数据库的用户角色默认为管理员角色,即从HarmonyOS 开发者中心、云函数和Server端访问云数据库的角色,该角色默认拥有所有权限。端侧为应用程序运行端,端侧的数据操作有严格的安全规则限制,其数据的读写权限根据云侧权限配置表进行控制。\n\n云数据库支持基于缓存模式和本地模式的应用开发,不同的模式下,数据的权限管理也不一致。\n\n在缓存模式下,在端侧和云侧建立数据同步通道后,端侧会将云侧的权限管理表同步至端侧,端侧会按照该权限管理表对数据进行权限控制。\n在本地模式下,端侧的数据操作不受云侧权限管理表的影响,端侧对其包含的数据具有全部的操作权限。\n\n在缓存模式的如下场景,端侧用户的数据操作权限如下所示:\n\n用户安装应用后,端侧应用第一次和云侧建立同步通道之前,端侧用户无任何权限。在端侧应用从云侧获取到权限管理表之后,端侧用户权限按照权限配置表进行分配。\n端侧用户因认证信息失效(如离线持续时间超过认证信息的有效时间)或者注销认证后,端侧用户的角色由“认证用户”转变为“所有人”,此时端侧用户所拥有的权限与“所有人”角色的权限一致。\n\n云数据库定义了如下表所示角色和权限。\n\n注意\n应用正式上线后,不允许修改权限配置表,否则会导致已发布版本权限异常。\n应用正式上线后,不允许修改已创建对象类型的权限信息,否则会导致端云之间的数据同步失败。仅支持您在开发调试阶段,修改对象类型的权限信息。\n\n角色\n\n\t\n\nquery\n\n\t\n\nupsert\n\n\t\n\ndelete\n\n\t\n\n说明\n\n\n\n\n所有人\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n代表所有用户,包含认证和非认证用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n但是,不建议将upsert和delete权限配置给所有人角色。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n认证用户\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过HarmonyOS 开发者中心登录认证的用户。\n\n该角色默认拥有query权限,可自定义配置upsert和delete权限。\n\n当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。\n\n\n\n\n数据创建者\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n经过认证的数据创建用户。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。\n\n数据创建者的信息保存在数据记录的系统表中。\n\n\n\n\n管理员\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n✓\n\n\t\n\n应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。\n\n该角色默认拥有所有权限,且可自定义配置所有权限。\n\n管理员可以管理并配置其他角色的权限。\n\n从这里开始\n创建第一个数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n概述\n数据模型\n数据类型\n权限管理\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "数据类型", + "描述", + "取值范围", + "说明", + "排序方式" + ], + [ + "String", + "字符串类型", + "最大长度200", + "如果字符串长度超过200,建议使用Text类型。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Boolean", + "布尔类型", + "true:真 false:假", + "-", + "false < true" + ], + [ + "Byte", + "单字节整型", + "-128 ~ +127", + "-", + "数字顺序" + ], + [ + "Short", + "双字节整型", + "-32,768 ~ +32,767", + "-", + "数字顺序" + ], + [ + "Integer", + "四字节整型", + "-2,147,483,648 ~ +2,147,483,647", + "-", + "数字顺序" + ], + [ + "Long", + "八字节整型", + "-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807", + "由于JavaScript不支持数据类型“Long”,Web SDK通过引入第三方开源组件实现支持数据类型“Long”的能力。“Long”类型的使用方法请参考https://github.com/dcodeIO/long.js。", + "数字顺序" + ], + [ + "Float", + "单精度浮点数", + "-3.40E+38 ~ +3.40E+38,6位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "Double", + "双精度浮点数", + "-1.79E+308 ~ +1.79E+308,15位十进制有效数字。", + "-", + "数字顺序" + ], + [ + "ByteArray", + "字节数组", + "-", + "一般用于文件类型的数据存储,如图片、文档和视频等。 在端侧时,使用Android开发应用时,以byte[]表示为字节数组。", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Text", + "文本类型", + "-", + "-", + "采用 UTF-8 编码的字节顺序" + ], + [ + "Date", + "日期类型", + "-", + "-", + "时间顺序" + ], + [ + "IntAutoIncrement", + "自增类型,从1开始自增,Integer类型(四字节整型)。", + "1~ 2,147,483,647", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ], + [ + "LongAutoIncrement", + "自增类型,从1开始自增,Long类型(八字节整型)。", + "1~ 9,223,372,036,854,775,807", + "Android、HarmonyOS(Java)和iOS不支持此数据类型。", + "数字顺序" + ] + ], + "section": "数据类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13455181316114" + }, + { + "location": "", + "rows": [ + [ + "角色", + "query", + "upsert", + "delete", + "说明" + ], + [ + "所有人", + "✓", + "✓", + "✓", + "代表所有用户,包含认证和非认证用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 但是,不建议将upsert和delete权限配置给所有人角色。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时所有人角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "认证用户", + "✓", + "✓", + "✓", + "经过HarmonyOS 开发者中心登录认证的用户。 该角色默认拥有query权限,可自定义配置upsert和delete权限。 当对象类型中设置了加密字段之后,表示开启全程加密功能,此时认证用户角色将不会拥有query、upsert和delete权限,且不允许修改。" + ], + [ + "数据创建者", + "✓", + "✓", + "✓", + "经过认证的数据创建用户。 该角色默认拥有所有权限,且可自定义配置所有权限。 每条数据都有其对应的数据创建人(即应用用户),每个数据创建者仅可以upsert或者delete自己创建的数据,不能upsert或者delete他人创建的数据。 数据创建者的信息保存在数据记录的系统表中。" + ], + [ + "管理员", + "✓", + "✓", + "✓", + "应用开发者,主要是指通过HarmonyOS 开发者中心或FaaS(Function as a Service,函数即服务)侧访问云数据库的角色。 该角色默认拥有所有权限,且可自定义配置所有权限。 管理员可以管理并配置其他角色的权限。" + ] + ], + "section": "权限管理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121" + } + ], + "title": "数据库模型介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "title": "管理对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole--usage-statistics-0000001146782900", + "title": "查看用量" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-app-data-migration-0000001496843917", + "title": "通过Server SDK将三方数据库内容迁移至云数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "title": "管理对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "text": "管理对象类型" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "text": "管理数据" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "text": "查看用量" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理数据库\n更新时间: 2026-10-21 17:20\n管理对象类型\n\n管理数据\n\n查看用量\n\n通过Server SDK将三方数据库内容迁移至云数据库\n管理对象类型\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "status": "browser-read", + "tables": [], + "title": "管理数据库" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-emulator", + "title": "使用模拟器调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n错误码\n错误码\n更新时间: 2026-04-20 14:34\n复制页面\n错误码\t描述\t解决方法\n1008200005\t周期性预加载执行失败。\t\n\n请从以下方面进行排查:\n\n- 检查设备网络连接情况。\n\n- 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。\n\n- 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。\n\n\n1008200009\t命令行工具内部错误。\t请通过在线工单系统联系技术支持人员定位问题。\n1008240000\tHAP包不在debug模式下。\t请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。\n1008240007\t无法获取当前HAP包信息,例如APP ID等。\t请检查应用包名合法性,输入正确的应用包名。\n调试周期性预加载\n使用模拟器调试\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码", + "描述", + "解决方法" + ], + [ + "1008200005", + "周期性预加载执行失败。", + "请从以下方面进行排查: - 检查设备网络连接情况。 - 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。 - 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。" + ], + [ + "1008200009", + "命令行工具内部错误。", + "请通过在线工单系统联系技术支持人员定位问题。" + ], + [ + "1008240000", + "HAP包不在debug模式下。", + "请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。" + ], + [ + "1008240007", + "无法获取当前HAP包信息,例如APP ID等。", + "请检查应用包名合法性,输入正确的应用包名。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode" + } + ], + "title": "错误码" + } +] diff --git a/pkg/domain/reference/management/endpoints.json b/pkg/domain/reference/management/endpoints.json new file mode 100644 index 0000000..43d180b --- /dev/null +++ b/pkg/domain/reference/management/endpoints.json @@ -0,0 +1,3649 @@ +[ + { + "id": "execute-command", + "familyId": "cache", + "name": "execute-command", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "POST", + "path": "/agc/edge/scs/scs-service/v1/eval", + "command": "agc cache execute-command", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "command", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 4096 + } + ], + "documentation": { + "title": "execute-command", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache execute-command --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-execute-command" + }, + { + "id": "connection-info", + "familyId": "cache", + "name": "connection-info", + "description": "Reviewed native management transport; explicit user session required. projectId header comes from session.", + "method": "GET", + "path": "/agc/edge/scs/scs-service/v1/cache-invoke-address", + "command": "agc cache connection-info", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [], + "documentation": { + "title": "connection-info", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache connection-info --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-connection-info" + }, + { + "id": "usage", + "familyId": "cache", + "name": "usage", + "description": "Reviewed native management transport; explicit user session required. Epoch timestamps are milliseconds; interval at most three days, per source cmd/infoUsageStatistics.js.", + "method": "POST", + "path": "/agc/edge/spms/v1/query/metric/scs-metric", + "command": "agc cache usage", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "views", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "query_cache_metric_trend" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 12960000, + "maximum": 2158876800000 + }, + { + "name": "endTime", + "in": "query", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 12960000, + "maximum": 2158876800000 + } + ], + "documentation": { + "title": "usage", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache usage --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-usage" + }, + { + "id": "enable-service", + "familyId": "cache", + "name": "enable-service", + "description": "Reviewed native management transport; explicit user session required. Does not configure a password or prove the service is ready.", + "method": "POST", + "path": "/agc/edge/cpms/project-service/v1/services/order", + "command": "agc cache enable-service", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "projectId", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "serviceName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "cloudCache" + ] + } + ], + "documentation": { + "title": "enable-service", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache enable-service --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-enable-service" + }, + { + "id": "set-password", + "familyId": "cache", + "name": "set-password", + "description": "Reviewed native management transport; explicit user session required. Password is write-only; resetting a used cache password can disrupt applications.", + "method": "POST", + "path": "/agc/edge/scs/scs-service/v1/cache-password", + "command": "agc cache set-password", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "password", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minLength": 8, + "maxLength": 32 + } + ], + "documentation": { + "title": "set-password", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache set-password --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-set-password" + }, + { + "id": "reset-password", + "familyId": "cache", + "name": "reset-password", + "description": "Reviewed native management transport; explicit user session required. Password is write-only; resetting a used cache password can disrupt applications.", + "method": "PUT", + "path": "/agc/edge/scs/scs-service/v1/cache-password", + "command": "agc cache reset-password", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "password", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minLength": 8, + "maxLength": 32 + } + ], + "documentation": { + "title": "reset-password", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc cache reset-password --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-reset-password" + }, + { + "id": "schema-versions", + "familyId": "clouddb", + "name": "schema-versions", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/agc/edge/clouddb/clouddbservice/v1/schemaVersion", + "command": "agc clouddb schema-versions", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [], + "documentation": { + "title": "schema-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb schema-versions --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-schema-versions" + }, + { + "id": "get-object-type", + "familyId": "clouddb", + "name": "get-object-type", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb get-object-type", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "schemaVersion", + "in": "query", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "objectTypeName", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$" + } + ], + "documentation": { + "title": "get-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb get-object-type --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-get-object-type" + }, + { + "id": "create-object-type", + "familyId": "clouddb", + "name": "create-object-type", + "description": "Reviewed native management transport; explicit user session required. Creation is asynchronous; query process-status and independently read back schema before reporting completion.", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb create-object-type", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "objectType", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "objectTypeName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fields", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fieldType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ] + }, + { + "name": "belongPrimaryKey", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "notNull", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isNeedEncrypt", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isSensitive", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "defaultValue", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "minItems": 1 + }, + { + "name": "indexes", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "indexName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$" + }, + { + "name": "indexList", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "sortType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ] + } + ], + "minItems": 1, + "maxItems": 5 + } + ], + "maxItems": 16 + }, + { + "name": "permissions", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "role", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ] + }, + { + "name": "rights", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ] + } + ] + } + ] + } + ], + "documentation": { + "title": "create-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb create-object-type --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-object-type" + }, + { + "id": "update-object-type", + "familyId": "clouddb", + "name": "update-object-type", + "description": "Reviewed native management transport; explicit user session required. originObjectType must be the exact prior definition; this is not a patch or a migration of existing data.", + "method": "PUT", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb update-object-type", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "objectType", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "objectTypeName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fields", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fieldType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ] + }, + { + "name": "belongPrimaryKey", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "notNull", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isNeedEncrypt", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isSensitive", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "defaultValue", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "minItems": 1 + }, + { + "name": "indexes", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "indexName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$" + }, + { + "name": "indexList", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "sortType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ] + } + ], + "minItems": 1, + "maxItems": 5 + } + ], + "maxItems": 16 + }, + { + "name": "permissions", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "role", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ] + }, + { + "name": "rights", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ] + } + ] + } + ] + }, + { + "name": "originObjectType", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "objectTypeName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fields", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fieldType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ] + }, + { + "name": "belongPrimaryKey", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "notNull", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isNeedEncrypt", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isSensitive", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "defaultValue", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "minItems": 1 + }, + { + "name": "indexes", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "indexName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$" + }, + { + "name": "indexList", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "sortType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ] + } + ], + "minItems": 1, + "maxItems": 5 + } + ], + "maxItems": 16 + }, + { + "name": "permissions", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "role", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ] + }, + { + "name": "rights", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ] + } + ] + } + ] + } + ], + "documentation": { + "title": "update-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb update-object-type --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-update-object-type" + }, + { + "id": "delete-object-type", + "familyId": "clouddb", + "name": "delete-object-type", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/agc/edge/clouddb/clouddbservice/v1/objectType", + "command": "agc clouddb delete-object-type", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "objectTypeName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$" + } + ], + "documentation": { + "title": "delete-object-type", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb delete-object-type --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-delete-object-type" + }, + { + "id": "import-object-types", + "familyId": "clouddb", + "name": "import-object-types", + "description": "Reviewed native management transport; explicit user session required. Raw JSON document, not a JSON string wrapper; only new object types may be imported; local size limit 20MB.", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/importObjectType", + "command": "agc clouddb import-object-types", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "schemaVersion", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "objectTypes", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "objectTypeName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fields", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$", + "maxLength": 30 + }, + { + "name": "fieldType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "String", + "Boolean", + "Byte", + "Short", + "Integer", + "Long", + "Float", + "Double", + "ByteArray", + "Text", + "Date", + "IntAutoIncrement", + "LongAutoIncrement" + ] + }, + { + "name": "belongPrimaryKey", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "notNull", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isNeedEncrypt", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "isSensitive", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "defaultValue", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "minItems": 1 + }, + { + "name": "indexes", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "indexName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[A-Za-z][A-Za-z0-9_]{0,29}$" + }, + { + "name": "indexList", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fieldName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "sortType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "ASC", + "DESC" + ] + } + ], + "minItems": 1, + "maxItems": 5 + } + ], + "maxItems": 16 + } + ], + "minItems": 1 + }, + { + "name": "permissions", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "objectTypeName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "permissions", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "role", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "World", + "Authenticated", + "Creator", + "Administrator" + ] + }, + { + "name": "rights", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "itemsEnum": [ + "Read", + "Upsert", + "Delete" + ] + } + ] + } + ] + } + ], + "documentation": { + "title": "import-object-types", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb import-object-types --docs --pretty" + }, + "requestContentType": "application/x-www-form-urlencoded", + "officialSlug": "agcli-1.12.0-import-object-types" + }, + { + "id": "export-object-types", + "familyId": "clouddb", + "name": "export-object-types", + "description": "Reviewed native management transport; explicit user session required. Non-JSON formats return source-encoded Base64; no local extraction or execution.", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/exportObjectType", + "command": "agc clouddb export-object-types", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "schemaVersion", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "json", + "js", + "java", + "objective-c" + ] + }, + { + "name": "jsFileType", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "javaFileType", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "packageName", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 1024 + } + ], + "documentation": { + "title": "export-object-types", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb export-object-types --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-export-object-types" + }, + { + "id": "list-zones", + "familyId": "clouddb", + "name": "list-zones", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/agc/edge/clouddb/clouddbservice/v1/naturalStore", + "command": "agc clouddb list-zones", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [], + "documentation": { + "title": "list-zones", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb list-zones --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-list-zones" + }, + { + "id": "create-zone", + "familyId": "clouddb", + "name": "create-zone", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/naturalStore", + "command": "agc clouddb create-zone", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "cloudDBZoneName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 20, + "pattern": "^[A-Za-z][A-Za-z0-9]{0,19}$" + } + ], + "documentation": { + "title": "create-zone", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb create-zone --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-zone" + }, + { + "id": "delete-zone", + "familyId": "clouddb", + "name": "delete-zone", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/agc/edge/clouddb/clouddbservice/v1/naturalStore", + "command": "agc clouddb delete-zone", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "cloudDBZoneName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 20, + "pattern": "^[A-Za-z][A-Za-z0-9]{0,19}$" + } + ], + "documentation": { + "title": "delete-zone", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb delete-zone --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-delete-zone" + }, + { + "id": "process-status", + "familyId": "clouddb", + "name": "process-status", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "POST", + "path": "/agc/edge/clouddb/clouddbservice/v1/processPercentage", + "command": "agc clouddb process-status", + "authentication": "agcli-management-cookie", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "processId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "process-status", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc clouddb process-status --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-process-status" + }, + { + "id": "get-alias", + "familyId": "functions", + "name": "get-alias", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases/{aliasName}", + "command": "agc functions get-alias", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "functionName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "aliasName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$" + } + ], + "documentation": { + "title": "get-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-alias --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-get-alias" + }, + { + "id": "delete-alias", + "familyId": "functions", + "name": "delete-alias", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases/{aliasName}", + "command": "agc functions delete-alias", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "functionName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "aliasName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$" + } + ], + "documentation": { + "title": "delete-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions delete-alias --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-delete-alias" + }, + { + "id": "list-aliases", + "familyId": "functions", + "name": "list-aliases", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases", + "command": "agc functions list-aliases", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "functionName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "functionVersion", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "pageSize", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "pageIndex", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1 + } + ], + "documentation": { + "title": "list-aliases", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-aliases --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-list-aliases" + }, + { + "id": "create-alias", + "familyId": "functions", + "name": "create-alias", + "description": "Reviewed native management transport; explicit user session required. Provide one or two explicit version weights totaling 100; no implicit selection of latest published version.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases", + "command": "agc functions create-alias", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "functionName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$" + }, + { + "name": "functionVersion", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "description", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64 + }, + { + "name": "routingConfig", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [], + "additionalProperties": { + "name": "weight", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 0, + "maximum": 100 + }, + "propertyNamesPattern": "^(\\$latest|[1-9][0-9]{0,2}|1000)$", + "minProperties": 1, + "maxProperties": 2, + "description": "One or two version weights totaling 100; explicit complete routing required by this CLI." + } + ], + "documentation": { + "title": "create-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-alias --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-alias" + }, + { + "id": "update-alias", + "familyId": "functions", + "name": "update-alias", + "description": "Reviewed native management transport; explicit user session required. Read get-alias first and provide revisionId plus the full intended routing configuration.", + "method": "PUT", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/aliases/{aliasName}", + "command": "agc functions update-alias", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "functionName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "aliasName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$" + }, + { + "name": "functionVersion", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "revisionId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "description", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64 + }, + { + "name": "routingConfig", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [], + "additionalProperties": { + "name": "weight", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 0, + "maximum": 100 + }, + "propertyNamesPattern": "^(\\$latest|[1-9][0-9]{0,2}|1000)$", + "minProperties": 1, + "maxProperties": 2, + "description": "One or two version weights totaling 100; explicit complete routing required by this CLI." + } + ], + "documentation": { + "title": "update-alias", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions update-alias --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-update-alias" + }, + { + "id": "create-http-trigger", + "familyId": "functions", + "name": "create-http-trigger", + "description": "Reviewed native management transport; explicit user session required. funcId is obtained from query-function-version and must include the intended qualifier; create policy separately if required.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/trigger", + "command": "agc functions create-http-trigger", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "funcId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "mode", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "NO_PATH" + ] + }, + { + "name": "authFlag", + "in": "body", + "type": "boolean", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "authAlgor", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "HDA-SYSTEM" + ] + }, + { + "name": "authType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client", + "internal-auth" + ] + }, + { + "name": "enableUrlDecode", + "in": "body", + "type": "boolean", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "create-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-http-trigger --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-http-trigger" + }, + { + "id": "create-cron-trigger", + "familyId": "functions", + "name": "create-cron-trigger", + "description": "Reviewed native management transport; explicit user session required. Default AGCLI create switch is false; an explicit triggerSwitch is required. Current guide says switch cannot be changed later, unlike AGCLI update; cloud support is unverified.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/triggers", + "command": "agc functions create-cron-trigger", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "funcId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "triggerType", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Cron" + ] + }, + { + "name": "triggerMode", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Sync", + "ASync" + ] + }, + { + "name": "triggerSwitch", + "in": "body", + "type": "boolean", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "spec", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "schedule", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "payload", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ] + } + ], + "documentation": { + "title": "create-cron-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-cron-trigger --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-cron-trigger" + }, + { + "id": "get-http-trigger", + "familyId": "functions", + "name": "get-http-trigger", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/trigger/{triggerId}", + "command": "agc functions get-http-trigger", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "triggerId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "get-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-http-trigger --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-get-http-trigger" + }, + { + "id": "delete-http-trigger", + "familyId": "functions", + "name": "delete-http-trigger", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/api/wisefunction/serverless/v1/trigger/{triggerId}", + "command": "agc functions delete-http-trigger", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "triggerId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "delete-http-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions delete-http-trigger --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-delete-http-trigger" + }, + { + "id": "list-http-triggers", + "familyId": "functions", + "name": "list-http-triggers", + "description": "Reviewed native management transport; explicit user session required. Listing path is also reviewed in boundary/triggerService.js. Endpoint list uses exact funcId, no automatic qualifier discovery.", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/trigger/list/{funcId}", + "command": "agc functions list-http-triggers", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "funcId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "pageSize", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "pageIndex", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1 + } + ], + "documentation": { + "title": "list-http-triggers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-http-triggers --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-list-http-triggers" + }, + { + "id": "get-trigger", + "familyId": "functions", + "name": "get-trigger", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/triggers/{triggerId}", + "command": "agc functions get-trigger", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "triggerId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "get-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-trigger --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-get-trigger" + }, + { + "id": "delete-trigger", + "familyId": "functions", + "name": "delete-trigger", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "DELETE", + "path": "/api/wisefunction/serverless/v1/triggers/{triggerId}", + "command": "agc functions delete-trigger", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "triggerId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "delete-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions delete-trigger --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-delete-trigger" + }, + { + "id": "list-triggers", + "familyId": "functions", + "name": "list-triggers", + "description": "Reviewed native management transport; explicit user session required. Listing path is also reviewed in boundary/triggerService.js. Endpoint list uses exact funcId, no automatic qualifier discovery.", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/triggers/list/{funcId}", + "command": "agc functions list-triggers", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "funcId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "pageSize", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "pageIndex", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1 + } + ], + "documentation": { + "title": "list-triggers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-triggers --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-list-triggers" + }, + { + "id": "update-cron-trigger", + "familyId": "functions", + "name": "update-cron-trigger", + "description": "Reviewed native management transport; explicit user session required. Read get-trigger first; preserve funcId, spec, triggerMode and revisionId.", + "method": "PUT", + "path": "/api/wisefunction/serverless/v1/triggers/{triggerId}", + "command": "agc functions update-cron-trigger", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "triggerId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "funcId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "triggerMode", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Sync", + "ASync" + ] + }, + { + "name": "triggerSwitch", + "in": "body", + "type": "boolean", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "spec", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "schedule", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "payload", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ] + }, + { + "name": "revisionId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "update-cron-trigger", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions update-cron-trigger --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-update-cron-trigger" + }, + { + "id": "get-function-policy", + "familyId": "functions", + "name": "get-function-policy", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/policy", + "command": "agc functions get-function-policy", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "functionName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "qualifier", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "get-function-policy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-function-policy --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-get-function-policy" + }, + { + "id": "create-function-policy", + "familyId": "functions", + "name": "create-function-policy", + "description": "Reviewed native management transport; explicit user session required. Read policy first; no automatic grants or silent retries.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/functions/{functionName}/policy", + "command": "agc functions create-function-policy", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "functionName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "qualifier", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "effect", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Allow" + ] + }, + { + "name": "action", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "InvokeFunction" + ] + }, + { + "name": "sourceProvider", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "sourceId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "revisionId", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "create-function-policy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-function-policy --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-function-policy" + }, + { + "id": "list-layers", + "familyId": "functions", + "name": "list-layers", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/layers", + "command": "agc functions list-layers", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "layerName", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "ownerFlag", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "all", + "self", + "other" + ] + }, + { + "name": "compatibleRuntime", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "pageSize", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "pageIndex", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1 + } + ], + "documentation": { + "title": "list-layers", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-layers --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-list-layers" + }, + { + "id": "list-layer-versions", + "familyId": "functions", + "name": "list-layer-versions", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/layers/{layerName}/versions", + "command": "agc functions list-layer-versions", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "layerName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "compatibleRuntime", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "pageSize", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "pageIndex", + "in": "query", + "type": "integer", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1 + } + ], + "documentation": { + "title": "list-layer-versions", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions list-layer-versions --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-list-layer-versions" + }, + { + "id": "get-layer-version", + "familyId": "functions", + "name": "get-layer-version", + "description": "Reviewed native management transport; explicit user session required. ", + "method": "GET", + "path": "/api/wisefunction/serverless/v1/layers/{layerName}/versions/{layerVersion}", + "command": "agc functions get-layer-version", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "layerName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "layerVersion", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[1-9][0-9]*$" + } + ], + "documentation": { + "title": "get-layer-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions get-layer-version --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-get-layer-version" + }, + { + "id": "create-layer-version", + "familyId": "functions", + "name": "create-layer-version", + "description": "Reviewed native management transport; explicit user session required. zipFile contains Base64 ZIP bytes; validate compressed/decompressed limits and entry count before authorization. Layer name creates the initial version or appends a version. AGCLI 1.12.0 local ZIP validation caps files below 50MiB; this direct API adapter uses the current browser-reviewed guide limits of 150MiB compressed, 300MiB expanded and 30000 entries. This difference and modern runtime wire values still require cloud verification.", + "method": "POST", + "path": "/api/wisefunction/serverless/v1/layers/{layerName}/versions", + "command": "agc functions create-layer-version", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "layerName", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "compatibleRuntimes", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "minItems": 1, + "itemsEnum": [ + "nodejs14.x", + "java1.8", + "python3", + "custom-runtime" + ] + }, + { + "name": "sharedScope", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "0", + "1" + ] + }, + { + "name": "zipFile", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "format": "byte" + }, + { + "name": "description", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 1024 + }, + { + "name": "licenseInfo", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64 + } + ], + "documentation": { + "title": "create-layer-version", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc functions create-layer-version --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-layer-version" + }, + { + "id": "search-applications", + "familyId": "templates", + "name": "search-applications", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "GET", + "path": "/api/adm/v1/applications/search", + "command": "agc templates search-applications", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "appName", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "search-applications", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates search-applications --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-search-applications" + }, + { + "id": "create-application", + "familyId": "templates", + "name": "create-application", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "POST", + "path": "/api/adm/v1/applications", + "command": "agc templates create-application", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "components", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Huawei::AGC::CloudFunctions" + ] + }, + { + "name": "properties", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "codeUri", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "runtime", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "memorySize", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "500", + "1000", + "2000", + "4000" + ] + }, + { + "name": "timeout", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1800 + }, + { + "name": "handler", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "pattern": "^[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*$" + }, + { + "name": "instanceConcurrency", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "description", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "description": "Vendor display width <=64; non-ASCII UTF-16 units count twice." + }, + { + "name": "layers", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "maxItems": 5 + }, + { + "name": "env", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "pattern": "^[-._a-zA-Z][-._a-zA-Z0-9]*$" + }, + { + "name": "value", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 2048 + } + ] + }, + { + "name": "alias", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$" + }, + { + "name": "events", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$" + }, + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "http", + "cron" + ] + }, + { + "name": "properties", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "authType", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client" + ] + }, + { + "name": "enableUrlDecode", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "schedule", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "input", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "encodedJson": { + "name": "value", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + } + ] + } + ], + "itemsRules": [ + { + "id": "sam-http-authType", + "kind": "required_if", + "field": "body.properties.authType", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.authType", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-http-enableUrlDecode", + "kind": "required_if", + "field": "body.properties.enableUrlDecode", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.enableUrlDecode", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-schedule", + "kind": "required_if", + "field": "body.properties.schedule", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.schedule", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-input", + "kind": "required_if", + "field": "body.properties.input", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.input", + "suggestion": "Supply the conditional event property using the source-defined type." + } + ] + } + ] + } + ], + "minItems": 1 + } + ], + "documentation": { + "title": "create-application", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates create-application --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-application" + }, + { + "id": "create-plan", + "familyId": "templates", + "name": "create-plan", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "POST", + "path": "/api/adm/v1/applications/{applicationId}/plans", + "command": "agc templates create-plan", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "applicationId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "components", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Huawei::AGC::CloudFunctions" + ] + }, + { + "name": "properties", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "codeUri", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "runtime", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "memorySize", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "500", + "1000", + "2000", + "4000" + ] + }, + { + "name": "timeout", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1800 + }, + { + "name": "handler", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "pattern": "^[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*$" + }, + { + "name": "instanceConcurrency", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "description", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "description": "Vendor display width <=64; non-ASCII UTF-16 units count twice." + }, + { + "name": "layers", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "maxItems": 5 + }, + { + "name": "env", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "pattern": "^[-._a-zA-Z][-._a-zA-Z0-9]*$" + }, + { + "name": "value", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 2048 + } + ] + }, + { + "name": "alias", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$" + }, + { + "name": "events", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$" + }, + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "http", + "cron" + ] + }, + { + "name": "properties", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "authType", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client" + ] + }, + { + "name": "enableUrlDecode", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "schedule", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "input", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "encodedJson": { + "name": "value", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + } + ] + } + ], + "itemsRules": [ + { + "id": "sam-http-authType", + "kind": "required_if", + "field": "body.properties.authType", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.authType", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-http-enableUrlDecode", + "kind": "required_if", + "field": "body.properties.enableUrlDecode", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.enableUrlDecode", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-schedule", + "kind": "required_if", + "field": "body.properties.schedule", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.schedule", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-input", + "kind": "required_if", + "field": "body.properties.input", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.input", + "suggestion": "Supply the conditional event property using the source-defined type." + } + ] + } + ] + } + ], + "minItems": 1 + } + ], + "documentation": { + "title": "create-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates create-plan --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-create-plan" + }, + { + "id": "get-plan", + "familyId": "templates", + "name": "get-plan", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "GET", + "path": "/api/adm/v1/applications/plans/{planId}", + "command": "agc templates get-plan", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "planId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "get-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates get-plan --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-get-plan" + }, + { + "id": "apply-plan", + "familyId": "templates", + "name": "apply-plan", + "description": "Reviewed native management transport; explicit user session required. SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.", + "method": "PUT", + "path": "/api/adm/v1/applications/{applicationId}/plans/{planId}", + "command": "agc templates apply-plan", + "authentication": "agcli-management-oauth", + "direction": "developer-to-huawei", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "applicationId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "planId", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "apply-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates apply-plan --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-apply-plan" + }, + { + "id": "deploy", + "familyId": "templates", + "name": "deploy", + "description": "Reviewed native management transport; explicit user session required. Create-only SAM deployment: validate every local codeUri ZIP, search exact application name, upload code, create application, then independently query readiness. Existing applications are refused; use explicit create-plan/get-plan/apply-plan for updates. Local-only storageInstance and waitForReady are not sent to ADM. Uploaded artifacts may be retained after failure. Not a console gallery deployment.", + "method": "POST", + "path": "native:templates/deploy", + "command": "agc templates deploy", + "authentication": "agcli-management-oauth", + "direction": "native-workflow", + "status": "registered", + "source": "Huawei official AGCLI 1.12.0 source; not a public REST specification", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "parameters": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "components", + "in": "body", + "type": "array", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$" + }, + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "Huawei::AGC::CloudFunctions" + ] + }, + { + "name": "properties", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "codeUri", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "runtime", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "memorySize", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "500", + "1000", + "2000", + "4000" + ] + }, + { + "name": "timeout", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1800 + }, + { + "name": "handler", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "pattern": "^[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*$" + }, + { + "name": "instanceConcurrency", + "in": "body", + "type": "integer", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "description", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "description": "Vendor display width <=64; non-ASCII UTF-16 units count twice." + }, + { + "name": "layers", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "string", + "maxItems": 5 + }, + { + "name": "env", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 64, + "pattern": "^[-._a-zA-Z][-._a-zA-Z0-9]*$" + }, + { + "name": "value", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "maxLength": 2048 + } + ] + }, + { + "name": "alias", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-z0-9-]{0,14}[a-z0-9]$" + }, + { + "name": "events", + "in": "body", + "type": "array", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "pattern": "^[a-z][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$" + }, + { + "name": "type", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "http", + "cron" + ] + }, + { + "name": "properties", + "in": "body", + "type": "object", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "properties": [ + { + "name": "authType", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "enum": [ + "apigw-client", + "cloudgw-client" + ] + }, + { + "name": "enableUrlDecode", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "schedule", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "input", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "encodedJson": { + "name": "value", + "in": "body", + "type": "", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + } + ] + } + ], + "itemsRules": [ + { + "id": "sam-http-authType", + "kind": "required_if", + "field": "body.properties.authType", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.authType", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-http-enableUrlDecode", + "kind": "required_if", + "field": "body.properties.enableUrlDecode", + "when": { + "field": "body.type", + "equals": "http" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM http events require properties.enableUrlDecode", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-schedule", + "kind": "required_if", + "field": "body.properties.schedule", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.schedule", + "suggestion": "Supply the conditional event property using the source-defined type." + }, + { + "id": "sam-cron-input", + "kind": "required_if", + "field": "body.properties.input", + "when": { + "field": "body.type", + "equals": "cron" + }, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "message": "SAM cron events require properties.input", + "suggestion": "Supply the conditional event property using the source-defined type." + } + ] + } + ] + } + ], + "minItems": 1 + }, + { + "name": "storageInstance", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + }, + { + "name": "waitForReady", + "in": "body", + "type": "boolean", + "required": false, + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0" + } + ], + "documentation": { + "title": "deploy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "readCommand": "agc templates deploy --docs --pretty" + }, + "officialSlug": "agcli-1.12.0-deploy" + }, + { + "id": "fetch-install", + "familyId": "prefetch", + "name": "fetch-install", + "method": "GET", + "path": "{callbackUrl}", + "command": "agc prefetch fetch-install", + "authentication": "callback-none", + "direction": "inbound-callback", + "status": "registered", + "source": "Huawei browser-reviewed developer server protocol", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev" + } + ], + "documentation": { + "title": "开发预加载资源接口", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch fetch-install --docs --pretty" + }, + "officialSlug": "cloudfoundation-prefetch-cloud-interdev" + }, + { + "id": "fetch-periodic", + "familyId": "prefetch", + "name": "fetch-periodic", + "method": "GET", + "path": "{callbackUrl}", + "command": "agc prefetch fetch-periodic", + "authentication": "callback-none", + "direction": "inbound-callback", + "status": "registered", + "source": "Huawei browser-reviewed developer server protocol", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev" + }, + { + "name": "token", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "maxLength": 2048 + }, + { + "name": "params", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "maxLength": 1024 + } + ], + "documentation": { + "title": "开发预加载资源接口", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch fetch-periodic --docs --pretty" + }, + "officialSlug": "cloudfoundation-prefetch-cloud-interdev" + }, + { + "id": "fetch-deferred", + "familyId": "prefetch", + "name": "fetch-deferred", + "method": "GET", + "path": "{callbackUrl}", + "command": "agc prefetch fetch-deferred", + "authentication": "callback-none", + "direction": "inbound-callback", + "status": "registered", + "source": "Huawei browser-reviewed developer server protocol", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev" + }, + { + "name": "link", + "in": "query", + "type": "string", + "required": false, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev" + } + ], + "documentation": { + "title": "开发预加载资源接口", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch fetch-deferred --docs --pretty" + }, + "officialSlug": "cloudfoundation-prefetch-cloud-interdev" + }, + { + "id": "device-getcache", + "familyId": "prefetch", + "name": "Debug periodic prefetch on an explicit device", + "method": "POST", + "path": "local:prefetch/device-getcache", + "command": "agc prefetch device-getcache", + "authentication": "local-device", + "direction": "local", + "status": "registered", + "source": "Huawei browser-reviewed hdc command", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "parameters": [ + { + "name": "bundleName", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "pattern": "^[A-Za-z][A-Za-z0-9_]*(?:\\.[A-Za-z][A-Za-z0-9_]*)+$" + }, + { + "name": "deviceId", + "in": "body", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "pattern": "^[A-Za-z0-9._:-]+$" + }, + { + "name": "hdcPath", + "in": "body", + "type": "string", + "required": false, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug" + } + ], + "documentation": { + "title": "调试周期性预加载", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "checkedAt": "2026-10-26", + "status": "browser-read", + "readCommand": "agc prefetch device-getcache --docs --pretty" + }, + "officialSlug": "cloudfoundation-commandtool-debug" + } +] diff --git a/pkg/domain/reference/pms/addproduct-android.json b/pkg/domain/reference/pms/addproduct-android.json new file mode 100644 index 0000000..f835ae0 --- /dev/null +++ b/pkg/domain/reference/pms/addproduct-android.json @@ -0,0 +1,271 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n{ \n \"requestId\": \"8700018791\", \n \"product\": { \n \"productNo\": \"manageproduct1000001\", \n \"appId\": \"C1000001\", \n \"productName\": \"创建商品定义信息\", \n \"purchaseType\": \"consumable\", \n \"status\": \"inactive\", \n \"currency\": \"CNY\", \n \"country\": \"CN\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultPrice\": \"4000\", \n \"productDesc\": \"测试商品描述\", \n \"languages\": [{ \n \"locale\": \"en_US\", \n \"productName\": \"创建商品定义信息\", \n \"productDesc\": \"测试商品描述\" \n }] ,\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1\n } \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section135284276408", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-productinfo-android-0000002171288637", + "title": "ProductInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605", + "title": "批量创建商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section11985185416211", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section18899113085213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section21761435152419", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section135284276408", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section1183520114266", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section11985185416211", + "text": "此接口用于创建商品定义信息,包含商品价格,展示语言等。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111" + }, + { + "location": "body", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "product", + "M", + "ProductInfo", + "商品信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section18899113085213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section21761435152419" + } + ], + "title": "创建商品", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:19.778Z", + "family": "pms", + "endpoint": "addproduct-android" +} diff --git a/pkg/domain/reference/pms/addproduct-android.parameters.json b/pkg/domain/reference/pms/addproduct-android.parameters.json new file mode 100644 index 0000000..b02b7df --- /dev/null +++ b/pkg/domain/reference/pms/addproduct-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section983512465111" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section18899113085213", + "maxLength": 64 + }, + { + "name": "product", + "in": "body", + "type": "object", + "required": true, + "description": "商品信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001#section18899113085213" + } +] diff --git a/pkg/domain/reference/pms/addproduct-harmonyosnext.json b/pkg/domain/reference/pms/addproduct-harmonyosnext.json new file mode 100644 index 0000000..bf1c1cc --- /dev/null +++ b/pkg/domain/reference/pms/addproduct-harmonyosnext.json @@ -0,0 +1,272 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n \n{ \n \"requestId\": \"8700018791\", \n \"product\": { \n \"productNo\": \"manageproduct1000001\", \n \"appId\": \"C1000001\", \n \"productName\": \"创建商品定义信息\", \n \"purchaseType\": \"consumable\", \n \"status\": \"inactive\", \n \"currency\": \"CNY\", \n \"country\": \"CN\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultPrice\": \"4000\", \n \"productDesc\": \"测试商品描述\", \n \"languages\": [{ \n \"locale\": \"en_US\", \n \"productName\": \"创建商品定义信息\", \n \"productDesc\": \"测试商品描述\" \n }],\n \"reviewResourceId\": \"22AA702C947A42A7AF059779D18E872A\",\n \"reviewPath\": \"我的-会员中心-黄金会员\",\n \"reviewNote\": \"新建商品\",\n \"taxIncluded\": 1,\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1\n \n } \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section135284276408", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-productinfo-harmonyosnext-0000002131350728", + "title": "ProductInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792", + "title": "上传资源" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241", + "title": "提交商品审核" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section11985185416211", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section18899113085213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section21761435152419", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section135284276408", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section1183520114266", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section11985185416211", + "text": "此接口用于创建商品定义信息,包含商品价格,展示语言等。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section11985185416211", + "text": "新创建的所有数字商品需先提交审核,审核通过后即可上架生效;若您为应用提交首个数字商品或新增商品类型时(比如之前的应用版本提供的是消耗型商品,想要从这个版本开始提供自动续期订阅),则新增数字商品时必须随新的应用版本提交审核,版本审核通过后,商品也随之生效。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111" + }, + { + "location": "body", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "product", + "M", + "ProductInfo", + "商品信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section18899113085213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section21761435152419" + } + ], + "title": "创建商品", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:57:21.491Z", + "family": "pms", + "endpoint": "addproduct-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/addproduct-harmonyosnext.parameters.json b/pkg/domain/reference/pms/addproduct-harmonyosnext.parameters.json new file mode 100644 index 0000000..fabf382 --- /dev/null +++ b/pkg/domain/reference/pms/addproduct-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section983512465111" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section18899113085213", + "maxLength": 64 + }, + { + "name": "product", + "in": "body", + "type": "object", + "required": true, + "description": "商品信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844#section18899113085213" + } +] diff --git a/pkg/domain/reference/pms/addproductgroup-android.json b/pkg/domain/reference/pms/addproductgroup-android.json new file mode 100644 index 0000000..8c2a352 --- /dev/null +++ b/pkg/domain/reference/pms/addproductgroup-android.json @@ -0,0 +1,277 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section135284276408", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/group\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"1234567891233123\",\n \"resource\": {\n \"groupName\": \"product_group_1000002\",\n \"status\": \"active\"\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1310833945419", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"result\": \"23C1FAA8801E46459AA19301C3436022\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pgroupinfo-android-0000002171407037", + "title": "ProductGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605", + "title": "批量创建商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400", + "title": "更新商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1039611495218", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section135284276408", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1310833945419", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section8711909", + "text": "此接口用于创建商品订阅分组信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/group" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductGroupInfo", + "商品订阅分组信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1039611495218" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "result", + "O", + "String", + "返回值,取值范围: 创建成功时返回groupId 失败为空或者不返回" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section49198053" + } + ], + "title": "创建商品订阅分组信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:23.062Z", + "family": "pms", + "endpoint": "addproductgroup-android" +} diff --git a/pkg/domain/reference/pms/addproductgroup-android.parameters.json b/pkg/domain/reference/pms/addproductgroup-android.parameters.json new file mode 100644 index 0000000..305239c --- /dev/null +++ b/pkg/domain/reference/pms/addproductgroup-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section35001623704" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1039611495218", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品订阅分组信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308#section1039611495218" + } +] diff --git a/pkg/domain/reference/pms/addproductgroup-harmonyosnext.json b/pkg/domain/reference/pms/addproductgroup-harmonyosnext.json new file mode 100644 index 0000000..bfeb17f --- /dev/null +++ b/pkg/domain/reference/pms/addproductgroup-harmonyosnext.json @@ -0,0 +1,273 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section135284276408", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"1234567891233123\",\n \"resource\": {\n \"groupName\": \"product_group_1000002\",\n \"status\": \"active\"\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1310833945419", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"result\": \"23C1FAA8801E46459AA19301C3436022\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pgroupinfo-harmonyosnext-0000002131508868", + "title": "ProductGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "title": "批量创建商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137", + "title": "更新商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1039611495218", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section135284276408", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1310833945419", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section8711909", + "text": "此接口用于创建商品订阅分组信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductGroupInfo", + "商品订阅分组信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1039611495218" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "result", + "O", + "String", + "返回值,取值范围: 创建成功时返回groupId 失败为空或者不返回" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section49198053" + } + ], + "title": "创建商品订阅分组信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:24.580Z", + "family": "pms", + "endpoint": "addproductgroup-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/addproductgroup-harmonyosnext.parameters.json b/pkg/domain/reference/pms/addproductgroup-harmonyosnext.parameters.json new file mode 100644 index 0000000..1355a45 --- /dev/null +++ b/pkg/domain/reference/pms/addproductgroup-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section35001623704" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1039611495218", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品订阅分组信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605#section1039611495218" + } +] diff --git a/pkg/domain/reference/pms/addpromotion-android.json b/pkg/domain/reference/pms/addpromotion-android.json new file mode 100644 index 0000000..480e070 --- /dev/null +++ b/pkg/domain/reference/pms/addpromotion-android.json @@ -0,0 +1,277 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123\",\n \"resource\": {\n \"productNo\": \"productNo10000004\",\n \"startDate\": 1975010662000,\n \"endDate\": 1975269862000,\n \"status\": \"active\",\n \"strategy\": \"introductory\",\n \"promotionTitle\": \"postman创建13535\",\n \"defaultLocale\": \"zh-CN\",\n \"country\": \"CN\",\n \"currency\": \"CNY\",\n \"promotionDesc\": \"default desc\",\n \"defaultPrice\": \"50\",\n \"languages\": [{\n \"title\": \"qewr\",\n \"locale\": \"en-GB\",\n \"desc\": \"default desc\"\n }, {\n \"title\": \"postman创建13535\",\n \"locale\": \"zh-CN\",\n \"desc\": \"default desc\"\n }],\n \"prices\": [{\n \"country\": \"EG\",\n \"price\": \"500\"\n }, {\n \"country\": \"CN\",\n \"price\": \"50\"\n }]\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section280984212013", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"create product promotion success\"\n },\n \"promotionId\": \"11CECEC1B2F842A09E6F9F83BA1A1A5E\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppromotioninfo-android-0000002135929348", + "title": "ProductPromotionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412", + "title": "查询是否有在线商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621", + "title": "更新商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1166073246", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section280984212013", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section8711909", + "text": "此接口用于创建商品促销信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductPromotionInfo", + "商品促销价格信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1166073246" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "promotionId", + "M", + "String", + "促销唯一ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section49198053" + } + ], + "title": "创建商品促销信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:25.861Z", + "family": "pms", + "endpoint": "addpromotion-android" +} diff --git a/pkg/domain/reference/pms/addpromotion-android.parameters.json b/pkg/domain/reference/pms/addpromotion-android.parameters.json new file mode 100644 index 0000000..91a68dc --- /dev/null +++ b/pkg/domain/reference/pms/addpromotion-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1792174114120" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1166073246", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品促销价格信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021#section1166073246" + } +] diff --git a/pkg/domain/reference/pms/addpromotion-harmonyosnext.json b/pkg/domain/reference/pms/addpromotion-harmonyosnext.json new file mode 100644 index 0000000..68fb130 --- /dev/null +++ b/pkg/domain/reference/pms/addpromotion-harmonyosnext.json @@ -0,0 +1,273 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n{ \n \"requestId\": \"123\", \n \"resource\": { \n \"productNo\": \"productNo10000004\", \n \"startDate\": 1975010662000, \n \"endDate\": 1975269862000, \n \"status\": \"active\", \n \"strategy\": \"introductory\", \n \"promotionTitle\": \"postman创建13535\", \n \"defaultLocale\": \"zh-CN\", \n \"country\": \"CN\", \n \"currency\": \"CNY\", \n \"promotionType\": 4, \n \"promotionDesc\": \"default desc\", \n \"defaultPrice\": \"50\", \n \"languages\": [{ \n \"title\": \"qewr\", \n \"locale\": \"en-GB\", \n \"desc\": \"default desc\" \n }, { \n \"title\": \"postman创建13535\", \n \"locale\": \"zh-CN\", \n \"desc\": \"default desc\" \n }], \n \"prices\": [{ \n \"country\": \"EG\", \n \"price\": \"500\" \n }, { \n \"country\": \"CN\", \n \"price\": \"50\" \n }] ,\n \"betweenOffersNumOfUnits\": 5,\n \"betweenOffersPeriodUnit\": \"M\"\n } \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section280984212013", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"create product promotion success\"\n },\n \"promotionId\": \"11CECEC1B2F842A09E6F9F83BA1A1A5E\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppromotioninfo-harmonyosnext-0000002166748633", + "title": "ProductPromotionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145", + "title": "查询是否有在线商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716", + "title": "更新商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1166073246", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section280984212013", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section8711909", + "text": "此接口用于创建商品促销信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductPromotionInfo", + "商品促销价格信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1166073246" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "promotionId", + "M", + "String", + "促销唯一ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section49198053" + } + ], + "title": "创建商品促销信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:27.930Z", + "family": "pms", + "endpoint": "addpromotion-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/addpromotion-harmonyosnext.parameters.json b/pkg/domain/reference/pms/addpromotion-harmonyosnext.parameters.json new file mode 100644 index 0000000..c3713c7 --- /dev/null +++ b/pkg/domain/reference/pms/addpromotion-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1792174114120" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1166073246", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品促销价格信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856#section1166073246" + } +] diff --git a/pkg/domain/reference/pms/basicapplication-harmonyosnext.json b/pkg/domain/reference/pms/basicapplication-harmonyosnext.json new file mode 100644 index 0000000..fa64176 --- /dev/null +++ b/pkg/domain/reference/pms/basicapplication-harmonyosnext.json @@ -0,0 +1,275 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nGET https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/application/basic?purchaseType=non_consumable&appId=1000001 \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section2884102017316", + "text": "响应示例\n{\n \"productTypeList\": \"0;2;3;4\", \n \"packageType\": \"harmony\",\n \"isCheckProductType\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "title": "批量下线商品促销活动" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-harmonyosnext-0000002166748621", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section48988321545", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section2884102017316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section8711909", + "text": "此接口用于查询关联APP已有商品类型。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/application/basic" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "purchaseType", + "M", + "String", + "商品类型。如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non_renewing_subscription:非续期订阅型" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section48988321545" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productTypeList", + "O", + "String", + "商品类型列表。 0:consumable消耗型 2:auto_subscription自动续期型 3:non_consumable非消耗型 4: non_renewing_subscription非续期订阅型" + ], + [ + "packageType", + "O", + "String", + "包类型,固定取值 : android harmony" + ], + [ + "isCheckProductType", + "O", + "Integer", + "是否关联APP,固定取值: 0:已关联 1:未关联" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section49198053" + } + ], + "title": "查询关联APP已有商品类型", + "updatedAt": "2025-08-18 14:34", + "checkedAt": "2026-10-07T02:57:29.364Z", + "family": "pms", + "endpoint": "basicapplication-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/basicapplication-harmonyosnext.parameters.json b/pkg/domain/reference/pms/basicapplication-harmonyosnext.parameters.json new file mode 100644 index 0000000..ca1756e --- /dev/null +++ b/pkg/domain/reference/pms/basicapplication-harmonyosnext.parameters.json @@ -0,0 +1,26 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section1146731320212" + }, + { + "name": "purchaseType", + "in": "body", + "type": "string", + "required": true, + "description": "商品类型。如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non_renewing_subscription:非续期订阅型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section48988321545" + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928#section48988321545" + } +] diff --git a/pkg/domain/reference/pms/batchactproduct-android.json b/pkg/domain/reference/pms/batchactproduct-android.json new file mode 100644 index 0000000..6ba01a2 --- /dev/null +++ b/pkg/domain/reference/pms/batchactproduct-android.json @@ -0,0 +1,289 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchActive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"20200407\",\n \"products\": [\"159349001\", \"159349002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section1548511051512", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch operate products success.\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-android-0000002136087432", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013", + "title": "批量更新商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320", + "title": "批量去激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7821124016311", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section1548511051512", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section8711909", + "text": "此接口用于批量激活商品。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchActive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品标识,只有下线状态的商品才能被激活。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7821124016311" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "成功个数。" + ], + [ + "resultInfo", + "M", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section49198053" + } + ], + "title": "批量激活商品", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:30.912Z", + "family": "pms", + "endpoint": "batchactproduct-android" +} diff --git a/pkg/domain/reference/pms/batchactproduct-android.parameters.json b/pkg/domain/reference/pms/batchactproduct-android.parameters.json new file mode 100644 index 0000000..6ab7e5a --- /dev/null +++ b/pkg/domain/reference/pms/batchactproduct-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7926166412" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7821124016311" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品标识,只有下线状态的商品才能被激活。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617#section7821124016311", + "itemsType": "string" + } +] diff --git a/pkg/domain/reference/pms/batchactproduct-harmonyosnext.json b/pkg/domain/reference/pms/batchactproduct-harmonyosnext.json new file mode 100644 index 0000000..a86c35e --- /dev/null +++ b/pkg/domain/reference/pms/batchactproduct-harmonyosnext.json @@ -0,0 +1,285 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchActive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"20200407\",\n \"products\": [\"159349001\", \"159349002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section1548511051512", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch operate products success.\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-harmonyosnext-0000002166670161", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "title": "批量更新商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "title": "批量去激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7821124016311", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section1548511051512", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section8711909", + "text": "此接口用于批量激活商品,生效已下线商品,已结束的促销不会重新生效。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchActive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品标识,只有下线状态的商品才能被激活。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7821124016311" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "成功个数。" + ], + [ + "resultInfo", + "M", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section49198053" + } + ], + "title": "批量激活商品", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:57:32.221Z", + "family": "pms", + "endpoint": "batchactproduct-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/batchactproduct-harmonyosnext.parameters.json b/pkg/domain/reference/pms/batchactproduct-harmonyosnext.parameters.json new file mode 100644 index 0000000..5dc1194 --- /dev/null +++ b/pkg/domain/reference/pms/batchactproduct-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7926166412" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7821124016311" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品标识,只有下线状态的商品才能被激活。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712#section7821124016311", + "itemsType": "string" + } +] diff --git a/pkg/domain/reference/pms/batchactpromotion-android.json b/pkg/domain/reference/pms/batchactpromotion-android.json new file mode 100644 index 0000000..75ec15d --- /dev/null +++ b/pkg/domain/reference/pms/batchactpromotion-android.json @@ -0,0 +1,289 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section19934722144316", + "text": "请求示例\n以API Client为例:\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion/batchActive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123234\",\n \"promotions\": [\"2B04888F868440D288337A0954B37001\", \"2B04888F868440D288337A0954B37002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section88519119304", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch active promotion success\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-perrorinfo-android-0000002135929352", + "title": "PromotionErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416", + "title": "按条件查询商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629", + "title": "批量下线商品促销活动" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section37798271043", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section88519119304", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section8711909", + "text": "此接口用于批量上线商品促销活动。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion/batchActive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String(header)", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String(header)", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(header)", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "promotions", + "M", + "List", + "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section37798271043" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "批量消息中的失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "批量消息中的成功个数。" + ], + [ + "resultInfo", + "O", + "List", + "操作错误信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section49198053" + } + ], + "title": "批量上线商品促销活动", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:33.713Z", + "family": "pms", + "endpoint": "batchactpromotion-android" +} diff --git a/pkg/domain/reference/pms/batchactpromotion-android.parameters.json b/pkg/domain/reference/pms/batchactpromotion-android.parameters.json new file mode 100644 index 0000000..ed89054 --- /dev/null +++ b/pkg/domain/reference/pms/batchactpromotion-android.parameters.json @@ -0,0 +1,29 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section191801561027" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section37798271043", + "maxLength": 64 + }, + { + "name": "promotions", + "in": "body", + "type": "array", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025#section37798271043", + "itemsType": "string", + "maxItems": 100 + } +] diff --git a/pkg/domain/reference/pms/batchactpromotion-harmonyosnext.json b/pkg/domain/reference/pms/batchactpromotion-harmonyosnext.json new file mode 100644 index 0000000..72dd0cd --- /dev/null +++ b/pkg/domain/reference/pms/batchactpromotion-harmonyosnext.json @@ -0,0 +1,285 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section19934722144316", + "text": "请求示例\n以API Client为例:\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion/batchActive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123234\",\n \"promotions\": [\"2B04888F868440D288337A0954B37001\", \"2B04888F868440D288337A0954B37002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section88519119304", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch active promotion success\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-perrorinfo-harmonyosnext-0000002166748637", + "title": "PromotionErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "title": "按条件查询商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "title": "批量下线商品促销活动" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section37798271043", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section88519119304", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section8711909", + "text": "此接口用于批量上线商品促销活动。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion/batchActive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String(header)", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String(header)", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(header)", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "promotions", + "M", + "List", + "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section37798271043" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "批量消息中的失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "批量消息中的成功个数。" + ], + [ + "resultInfo", + "O", + "List", + "操作错误信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section49198053" + } + ], + "title": "批量上线商品促销活动", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:57:34.992Z", + "family": "pms", + "endpoint": "batchactpromotion-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/batchactpromotion-harmonyosnext.parameters.json b/pkg/domain/reference/pms/batchactpromotion-harmonyosnext.parameters.json new file mode 100644 index 0000000..8a37822 --- /dev/null +++ b/pkg/domain/reference/pms/batchactpromotion-harmonyosnext.parameters.json @@ -0,0 +1,29 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section191801561027" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section37798271043", + "maxLength": 64 + }, + { + "name": "promotions", + "in": "body", + "type": "array", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860#section37798271043", + "itemsType": "string", + "maxItems": 100 + } +] diff --git a/pkg/domain/reference/pms/batchaddproduct-android.json b/pkg/domain/reference/pms/batchaddproduct-android.json new file mode 100644 index 0000000..9200c63 --- /dev/null +++ b/pkg/domain/reference/pms/batchaddproduct-android.json @@ -0,0 +1,293 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchImportProducts \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n \n{ \n \"requestId\": \"string\", \n \"products\": [{ \n \"productNo\": \"1001000002\", \n \"status\": \"active\", \n \"productName\": \"消耗型001\", \n \"productDesc\": \"消耗型简介01\", \n \"purchaseType\": \"consumable\", \n \"defaultLocale\": \"zh_CN\", \n \"defaultPriceInfo\": { \n \"country\": \"CN\", \n \"price\": \"100\", \n \"currency\": \"CNY\" \n }, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"productName\": \"消耗型01en_GB\", \n \"productDesc\": \"消耗型简介01en_GB\" \n }], \n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"200\" \n }],\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"promotion\": { \n \"promotionTitle\": \"prom01\", \n \"startDate\": 1605510496183, \n \"endDate\": 2218007523270, \n \"status\": \"active\", \n \"strategy\": \"introductory\", \n \"price\": 50, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"title\": \"prom01en\", \n \"desc\": \"prom01descen\" \n }], \n \"promotionPrice\": [{ \n \"price\": 2, \n \"country\": \"CN\" \n }] \n } \n }, { \n \"productNo\": \"1011000002\", \n \"status\": \"active\", \n \"productName\": \"消耗型002\", \n \"productDesc\": \"消耗型简介02\", \n \"purchaseType\": \"consumable\", \n \"defaultLocale\": \"zh_CN\", \n \"defaultPriceInfo\": { \n \"country\": \"CN\", \n \"price\": \"100\", \n \"currency\": \"CNY\" \n }, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"productName\": \"消耗型02en_GB\", \n \"productDesc\": \"消耗型简介02en_GB\" \n }], \n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"200\" \n }],\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"promotion\": { \n \"promotionTitle\": \"prom02\", \n \"startDate\": 1605510496183, \n \"endDate\": 2218007523270, \n \"status\": \"active\", \n \"strategy\": \"introductory\", \n \"price\": 50, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"title\": \"prom02en\", \n \"desc\": \"prom02descen\" \n }], \n \"promotionPrice\": [{ \n \"price\": 2, \n \"country\": \"CN\" \n }] \n } \n }] \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section32071815185013", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch operate products success.\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "title": "ProductImportInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-android-0000002136087432", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-android-0000002171407001", + "title": "创建商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308", + "title": "创建商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19451915006", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section21761435152419", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section32071815185013", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section8711909", + "text": "此接口用于批量创建商品定义信息,展示语言,商品价格,促销活动信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchImportProducts" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品列表信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19451915006" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "批量创建商品中的失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "批量创建商品中的成功个数。" + ], + [ + "resultInfo", + "M", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section21761435152419" + } + ], + "title": "批量创建商品", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:57:38.960Z", + "family": "pms", + "endpoint": "batchaddproduct-android" +} diff --git a/pkg/domain/reference/pms/batchaddproduct-android.parameters.json b/pkg/domain/reference/pms/batchaddproduct-android.parameters.json new file mode 100644 index 0000000..4117e0f --- /dev/null +++ b/pkg/domain/reference/pms/batchaddproduct-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section167710014" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19451915006" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品列表信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-android-0000002171288605#section19451915006", + "itemsType": "object" + } +] diff --git a/pkg/domain/reference/pms/batchaddproduct-harmonyosnext.json b/pkg/domain/reference/pms/batchaddproduct-harmonyosnext.json new file mode 100644 index 0000000..c01ed85 --- /dev/null +++ b/pkg/domain/reference/pms/batchaddproduct-harmonyosnext.json @@ -0,0 +1,289 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchImportProducts \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n \n{ \n \"requestId\": \"string\", \n \"products\": [{ \n \"productNo\": \"1001000002\", \n \"status\": \"drafts\", \n \"productName\": \"消耗型001\", \n \"productDesc\": \"消耗型简介01\", \n \"purchaseType\": \"consumable\", \n \"defaultLocale\": \"zh_CN\", \n \"defaultPriceInfo\": { \n \"country\": \"CN\", \n \"price\": \"100\", \n \"currency\": \"CNY\" \n }, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"productName\": \"消耗型01en_GB\", \n \"productDesc\": \"消耗型简介01en_GB\" \n }], \n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"200\" \n }],\n \"reviewResourceId\": \"22AA702C947A42A7AF059779D18E872A\",\n \"reviewPath\": \"我的-会员中心-黄金会员\",\n \"reviewNote\": \"新建商品\",\n \"taxIncluded\": 1,\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \n }, { \n \"productNo\": \"1011000002\", \n \"status\": \"drafts\", \n \"productName\": \"消耗型002\", \n \"productDesc\": \"消耗型简介02\", \n \"purchaseType\": \"consumable\", \n \"defaultLocale\": \"zh_CN\", \n \"defaultPriceInfo\": { \n \"country\": \"CN\", \n \"price\": \"100\", \n \"currency\": \"CNY\" \n }, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"productName\": \"消耗型02en_GB\", \n \"productDesc\": \"消耗型简介02en_GB\" \n }], \n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"200\" \n }], \n \"reviewResourceId\": \"22AA702C947A42A7AF059779D18E872B\",\n \"reviewPath\": \"我的-会员中心-白金会员\",\n \"reviewNote\": \"新建商品\",\n \"taxIncluded\": 1,\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \n }] \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section32071815185013", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch operate products success.\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "title": "ProductImportInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-harmonyosnext-0000002166670161", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241", + "title": "提交商品审核" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", + "title": "创建商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19451915006", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section21761435152419", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section32071815185013", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section8711909", + "text": "此接口用于批量创建商品定义信息,展示语言,商品价格,促销活动信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchImportProducts" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品列表信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19451915006" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "批量创建商品中的失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "批量创建商品中的成功个数。" + ], + [ + "resultInfo", + "M", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section21761435152419" + } + ], + "title": "批量创建商品", + "updatedAt": "2025-08-15 09:52", + "checkedAt": "2026-10-07T02:57:41.958Z", + "family": "pms", + "endpoint": "batchaddproduct-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/batchaddproduct-harmonyosnext.parameters.json b/pkg/domain/reference/pms/batchaddproduct-harmonyosnext.parameters.json new file mode 100644 index 0000000..c9e3db2 --- /dev/null +++ b/pkg/domain/reference/pms/batchaddproduct-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section167710014" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19451915006" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品列表信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704#section19451915006", + "itemsType": "object" + } +] diff --git a/pkg/domain/reference/pms/batchdeactproduct-android.json b/pkg/domain/reference/pms/batchdeactproduct-android.json new file mode 100644 index 0000000..f345aaa --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactproduct-android.json @@ -0,0 +1,289 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchDeactive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"20200407\",\n \"products\": [\"159349001\", \"159349002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section19732165701719", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch operate products success.\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-android-0000002136087432", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617", + "title": "批量激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412", + "title": "查询是否有在线商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section32521047636", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section19732165701719", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section8711909", + "text": "此接口用于批量去激活商品。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchDeactive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品标识,只有上线状态的商品才能被去激活。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section32521047636" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "成功个数。" + ], + [ + "resultInfo", + "M", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section49198053" + } + ], + "title": "批量去激活商品", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:12.479Z", + "family": "pms", + "endpoint": "batchdeactproduct-android" +} diff --git a/pkg/domain/reference/pms/batchdeactproduct-android.parameters.json b/pkg/domain/reference/pms/batchdeactproduct-android.parameters.json new file mode 100644 index 0000000..23d2775 --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactproduct-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section62221212714" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section32521047636" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品标识,只有上线状态的商品才能被去激活。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320#section32521047636", + "itemsType": "string" + } +] diff --git a/pkg/domain/reference/pms/batchdeactproduct-harmonyosnext.json b/pkg/domain/reference/pms/batchdeactproduct-harmonyosnext.json new file mode 100644 index 0000000..dff9677 --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactproduct-harmonyosnext.json @@ -0,0 +1,285 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchDeactive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"20200407\",\n \"products\": [\"159349001\", \"159349002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section19732165701719", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch operate products success.\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-harmonyosnext-0000002166670161", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712", + "title": "批量激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145", + "title": "查询是否有在线商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section32521047636", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section19732165701719", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section8711909", + "text": "此接口用于批量去激活商品,下线已生效商品,结束促销活动。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchDeactive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品标识,只有上线状态的商品才能被去激活。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section32521047636" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "成功个数。" + ], + [ + "resultInfo", + "M", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section49198053" + } + ], + "title": "批量去激活商品", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:58:14.167Z", + "family": "pms", + "endpoint": "batchdeactproduct-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/batchdeactproduct-harmonyosnext.parameters.json b/pkg/domain/reference/pms/batchdeactproduct-harmonyosnext.parameters.json new file mode 100644 index 0000000..5cf4271 --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactproduct-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section62221212714" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section32521047636" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品标识,只有上线状态的商品才能被去激活。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613#section32521047636", + "itemsType": "string" + } +] diff --git a/pkg/domain/reference/pms/batchdeactpromotion-android.json b/pkg/domain/reference/pms/batchdeactpromotion-android.json new file mode 100644 index 0000000..3674219 --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactpromotion-android.json @@ -0,0 +1,295 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion/batchDeactive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123234\",\n \"promotions\": [\"2B04888F868440D288337A0954B37001\", \"2B04888F868440D288337A0954B37002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section2884102017316", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch deactivate promotion success\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-perrorinfo-android-0000002135929352", + "title": "PromotionErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025", + "title": "批量上线商品促销活动" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-android-0000002135929332", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section2884102017316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section8711909", + "text": "此接口用于批量下线商品促销活动。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion/batchDeactive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列。" + ], + [ + "promotions", + "M", + "List", + "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + ], + [ + "immediateEnd", + "O", + "String(2)", + "值为1标识促销立即结束,更新促销结束时间,不传或者其它值不更新促销结束时间。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "批量消息中的失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "批量消息中的成功个数。" + ], + [ + "resultInfo", + "O", + "List", + "操作错误信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section49198053" + } + ], + "title": "批量下线商品促销活动", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:15.604Z", + "family": "pms", + "endpoint": "batchdeactpromotion-android" +} diff --git a/pkg/domain/reference/pms/batchdeactpromotion-android.parameters.json b/pkg/domain/reference/pms/batchdeactpromotion-android.parameters.json new file mode 100644 index 0000000..ae87e80 --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactpromotion-android.parameters.json @@ -0,0 +1,38 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section1146731320212" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545", + "maxLength": 64 + }, + { + "name": "promotions", + "in": "body", + "type": "array", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545", + "itemsType": "string", + "maxItems": 100 + }, + { + "name": "immediateEnd", + "in": "body", + "type": "string", + "required": false, + "description": "值为1标识促销立即结束,更新促销结束时间,不传或者其它值不更新促销结束时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-android-0000002171288629#section48988321545", + "maxLength": 2 + } +] diff --git a/pkg/domain/reference/pms/batchdeactpromotion-harmonyosnext.json b/pkg/domain/reference/pms/batchdeactpromotion-harmonyosnext.json new file mode 100644 index 0000000..a5e367b --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactpromotion-harmonyosnext.json @@ -0,0 +1,291 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion/batchDeactive\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123234\",\n \"promotions\": [\"2B04888F868440D288337A0954B37001\", \"2B04888F868440D288337A0954B37002\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section2884102017316", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"Batch deactivate promotion success\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-perrorinfo-harmonyosnext-0000002166748637", + "title": "PromotionErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "title": "批量上线商品促销活动" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-basicapplication-harmonyosnext-0000002131519928", + "title": "查询关联APP已有商品类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section2884102017316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section8711909", + "text": "此接口用于批量下线商品促销活动。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion/batchDeactive" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列。" + ], + [ + "promotions", + "M", + "List", + "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。" + ], + [ + "immediateEnd", + "O", + "String(2)", + "值为1标识促销立即结束,更新促销结束时间,不传或者其它值不更新促销结束时间。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "M", + "Integer", + "批量消息中的失败个数。" + ], + [ + "successNumber", + "M", + "Integer", + "批量消息中的成功个数。" + ], + [ + "resultInfo", + "O", + "List", + "操作错误信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section49198053" + } + ], + "title": "批量下线商品促销活动", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:17.063Z", + "family": "pms", + "endpoint": "batchdeactpromotion-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/batchdeactpromotion-harmonyosnext.parameters.json b/pkg/domain/reference/pms/batchdeactpromotion-harmonyosnext.parameters.json new file mode 100644 index 0000000..cc18f8f --- /dev/null +++ b/pkg/domain/reference/pms/batchdeactpromotion-harmonyosnext.parameters.json @@ -0,0 +1,38 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section1146731320212" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545", + "maxLength": 64 + }, + { + "name": "promotions", + "in": "body", + "type": "array", + "required": true, + "description": "商品促销ID列表,促销ID长度最大32字符,列表中不超过100个促销ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545", + "itemsType": "string", + "maxItems": 100 + }, + { + "name": "immediateEnd", + "in": "body", + "type": "string", + "required": false, + "description": "值为1标识促销立即结束,更新促销结束时间,不传或者其它值不更新促销结束时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactpromotion-harmonyosnext-0000002131350720#section48988321545", + "maxLength": 2 + } +] diff --git a/pkg/domain/reference/pms/batchupdateproduct-android.json b/pkg/domain/reference/pms/batchupdateproduct-android.json new file mode 100644 index 0000000..9cc5796 --- /dev/null +++ b/pkg/domain/reference/pms/batchupdateproduct-android.json @@ -0,0 +1,293 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section19934722144316", + "text": "请求示例\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchImportProducts\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n{\n \"requestId\": \"string\",\n \"products\": [{\n \"productNo\": \"4862300\",\n \"status\": \"active\",\n \"productName\": \"消耗性001\",\n \"productDesc\": \"消耗性简介01\",\n \"purchaseType\": \"auto_subscription\",\n \"force\": 0,\n \"defaultLocale\": \"zh_CN\",\n \"defaultPriceInfo\": {\n \"country\": \"CN\",\n \"price\": \"55\",\n \"currency\": \"CNY\"\n },\n \"languages\": [{\n \"locale\": \"en_GB\",\n \"productName\": \"消耗性01en_GB\",\n \"productDesc\": \"消耗性简介01en_GB\"\n }],\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"prices\": [{\n \"country\": \"CN\",\n \"price\": \"120\"\n }],\n \"promotion\": {\n \"promotionId\": \"B04888F868440D288337A095B4862300\",\n \"promotionTitle\": \"prom01\",\n \"startDate\": 3164748860000,\n \"endDate\": 3164748869889,\n \"strategy\": \"introductory\",\n \"price\": 50,\n \"languages\": [{\n \"locale\": \"en_GB\",\n \"title\": \"mei guo ming cheng\",\n \"desc\": \"mei guo desc\"\n }],\n \"promotionPrice\": [{\n \"price\": 20,\n \"country\": \"CN\"\n }]\n }\n }, {\n \"productNo\": \"4862301\",\n \"status\": \"active\",\n \"productName\": \"消耗性002\",\n \"productDesc\": \"消耗性简介02\",\n \"purchaseType\": \"auto_subscription\",\n \"force\": 0,\n \"defaultLocale\": \"zh_CN\",\n \"defaultPriceInfo\": {\n \"country\": \"CN\",\n \"price\": \"60\",\n \"currency\": \"CNY\"\n },\n \"languages\": [{\n \"locale\": \"en_GB\",\n \"productName\": \"消耗性02en_GB\",\n \"productDesc\": \"消耗性简介02en_GB\"\n }],\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"prices\": [{\n \"country\": \"CN\",\n \"price\": \"200\"\n }],\n \"promotion\": {\n \"promotionId\": \"B04888F868440D288337A095B4862301\",\n \"promotionTitle\": \"prom02\",\n \"startDate\": 3164748860000,\n \"endDate\": 3164748869889,\n \"strategy\": \"introductory\",\n \"price\": 50,\n \"languages\": [{\n \"locale\": \"en-US\",\n \"title\": \"mei guo ming cheng\",\n \"desc\": \"mei guo desc\"\n }],\n \"promotionPrice\": [{\n \"price\": 20,\n \"country\": \"CN\"\n }]\n }\n }]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section1234915176137", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "title": "ProductImportInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-android-0000002136087432", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404", + "title": "更新商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-android-0000002171288617", + "title": "批量激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section13500173412311", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section1234915176137", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section8711909", + "text": "此接口用于批量更新商品定义信息,展示语言,商品价格,促销活动信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/batchImportProducts" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列ID,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品列表信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section13500173412311" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "O", + "Integer", + "批量更新商品中的失败个数。" + ], + [ + "successNumber", + "O", + "Integer", + "批量更新商品中的成功个数。" + ], + [ + "resultInfo", + "O", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section49198053" + } + ], + "title": "批量更新商品", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:18.434Z", + "family": "pms", + "endpoint": "batchupdateproduct-android" +} diff --git a/pkg/domain/reference/pms/batchupdateproduct-android.parameters.json b/pkg/domain/reference/pms/batchupdateproduct-android.parameters.json new file mode 100644 index 0000000..b4db15d --- /dev/null +++ b/pkg/domain/reference/pms/batchupdateproduct-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section167891815112" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列ID,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section13500173412311" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品列表信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013#section13500173412311", + "itemsType": "object" + } +] diff --git a/pkg/domain/reference/pms/batchupdateproduct-harmonyosnext.json b/pkg/domain/reference/pms/batchupdateproduct-harmonyosnext.json new file mode 100644 index 0000000..f3ff75f --- /dev/null +++ b/pkg/domain/reference/pms/batchupdateproduct-harmonyosnext.json @@ -0,0 +1,289 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchImportProducts \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n \n{ \n \"requestId\": \"string\", \n \"products\": [{ \n \"productNo\": \"4862300\", \n \"status\": \"active\", \n \"productName\": \"消耗性001\", \n \"productDesc\": \"消耗性简介01\", \n \"purchaseType\": \"auto_subscription\", \n \"force\": 0, \n \"defaultLocale\": \"zh_CN\", \n \"defaultPriceInfo\": { \n \"country\": \"CN\", \n \"price\": \"55\", \n \"currency\": \"CNY\" \n }, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"productName\": \"消耗性01en_GB\", \n \"productDesc\": \"消耗性简介01en_GB\" \n }], \n \"reviewResourceId\": \"22AA702C947A42A7AF059779D18E872A\",\n \"reviewPath\": \"我的-会员中心-黄金会员\",\n \"reviewNote\": \"新建商品\",\n \"taxIncluded\": 1,\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"120\" \n }], \n \"promotion\": { \n \"promotionId\": \"B04888F868440D288337A095B4862300\", \n \"promotionTitle\": \"prom01\", \n \"startDate\": 3164748860000, \n \"endDate\": 3164748869889, \n \"strategy\": \"introductory\", \n \"price\": 50, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"title\": \"mei guo ming cheng\", \n \"desc\": \"mei guo desc\" \n }], \n \"promotionPrice\": [{ \n \"price\": 20, \n \"country\": \"CN\" \n }] \n } \n }, { \n \"productNo\": \"4862301\", \n \"status\": \"active\", \n \"productName\": \"消耗性002\", \n \"productDesc\": \"消耗性简介02\", \n \"purchaseType\": \"auto_subscription\", \n \"force\": 0, \n \"defaultLocale\": \"zh_CN\", \n \"defaultPriceInfo\": { \n \"country\": \"CN\", \n \"price\": \"60\", \n \"currency\": \"CNY\" \n }, \n \"languages\": [{ \n \"locale\": \"en_GB\", \n \"productName\": \"消耗性02en_GB\", \n \"productDesc\": \"消耗性简介02en_GB\" \n }], \n \"reviewResourceId\": \"22AA702C947A42A7AF059779D18E872B\",\n \"reviewPath\": \"我的-会员中心-白金会员\",\n \"reviewNote\": \"新建商品\",\n \"taxIncluded\": 1,\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"200\" \n }], \n \"promotion\": { \n \"promotionId\": \"B04888F868440D288337A095B4862301\", \n \"promotionTitle\": \"prom02\", \n \"startDate\": 3164748860000, \n \"endDate\": 3164748869889, \n \"strategy\": \"introductory\", \n \"price\": 50, \n \"languages\": [{ \n \"locale\": \"en-US\", \n \"title\": \"mei guo ming cheng\", \n \"desc\": \"mei guo desc\" \n }], \n \"promotionPrice\": [{ \n \"price\": 20, \n \"country\": \"CN\" \n }] \n } \n }] \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section1234915176137", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n },\n \"failedNumber\": 0,\n \"resultInfo\": [],\n \"successNumber\": 2\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "title": "ProductImportInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-harmonyosnext-0000002166670161", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141", + "title": "更新商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactproduct-harmonyosnext-0000002131350712", + "title": "批量激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section13500173412311", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section1234915176137", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section8711909", + "text": "此接口用于批量更新商品定义信息,展示语言,商品价格,促销活动信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/batchImportProducts" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列ID,开发者自定义唯一标识符。" + ], + [ + "products", + "M", + "List", + "商品列表信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section13500173412311" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "failedNumber", + "O", + "Integer", + "批量更新商品中的失败个数。" + ], + [ + "successNumber", + "O", + "Integer", + "批量更新商品中的成功个数。" + ], + [ + "resultInfo", + "O", + "List", + "失败原因说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section49198053" + } + ], + "title": "批量更新商品", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:20.551Z", + "family": "pms", + "endpoint": "batchupdateproduct-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/batchupdateproduct-harmonyosnext.parameters.json b/pkg/domain/reference/pms/batchupdateproduct-harmonyosnext.parameters.json new file mode 100644 index 0000000..51043ef --- /dev/null +++ b/pkg/domain/reference/pms/batchupdateproduct-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section167891815112" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列ID,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section13500173412311" + }, + { + "name": "products", + "in": "body", + "type": "array", + "required": true, + "description": "商品列表信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852#section13500173412311", + "itemsType": "object" + } +] diff --git a/pkg/domain/reference/pms/bygetproductinfo-android.json b/pkg/domain/reference/pms/bygetproductinfo-android.json new file mode 100644 index 0000000..39efb15 --- /dev/null +++ b/pkg/domain/reference/pms/bygetproductinfo-android.json @@ -0,0 +1,347 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/list\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"country\": \"CN\",\n \"requestId\": \"123411111111\",\n \"productName\": \"创建商品定义信息\",\n \"pageNum\": 1,\n \"pageSize\": 10\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section1674723458", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"products\": [{\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息0\",\n \"productNo\": \"/manage/product0\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF1\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息1\",\n \"productNo\": \"/manage/product1\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF2\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息2\",\n \"productNo\": \"/manage/product2\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF3\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息3\",\n \"productNo\": \"/manage/product3\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF4\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息4\",\n \"productNo\": \"/manage/product4\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF5\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息5\",\n \"productNo\": \"/manage/product5\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF6\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息6\",\n \"productNo\": \"/manage/product6\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF7\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息7\",\n \"productNo\": \"/manage/product7\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF8\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息8\",\n \"productNo\": \"/manage/product8\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF9\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息9\",\n \"productNo\": \"/manage/product9\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }],\n \"totalNumber\": 10\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdetailinfo-android-0000002136087428", + "title": "ProductDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609", + "title": "查询商品详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404", + "title": "更新商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section1674723458", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section8711909", + "text": "此接口用于商品查询,支持多条件过滤,根据productNo和AppId唯一查询一个商品信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/list" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "productNo", + "O", + "String", + "查询应用内指定商品标识的商品,如果不传值默认查询所有应用内商品。支持多个商品标识过滤查询,使用英文逗号分隔。" + ], + [ + "productName", + "O", + "String(55)", + "待查询的商品名称,支持按关键字模糊查询。不支持特殊字符|。" + ], + [ + "purchaseType", + "O", + "String", + "如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型" + ], + [ + "status", + "O", + "String", + "如果查多种商品状态,使用英文逗号分隔,取值如下: active:在线 inactive:下线 delete:删除" + ], + [ + "orderBy", + "O", + "String", + "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: price:价格 updateTime:更新时间 value取值desc降序或者asc升序 例如:按价格price升序,更新时间updateTime降序, 则配置为{\"price\": \"asc\",\"updateTime\": \"desc\"}" + ], + [ + "beginTime", + "O", + "String", + "商品更新开始时间,格式为:yyyy-MM-dd HH:mm:ss。" + ], + [ + "endTime", + "O", + "String", + "商品更新结束时间,格式为:yyyy-MM-dd HH:mm:ss。 beginTime和endTime设置后可以查询出updateTime在此时间段内的商品。" + ], + [ + "pageNum", + "O", + "Integer", + "请求查询的起始页码,默认值:1。" + ], + [ + "pageSize", + "O", + "Integer", + "每页请求数目,默认每页20条,最大不能超过300。" + ], + [ + "country", + "M", + "String", + "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + ], + [ + "groupId", + "O", + "String", + "订阅组ID,如果不为空,则仅查询该组下商品。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "totalNumber", + "M", + "Integer", + "查询出的商品总个数。" + ], + [ + "products", + "M", + "List", + "商品列表信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section49198053" + } + ], + "title": "按条件查询商品信息", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:21.986Z", + "family": "pms", + "endpoint": "bygetproductinfo-android" +} diff --git a/pkg/domain/reference/pms/bygetproductinfo-android.parameters.json b/pkg/domain/reference/pms/bygetproductinfo-android.parameters.json new file mode 100644 index 0000000..5228c74 --- /dev/null +++ b/pkg/domain/reference/pms/bygetproductinfo-android.parameters.json @@ -0,0 +1,108 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section9925175016016" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "maxLength": 64 + }, + { + "name": "productNo", + "in": "body", + "type": "string", + "required": false, + "description": "查询应用内指定商品标识的商品,如果不传值默认查询所有应用内商品。支持多个商品标识过滤查询,使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "productName", + "in": "body", + "type": "string", + "required": false, + "description": "待查询的商品名称,支持按关键字模糊查询。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316", + "maxLength": 55 + }, + { + "name": "purchaseType", + "in": "body", + "type": "string", + "required": false, + "description": "如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "status", + "in": "body", + "type": "string", + "required": false, + "description": "如果查多种商品状态,使用英文逗号分隔,取值如下: active:在线 inactive:下线 delete:删除", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "orderBy", + "in": "body", + "type": "string", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: price:价格 updateTime:更新时间 value取值desc降序或者asc升序 例如:按价格price升序,更新时间updateTime降序, 则配置为{\"price\": \"asc\",\"updateTime\": \"desc\"}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "beginTime", + "in": "body", + "type": "string", + "required": false, + "description": "商品更新开始时间,格式为:yyyy-MM-dd HH:mm:ss。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "endTime", + "in": "body", + "type": "string", + "required": false, + "description": "商品更新结束时间,格式为:yyyy-MM-dd HH:mm:ss。 beginTime和endTime设置后可以查询出updateTime在此时间段内的商品。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "pageNum", + "in": "body", + "type": "integer", + "required": false, + "description": "请求查询的起始页码,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "country", + "in": "body", + "type": "string", + "required": true, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": false, + "description": "订阅组ID,如果不为空,则仅查询该组下商品。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316#section57323163316" + } +] diff --git a/pkg/domain/reference/pms/bygetproductinfo-harmonyosnext.json b/pkg/domain/reference/pms/bygetproductinfo-harmonyosnext.json new file mode 100644 index 0000000..877f373 --- /dev/null +++ b/pkg/domain/reference/pms/bygetproductinfo-harmonyosnext.json @@ -0,0 +1,343 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/list\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"country\": \"CN\",\n \"requestId\": \"123411111111\",\n \"productName\": \"创建商品定义信息\",\n \"pageNum\": 1,\n \"pageSize\": 10\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section1674723458", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"products\": [{\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息0\",\n \"productNo\": \"/manage/product0\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF1\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息1\",\n \"productNo\": \"/manage/product1\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF2\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息2\",\n \"productNo\": \"/manage/product2\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF3\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息3\",\n \"productNo\": \"/manage/product3\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF4\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息4\",\n \"productNo\": \"/manage/product4\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF5\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息5\",\n \"productNo\": \"/manage/product5\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF6\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息6\",\n \"productNo\": \"/manage/product6\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF7\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息7\",\n \"productNo\": \"/manage/product7\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF8\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息8\",\n \"productNo\": \"/manage/product8\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }, {\n \"country\": \"US\",\n \"currency\": \"CNY\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF9\",\n \"isPromotion\": 0,\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": \"600\",\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"创建商品定义信息9\",\n \"productNo\": \"/manage/product9\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }],\n \"totalNumber\": 10\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdetailinfo-harmonyosnext-0000002166670157", + "title": "ProductDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", + "title": "查询商品详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141", + "title": "更新商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section1674723458", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section8711909", + "text": "此接口用于商品查询,支持多条件过滤,根据productNo和AppId唯一查询一个商品信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/list" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "productNo", + "O", + "String", + "查询应用内指定商品标识的商品,如果不传值默认查询所有应用内商品。支持多个商品标识过滤查询,使用英文逗号分隔。" + ], + [ + "productName", + "O", + "String(55)", + "待查询的商品名称,支持按关键字模糊查询。不支持特殊字符|。" + ], + [ + "purchaseType", + "O", + "String", + "如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non_renewing_subscription:非续期订阅型" + ], + [ + "status", + "O", + "String", + "如果查多种商品状态,使用英文逗号分隔,取值如下: active:在线 inactive:下线 delete:删除 drafts: 草稿 toBeSubmitted: 待提交 underReview:审核中 rejected: 审核不通过" + ], + [ + "orderBy", + "O", + "String", + "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: price:价格 updateTime:更新时间 value取值desc降序或者asc升序 例如:按价格price升序,更新时间updateTime降序, 则配置为{\"price\": \"asc\",\"updateTime\": \"desc\"}" + ], + [ + "beginTime", + "O", + "String", + "商品更新开始时间,格式为:yyyy-MM-dd HH:mm:ss。" + ], + [ + "endTime", + "O", + "String", + "商品更新结束时间,格式为:yyyy-MM-dd HH:mm:ss。 beginTime和endTime设置后可以查询出updateTime在此时间段内的商品。" + ], + [ + "pageNum", + "O", + "Integer", + "请求查询的起始页码,默认值:1。" + ], + [ + "pageSize", + "O", + "Integer", + "每页请求数目,默认每页20条,最大不能超过300。" + ], + [ + "country", + "M", + "String", + "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + ], + [ + "groupId", + "O", + "String", + "订阅组ID,如果不为空,则仅查询该组下商品。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "totalNumber", + "M", + "Integer", + "查询出的商品总个数。" + ], + [ + "products", + "M", + "List", + "商品列表信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section49198053" + } + ], + "title": "按条件查询商品信息", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:23.893Z", + "family": "pms", + "endpoint": "bygetproductinfo-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/bygetproductinfo-harmonyosnext.parameters.json b/pkg/domain/reference/pms/bygetproductinfo-harmonyosnext.parameters.json new file mode 100644 index 0000000..6b75262 --- /dev/null +++ b/pkg/domain/reference/pms/bygetproductinfo-harmonyosnext.parameters.json @@ -0,0 +1,108 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section9925175016016" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "maxLength": 64 + }, + { + "name": "productNo", + "in": "body", + "type": "string", + "required": false, + "description": "查询应用内指定商品标识的商品,如果不传值默认查询所有应用内商品。支持多个商品标识过滤查询,使用英文逗号分隔。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "productName", + "in": "body", + "type": "string", + "required": false, + "description": "待查询的商品名称,支持按关键字模糊查询。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316", + "maxLength": 55 + }, + { + "name": "purchaseType", + "in": "body", + "type": "string", + "required": false, + "description": "如果查多种商品类型,使用英文逗号分隔,取值如下: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non_renewing_subscription:非续期订阅型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "status", + "in": "body", + "type": "string", + "required": false, + "description": "如果查多种商品状态,使用英文逗号分隔,取值如下: active:在线 inactive:下线 delete:删除 drafts: 草稿 toBeSubmitted: 待提交 underReview:审核中 rejected: 审核不通过", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "orderBy", + "in": "body", + "type": "string", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: price:价格 updateTime:更新时间 value取值desc降序或者asc升序 例如:按价格price升序,更新时间updateTime降序, 则配置为{\"price\": \"asc\",\"updateTime\": \"desc\"}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "beginTime", + "in": "body", + "type": "string", + "required": false, + "description": "商品更新开始时间,格式为:yyyy-MM-dd HH:mm:ss。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "endTime", + "in": "body", + "type": "string", + "required": false, + "description": "商品更新结束时间,格式为:yyyy-MM-dd HH:mm:ss。 beginTime和endTime设置后可以查询出updateTime在此时间段内的商品。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "pageNum", + "in": "body", + "type": "integer", + "required": false, + "description": "请求查询的起始页码,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "country", + "in": "body", + "type": "string", + "required": true, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": false, + "description": "订阅组ID,如果不为空,则仅查询该组下商品。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609#section57323163316" + } +] diff --git a/pkg/domain/reference/pms/bygetpromotioninfo-android.json b/pkg/domain/reference/pms/bygetpromotioninfo-android.json new file mode 100644 index 0000000..54402e3 --- /dev/null +++ b/pkg/domain/reference/pms/bygetpromotioninfo-android.json @@ -0,0 +1,319 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion/list\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123411111111\",\n \"productNo\": \"testforpms715U157\",\n \"strategy\": \"introductory\",\n \"pageNum\": 1,\n \"pageSize\": 10\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section54251026192717", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"productPromotions\": [{\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9554\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9556\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9558\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9551\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9553\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9555\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9557\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9550\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9559\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }, {\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultTier\": \"TIER104\",\n \"endDate\": 1975269862000,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9552\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"updateId\": null,\n \"updateTime\": null,\n \"promotionCountryCount\": 0\n }],\n \"totalNumber\": 10\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppromotion-android-0000002136087436", + "title": "ProductPromotions" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328", + "title": "查询商品促销详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-android-0000002171407025", + "title": "批量上线商品促销活动" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section54251026192717", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section8711909", + "text": "此接口用于商品促销查询,支持多条件过滤。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion/list" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "productNo", + "O", + "String", + "查询指定的商品的促销信息。" + ], + [ + "promotionId", + "O", + "String", + "预留字段,暂不启用。" + ], + [ + "strategy", + "O", + "String", + "策略类型: trial:免费 introductory:按周期扣费" + ], + [ + "pageNum", + "O", + "Integer", + "请求查询的起始页码,默认值:1。" + ], + [ + "pageSize", + "O", + "Integer", + "每页请求数目,默认每页20条,最大不能超过300。" + ], + [ + "orderBy", + "O", + "String", + "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。 key取值范围为: createTime:创建时间 updateTime:更新时间 status:促销进行状态 startDate:开始促销时间 endDate:结束促销时间 value取值desc降序或者asc升序 例如:按createTime升序,updateTime降序,则配置为{\"createTime\": \"asc\",\"updateTime\": \"desc\"}" + ], + [ + "filterBy", + "O", + "String", + "支持按促销状态和时间过滤。配置JSON对象,key为属性名,value为过滤的值。 key值范围如下: status:促销状态取值范围为 0:正在进行中的促销 1:未开始的促销 2:已结束的促销 例如:单选{\"status\":\"0\"}和多选{\"status\":[\"0\", \"1\"]} startDate:促销开始时间范围 例如:{\"startDate\":{\"1621843475000\":\"1631435475000\"}} endDate:促销结束时间范围 例如:{\"endDate\":{\"1621843475000\":\"1631435475000\"}} date:该时间范围内开始的促销、结束的促销和进行中的促销活动 例如:{\"date\":{\"1621843475000\":\"1631435475000\"}} key值可以包含上面的所有取值进行组合过滤,比如同时使用status和startDate过滤可以用下面的JSON: {\"status\":[ \"0\",\"1\"],\"startDate\":{\"1021843475000\":\"1631435475000\"}}" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "totalNumber", + "M", + "Integer", + "查询出的商品促销总个数。" + ], + [ + "productPromotions", + "O", + "List", + "商品促销信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section49198053" + } + ], + "title": "按条件查询商品促销信息", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:25.557Z", + "family": "pms", + "endpoint": "bygetpromotioninfo-android" +} diff --git a/pkg/domain/reference/pms/bygetpromotioninfo-android.parameters.json b/pkg/domain/reference/pms/bygetpromotioninfo-android.parameters.json new file mode 100644 index 0000000..03a9996 --- /dev/null +++ b/pkg/domain/reference/pms/bygetpromotioninfo-android.parameters.json @@ -0,0 +1,75 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section97101017212" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419", + "maxLength": 64 + }, + { + "name": "productNo", + "in": "body", + "type": "string", + "required": false, + "description": "查询指定的商品的促销信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + }, + { + "name": "promotionId", + "in": "body", + "type": "string", + "required": false, + "description": "预留字段,暂不启用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + }, + { + "name": "strategy", + "in": "body", + "type": "string", + "required": false, + "description": "策略类型: trial:免费 introductory:按周期扣费", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + }, + { + "name": "pageNum", + "in": "body", + "type": "integer", + "required": false, + "description": "请求查询的起始页码,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + }, + { + "name": "orderBy", + "in": "body", + "type": "string", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。 key取值范围为: createTime:创建时间 updateTime:更新时间 status:促销进行状态 startDate:开始促销时间 endDate:结束促销时间 value取值desc降序或者asc升序 例如:按createTime升序,updateTime降序,则配置为{\"createTime\": \"asc\",\"updateTime\": \"desc\"}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + }, + { + "name": "filterBy", + "in": "body", + "type": "string", + "required": false, + "description": "支持按促销状态和时间过滤。配置JSON对象,key为属性名,value为过滤的值。 key值范围如下: status:促销状态取值范围为 0:正在进行中的促销 1:未开始的促销 2:已结束的促销 例如:单选{\"status\":\"0\"}和多选{\"status\":[\"0\", \"1\"]} startDate:促销开始时间范围 例如:{\"startDate\":{\"1621843475000\":\"1631435475000\"}} endDate:促销结束时间范围 例如:{\"endDate\":{\"1621843475000\":\"1631435475000\"}} date:该时间范围内开始的促销、结束的促销和进行中的促销活动 例如:{\"date\":{\"1621843475000\":\"1631435475000\"}} key值可以包含上面的所有取值进行组合过滤,比如同时使用status和startDate过滤可以用下面的JSON: {\"status\":[ \"0\",\"1\"],\"startDate\":{\"1021843475000\":\"1631435475000\"}}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416#section1084310219419" + } +] diff --git a/pkg/domain/reference/pms/bygetpromotioninfo-harmonyosnext.json b/pkg/domain/reference/pms/bygetpromotioninfo-harmonyosnext.json new file mode 100644 index 0000000..d2cda13 --- /dev/null +++ b/pkg/domain/reference/pms/bygetpromotioninfo-harmonyosnext.json @@ -0,0 +1,327 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion/list\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123411111111\",\n \"productNo\": \"testforpms715U157\",\n \"strategy\": \"introductory\",\n \"pageNum\": 1,\n \"pageSize\": 10,\n \"promotionType\": 1,\n \"offerId\": \"123131ds\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section54251026192717", + "text": "响应示例\n{ \n \"error\": { \n \"errorCode\": 0, \n \"errorMsg\": null \n }, \n \"productPromotions\": [{ \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9554\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9556\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9558\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9551\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9553\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9555\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9557\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9550\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9559\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 0 \n }, { \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultTier\": \"TIER104\", \n \"endDate\": 1975269862000, \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9552\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"updateId\": null, \n \"updateTime\": null, \n \"promotionCountryCount\": 0, \n \"promotionType\": 4,\n \"betweenOffersNumOfUnits\": 5,\n \"betweenOffersPeriodUnit\": \"M\" \n }], \n \"totalNumber\": 10 \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppromotion-harmonyosnext-0000002166670165", + "title": "ProductPromotions" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617", + "title": "查询商品促销详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchactpromotion-harmonyosnext-0000002131508860", + "title": "批量上线商品促销活动" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section54251026192717", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section8711909", + "text": "此接口用于商品促销查询,支持多条件过滤。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion/list" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "productNo", + "O", + "String", + "查询指定的商品的促销信息。" + ], + [ + "promotionId", + "O", + "String", + "预留字段,暂不启用。" + ], + [ + "strategy", + "O", + "String", + "策略类型: trial:免费(仅自动续期型商品支持) introductory:按周期扣费(仅自动续期型商品支持) pay-up-front:提前支付(仅自动续期型商品支持) single-promotion:单商品优惠(仅消耗型,非消耗型,非续期型商品支持)" + ], + [ + "pageNum", + "O", + "Integer", + "请求查询的起始页码,默认值:1。" + ], + [ + "pageSize", + "O", + "Integer", + "每页请求数目,默认每页20条,最大不能超过300。" + ], + [ + "orderBy", + "O", + "String", + "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。 key取值范围为: createTime:创建时间 updateTime:更新时间 status:促销进行状态 startDate:开始促销时间 endDate:结束促销时间 value取值desc降序或者asc升序 例如:按createTime升序,updateTime降序, 则配置为{\"createTime\": \"asc\",\"updateTime\": \"desc\"}" + ], + [ + "filterBy", + "O", + "String", + "支持按促销状态和时间过滤。配置JSON对象,key为属性名,value为过滤的值。 key值范围如下: status:促销状态取值范围为 0:正在进行中的促销 1:未开始的促销 2:已结束的促销 例如:单选{\"status\":\"0\"}和多选{\"status\":[\"0\", \"1\"]} startDate:促销开始时间范围 例如:{\"startDate\":{\"1621843475000\":\"1631435475000\"}} endDate:促销结束时间范围 例如:{\"endDate\":{\"1621843475000\":\"1631435475000\"}} date:该时间范围内开始的促销、结束的促销和进行中的促销活动 例如:{\"date\":{\"1621843475000\":\"1631435475000\"}} key值可以包含上面的所有取值进行组合过滤,比如同时使用status和startDate过滤可以用下面的JSON: {\"status\":[ \"0\",\"1\"],\"startDate\":{\"1021843475000\":\"1631435475000\"}}" + ], + [ + "promotionType", + "O", + "Integer", + "促销类型,默认值:0。 0:新用户促销 1:自定义人群促销 4:退订挽留促销" + ], + [ + "offerId", + "O", + "String", + "优惠促销标识符,用于区分不同优惠促销,该ID当前商品下唯一,最大长度64个字符,需满足[0-9a-zA-Z],仅在促销类型为自定义人群促销时支持。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "totalNumber", + "M", + "Integer", + "查询出的商品促销总个数。" + ], + [ + "productPromotions", + "O", + "List", + "商品促销信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section49198053" + } + ], + "title": "按条件查询商品促销信息", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:27.712Z", + "family": "pms", + "endpoint": "bygetpromotioninfo-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/bygetpromotioninfo-harmonyosnext.parameters.json b/pkg/domain/reference/pms/bygetpromotioninfo-harmonyosnext.parameters.json new file mode 100644 index 0000000..ca15c15 --- /dev/null +++ b/pkg/domain/reference/pms/bygetpromotioninfo-harmonyosnext.parameters.json @@ -0,0 +1,91 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section97101017212" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419", + "maxLength": 64 + }, + { + "name": "productNo", + "in": "body", + "type": "string", + "required": false, + "description": "查询指定的商品的促销信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "promotionId", + "in": "body", + "type": "string", + "required": false, + "description": "预留字段,暂不启用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "strategy", + "in": "body", + "type": "string", + "required": false, + "description": "策略类型: trial:免费(仅自动续期型商品支持) introductory:按周期扣费(仅自动续期型商品支持) pay-up-front:提前支付(仅自动续期型商品支持) single-promotion:单商品优惠(仅消耗型,非消耗型,非续期型商品支持)", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "pageNum", + "in": "body", + "type": "integer", + "required": false, + "description": "请求查询的起始页码,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "每页请求数目,默认每页20条,最大不能超过300。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "orderBy", + "in": "body", + "type": "string", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。 key取值范围为: createTime:创建时间 updateTime:更新时间 status:促销进行状态 startDate:开始促销时间 endDate:结束促销时间 value取值desc降序或者asc升序 例如:按createTime升序,updateTime降序, 则配置为{\"createTime\": \"asc\",\"updateTime\": \"desc\"}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "filterBy", + "in": "body", + "type": "string", + "required": false, + "description": "支持按促销状态和时间过滤。配置JSON对象,key为属性名,value为过滤的值。 key值范围如下: status:促销状态取值范围为 0:正在进行中的促销 1:未开始的促销 2:已结束的促销 例如:单选{\"status\":\"0\"}和多选{\"status\":[\"0\", \"1\"]} startDate:促销开始时间范围 例如:{\"startDate\":{\"1621843475000\":\"1631435475000\"}} endDate:促销结束时间范围 例如:{\"endDate\":{\"1621843475000\":\"1631435475000\"}} date:该时间范围内开始的促销、结束的促销和进行中的促销活动 例如:{\"date\":{\"1621843475000\":\"1631435475000\"}} key值可以包含上面的所有取值进行组合过滤,比如同时使用status和startDate过滤可以用下面的JSON: {\"status\":[ \"0\",\"1\"],\"startDate\":{\"1021843475000\":\"1631435475000\"}}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "promotionType", + "in": "body", + "type": "integer", + "required": false, + "description": "促销类型,默认值:0。 0:新用户促销 1:自定义人群促销 4:退订挽留促销", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + }, + { + "name": "offerId", + "in": "body", + "type": "string", + "required": false, + "description": "优惠促销标识符,用于区分不同优惠促销,该ID当前商品下唯一,最大长度64个字符,需满足[0-9a-zA-Z],仅在促销类型为自定义人群促销时支持。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149#section1084310219419" + } +] diff --git a/pkg/domain/reference/pms/getproductgroup-android.json b/pkg/domain/reference/pms/getproductgroup-android.json new file mode 100644 index 0000000..a0d93e4 --- /dev/null +++ b/pkg/domain/reference/pms/getproductgroup-android.json @@ -0,0 +1,295 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/group/list\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"12341134541111654111\",\n \"pageNum\": 1,\n \"pageSize\": 10\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section11926155618016", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"simpleGroups\": [{\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749560\",\n \"groupName\": \"product_group_0\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749568\",\n \"groupName\": \"product_group_8\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749567\",\n \"groupName\": \"product_group_7\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749566\",\n \"groupName\": \"product_group_6\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749565\",\n \"groupName\": \"product_group_5\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749564\",\n \"groupName\": \"product_group_4\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749563\",\n \"groupName\": \"product_group_3\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749562\",\n \"groupName\": \"product_group_2\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749561\",\n \"groupName\": \"product_group_1\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749569\",\n \"groupName\": \"product_group_9\",\n \"totalProductNumber\": 1\n }],\n \"totalNumber\": 10\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-sgroupinfo-android-0000002136087444", + "title": "SimpleGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400", + "title": "更新商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609", + "title": "查询商品详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section11926155618016", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section8711909", + "text": "此接口用于查询商品订阅分组信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/group/list" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "pageNum", + "O", + "Integer", + "起始页数,默认值:1。" + ], + [ + "pageSize", + "O", + "Integer", + "返回数据每页的条数, 默认是20。 取值范围:1~300" + ], + [ + "orderBy", + "O", + "String", + "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: name:订阅分组名称 createTime:创建时间 updateTime:更新时间 value取值desc降序或者asc升序 例如:按name降序,按createTime升序,则配置为{\"name\": \"desc\",\"createTime\": \"asc\"}" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "totalNumber", + "M", + "Integer", + "查询出的商品订阅分组总个数。" + ], + [ + "simpleGroups", + "O", + "List", + "简要分组信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section49198053" + } + ], + "title": "查询商品订阅分组信息", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:29.856Z", + "family": "pms", + "endpoint": "getproductgroup-android" +} diff --git a/pkg/domain/reference/pms/getproductgroup-android.parameters.json b/pkg/domain/reference/pms/getproductgroup-android.parameters.json new file mode 100644 index 0000000..8b6c360 --- /dev/null +++ b/pkg/domain/reference/pms/getproductgroup-android.parameters.json @@ -0,0 +1,43 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section173002381406" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736", + "maxLength": 64 + }, + { + "name": "pageNum", + "in": "body", + "type": "integer", + "required": false, + "description": "起始页数,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736" + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "返回数据每页的条数, 默认是20。 取值范围:1~300", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736" + }, + { + "name": "orderBy", + "in": "body", + "type": "string", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: name:订阅分组名称 createTime:创建时间 updateTime:更新时间 value取值desc降序或者asc升序 例如:按name降序,按createTime升序,则配置为{\"name\": \"desc\",\"createTime\": \"asc\"}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009#section98031331736" + } +] diff --git a/pkg/domain/reference/pms/getproductgroup-harmonyosnext.json b/pkg/domain/reference/pms/getproductgroup-harmonyosnext.json new file mode 100644 index 0000000..55a0df3 --- /dev/null +++ b/pkg/domain/reference/pms/getproductgroup-harmonyosnext.json @@ -0,0 +1,291 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group/list\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"12341134541111654111\",\n \"pageNum\": 1,\n \"pageSize\": 10\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section11926155618016", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"simpleGroups\": [{\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749560\",\n \"groupName\": \"product_group_0\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749568\",\n \"groupName\": \"product_group_8\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749567\",\n \"groupName\": \"product_group_7\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749566\",\n \"groupName\": \"product_group_6\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749565\",\n \"groupName\": \"product_group_5\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749564\",\n \"groupName\": \"product_group_4\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749563\",\n \"groupName\": \"product_group_3\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749562\",\n \"groupName\": \"product_group_2\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749561\",\n \"groupName\": \"product_group_1\",\n \"totalProductNumber\": 1\n }, {\n \"appId\": \"C0019467628\",\n \"effectiveProductNumber\": 1,\n \"groupId\": \"5BAA950CD1264659B548D53E90749569\",\n \"groupName\": \"product_group_9\",\n \"totalProductNumber\": 1\n }],\n \"totalNumber\": 10\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-sgroupinfo-harmonyosnext-0000002166670173", + "title": "SimpleGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137", + "title": "更新商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485", + "title": "更新商品订阅分组等级信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section11926155618016", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section8711909", + "text": "此接口用于查询商品订阅分组信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group/list" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "pageNum", + "O", + "Integer", + "起始页数,默认值:1。" + ], + [ + "pageSize", + "O", + "Integer", + "返回数据每页的条数, 默认是20。 取值范围:1~300" + ], + [ + "orderBy", + "O", + "String", + "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: name:订阅分组名称 createTime:创建时间 updateTime:更新时间 value取值desc降序或者asc升序 例如:按name降序,按createTime升序,则配置为{\"name\": \"desc\",\"createTime\": \"asc\"}" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "totalNumber", + "M", + "Integer", + "查询出的商品订阅分组总个数。" + ], + [ + "simpleGroups", + "O", + "List", + "简要分组信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section49198053" + } + ], + "title": "查询商品订阅分组信息", + "updatedAt": "2025-11-21 13:50", + "checkedAt": "2026-10-07T02:58:32.112Z", + "family": "pms", + "endpoint": "getproductgroup-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/getproductgroup-harmonyosnext.parameters.json b/pkg/domain/reference/pms/getproductgroup-harmonyosnext.parameters.json new file mode 100644 index 0000000..c393a9e --- /dev/null +++ b/pkg/domain/reference/pms/getproductgroup-harmonyosnext.parameters.json @@ -0,0 +1,43 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section173002381406" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736", + "maxLength": 64 + }, + { + "name": "pageNum", + "in": "body", + "type": "integer", + "required": false, + "description": "起始页数,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736" + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "返回数据每页的条数, 默认是20。 取值范围:1~300", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736" + }, + { + "name": "orderBy", + "in": "body", + "type": "string", + "required": false, + "description": "按名称升序或者降序排序。配置JSON对象,key为属性名,value为排序规则。不传值时默认按照数据库中创建时间降序。 key取值范围为: name:订阅分组名称 createTime:创建时间 updateTime:更新时间 value取值desc降序或者asc升序 例如:按name降序,按createTime升序,则配置为{\"name\": \"desc\",\"createTime\": \"asc\"}", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848#section98031331736" + } +] diff --git a/pkg/domain/reference/pms/getproductinfo-android.json b/pkg/domain/reference/pms/getproductinfo-android.json new file mode 100644 index 0000000..93a9a0e --- /dev/null +++ b/pkg/domain/reference/pms/getproductinfo-android.json @@ -0,0 +1,281 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nGET https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product?productNo=123252532\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1345012371327", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"product\": {\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"groupName\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"isPromotion\": 0,\n \"languages\": [],\n \"prices\": [],\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": null,\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"TMC05WU83SF04442VX4\",\n \"productNo\": \"/manage/product\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdetailinfo-android-0000002136087428", + "title": "ProductDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009", + "title": "查询商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316", + "title": "按条件查询商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1212175012015", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1345012371327", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section8711909", + "text": "此接口用于商品详情查询,根据productNo和appId唯一查询一个商品信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product?productNo={productNo}&country={country}" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section2862142512223" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "productNo", + "M", + "String", + "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。" + ], + [ + "country", + "O", + "String", + "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1212175012015" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "product", + "M", + "ProductDetailInfo", + "商品详情信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section49198053" + } + ], + "title": "查询商品详情", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:33.741Z", + "family": "pms", + "endpoint": "getproductinfo-android" +} diff --git a/pkg/domain/reference/pms/getproductinfo-android.parameters.json b/pkg/domain/reference/pms/getproductinfo-android.parameters.json new file mode 100644 index 0000000..cc0d5a5 --- /dev/null +++ b/pkg/domain/reference/pms/getproductinfo-android.parameters.json @@ -0,0 +1,26 @@ +[ + { + "name": "productNo", + "in": "query", + "type": "string", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1212175012015" + }, + { + "name": "country", + "in": "query", + "type": "string", + "required": false, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section1212175012015" + }, + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-android-0000002171288609#section12772174510012" + } +] diff --git a/pkg/domain/reference/pms/getproductinfo-harmonyosnext.json b/pkg/domain/reference/pms/getproductinfo-harmonyosnext.json new file mode 100644 index 0000000..4a96365 --- /dev/null +++ b/pkg/domain/reference/pms/getproductinfo-harmonyosnext.json @@ -0,0 +1,283 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nGET https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product?productNo=123252532\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1345012371327", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"product\": {\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"defaultLocale\": \"th_TH\",\n \"defaultTier\": \"TIER106\",\n \"developerId\": \"wwh_xn\",\n \"groupId\": null,\n \"groupName\": null,\n \"id\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"isPromotion\": 0,\n \"languages\": [],\n \"prices\": [],\n \"localPrice\": null,\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"price\": null,\n \"purchaseType\": \"consumable\",\n \"productDesc\": \"N88395Y6Z6VL70I4B6S2Z6L68DGW3\",\n \"productName\": \"TMC05WU83SF04442VX4\",\n \"productNo\": \"/manage/product\",\n \"resourceType\": 7,\n \"status\": \"active\",\n \"updateTime\": \"2016-09-23 10:56:24\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdetailinfo-harmonyosnext-0000002166670157", + "title": "ProductDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485", + "title": "更新商品订阅分组等级信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609", + "title": "按条件查询商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1345012371327", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section8711909", + "text": "此接口用于商品详情查询,根据productNo和appId唯一查询一个商品信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product?productNo={productNo}&productId ={productId}&country={country}" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section2862142512223" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "productNo", + "O", + "String", + "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 注意 productNo和productId必须至少传一个。" + ], + [ + "productId", + "O", + "String", + "注意 productNo和productId必须至少传一个。" + ], + [ + "country", + "O", + "String", + "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "product", + "M", + "ProductDetailInfo", + "商品详情信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section49198053" + } + ], + "title": "查询商品详情", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:35.430Z", + "family": "pms", + "endpoint": "getproductinfo-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/getproductinfo-harmonyosnext.parameters.json b/pkg/domain/reference/pms/getproductinfo-harmonyosnext.parameters.json new file mode 100644 index 0000000..30300de --- /dev/null +++ b/pkg/domain/reference/pms/getproductinfo-harmonyosnext.parameters.json @@ -0,0 +1,34 @@ +[ + { + "name": "productNo", + "in": "query", + "type": "string", + "required": false, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 注意 productNo和productId必须至少传一个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015" + }, + { + "name": "productId", + "in": "query", + "type": "string", + "required": false, + "description": "注意 productNo和productId必须至少传一个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015" + }, + { + "name": "country", + "in": "query", + "type": "string", + "required": false, + "description": "将商品价格转为该国家的价格进行展示。 请参见国家/地区、语言、币种列表,例如US、CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section1212175012015" + }, + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708#section12772174510012" + } +] diff --git a/pkg/domain/reference/pms/getpromotioninfo-android.json b/pkg/domain/reference/pms/getpromotioninfo-android.json new file mode 100644 index 0000000..d5ec6e8 --- /dev/null +++ b/pkg/domain/reference/pms/getpromotioninfo-android.json @@ -0,0 +1,271 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nGET https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion?promotionId=26881C5204E7285EFE6E8A7CF955AAA2\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section152931937152418", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n },\n \"promotion\": {\n \"defaultTier\": \"null\",\n \"createId\": \"wwh_xn\",\n \"createTime\": \"2019-12-06 16:28:56\",\n \"defaultLocale\": \"zh-CN\",\n \"defaultPrice\": \"null\",\n \"endDate\": 1975269862000,\n \"introductory\": [],\n \"languages\": [],\n \"numberOfUnits\": null,\n \"periodUnit\": null,\n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\",\n \"promotionDesc\": \"default desc\",\n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9552\",\n \"promotionTitle\": \"postman创建13535\",\n \"startDate\": 1975010662000,\n \"country\": null,\n \"currency\": null,\n \"status\": 1,\n \"promotionStatus\": \"active\",\n \"strategy\": \"introductory\",\n \"prices\": [],\n \"updateId\": null,\n \"updateTime\": null\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppdetailinfo-android-0000002171288641", + "title": "ProductPromotionDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621", + "title": "更新商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-android-0000002136087416", + "title": "按条件查询商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section538885302312", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section152931937152418", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section8711909", + "text": "此接口用于查询商品促销信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion?promotionId={promotionId}" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section2862142512223" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "promotionId", + "M", + "String", + "促销优惠活动唯一ID。 获取来源: 调用创建商品促销信息接口,返回promotionId 。 调用按条件查询商品促销信息接口,会返回promotionId。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section538885302312" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "promotion", + "O", + "ProductPromotionDetailInfo", + "促销详情信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section49198053" + } + ], + "title": "查询商品促销详情", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:37.263Z", + "family": "pms", + "endpoint": "getpromotioninfo-android" +} diff --git a/pkg/domain/reference/pms/getpromotioninfo-android.parameters.json b/pkg/domain/reference/pms/getpromotioninfo-android.parameters.json new file mode 100644 index 0000000..43e361f --- /dev/null +++ b/pkg/domain/reference/pms/getpromotioninfo-android.parameters.json @@ -0,0 +1,18 @@ +[ + { + "name": "promotionId", + "in": "query", + "type": "string", + "required": true, + "description": "促销优惠活动唯一ID。 获取来源: 调用创建商品促销信息接口,返回promotionId 。 调用按条件查询商品促销信息接口,会返回promotionId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section538885302312" + }, + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328#section113391555316" + } +] diff --git a/pkg/domain/reference/pms/getpromotioninfo-harmonyosnext.json b/pkg/domain/reference/pms/getpromotioninfo-harmonyosnext.json new file mode 100644 index 0000000..3ffa563 --- /dev/null +++ b/pkg/domain/reference/pms/getpromotioninfo-harmonyosnext.json @@ -0,0 +1,267 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nGET https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion?promotionId=26881C5204E7285EFE6E8A7CF955AAA2\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section152931937152418", + "text": "响应示例\n{ \n \"error\": { \n \"errorCode\": 0, \n \"errorMsg\": null \n }, \n \"promotion\": { \n \"defaultTier\": \"null\", \n \"createId\": \"wwh_xn\", \n \"createTime\": \"2019-12-06 16:28:56\", \n \"defaultLocale\": \"zh-CN\", \n \"defaultPrice\": \"null\", \n \"endDate\": 1975269862000, \n \"introductory\": [], \n \"languages\": [], \n \"numberOfUnits\": null, \n \"periodUnit\": null, \n \"productId\": \"9C1B4C23702341ACA3F51A9FA1B36BF0\", \n \"promotionDesc\": \"default desc\", \n \"promotionId\": \"26B62881C5204E7285EFE6E8A7CF9552\", \n \"promotionTitle\": \"postman创建13535\", \n \"startDate\": 1975010662000, \n \"country\": null, \n \"currency\": null, \n \"status\": 1, \n \"promotionStatus\": \"active\", \n \"strategy\": \"introductory\", \n \"prices\": [], \n \"updateId\": null, \n \"updateTime\": null ,\n \"promotionType\": 4,\n \"betweenOffersNumOfUnits\": 5,\n \"betweenOffersPeriodUnit\": \"M\"\n } \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppdetailinfo-harmonyosnext-0000002131350732", + "title": "ProductPromotionDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716", + "title": "更新商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetpromotioninfo-harmonyosnext-0000002166670149", + "title": "按条件查询商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section538885302312", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section152931937152418", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section8711909", + "text": "此接口用于查询商品促销信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion?promotionId={promotionId}" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section2862142512223" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "参数类型", + "描述" + ], + [ + "promotionId", + "M", + "String", + "促销优惠活动唯一ID。 获取来源: 调用创建商品促销信息接口,返回promotionId。 调用按条件查询商品促销信息接口,返回promotionId。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section538885302312" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "promotion", + "O", + "ProductPromotionDetailInfo", + "促销详情信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section49198053" + } + ], + "title": "查询商品促销详情", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:40.079Z", + "family": "pms", + "endpoint": "getpromotioninfo-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/getpromotioninfo-harmonyosnext.parameters.json b/pkg/domain/reference/pms/getpromotioninfo-harmonyosnext.parameters.json new file mode 100644 index 0000000..8f69edf --- /dev/null +++ b/pkg/domain/reference/pms/getpromotioninfo-harmonyosnext.parameters.json @@ -0,0 +1,18 @@ +[ + { + "name": "promotionId", + "in": "query", + "type": "string", + "required": true, + "description": "促销优惠活动唯一ID。 获取来源: 调用创建商品促销信息接口,返回promotionId。 调用按条件查询商品促销信息接口,返回promotionId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section538885302312" + }, + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617#section113391555316" + } +] diff --git a/pkg/domain/reference/pms/isproductactive-android.json b/pkg/domain/reference/pms/isproductactive-android.json new file mode 100644 index 0000000..65d989b --- /dev/null +++ b/pkg/domain/reference/pms/isproductactive-android.json @@ -0,0 +1,248 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section19934722144316", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/check\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section695217568397", + "text": "响应示例\n{\n \"checkInfos\": [{\n \"checkItem\": \"201\",\n \"checkResult\": \"1\"\n }],\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pcheckinfo-android-0000002135929340", + "title": "ProductCheckInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-android-0000002135929320", + "title": "批量去激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021", + "title": "创建商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section695217568397", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section8711909", + "text": "此接口用于根据AppId查询是否有激活的商品。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/check" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "checkInfos", + "M", + "List", + "检查结果列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section49198053" + } + ], + "title": "查询是否有在线商品", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:42.070Z", + "family": "pms", + "endpoint": "isproductactive-android" +} diff --git a/pkg/domain/reference/pms/isproductactive-android.parameters.json b/pkg/domain/reference/pms/isproductactive-android.parameters.json new file mode 100644 index 0000000..0a9b110 --- /dev/null +++ b/pkg/domain/reference/pms/isproductactive-android.parameters.json @@ -0,0 +1,10 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-android-0000002136087412#section4531181919117" + } +] diff --git a/pkg/domain/reference/pms/isproductactive-harmonyosnext.json b/pkg/domain/reference/pms/isproductactive-harmonyosnext.json new file mode 100644 index 0000000..18c85f1 --- /dev/null +++ b/pkg/domain/reference/pms/isproductactive-harmonyosnext.json @@ -0,0 +1,244 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section19934722144316", + "text": "请求示例\nGET https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/check\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section695217568397", + "text": "响应示例\n{\n \"checkInfos\": [{\n \"checkItem\": \"201\",\n \"checkResult\": \"1\"\n }],\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pcheckinfo-harmonyosnext-0000002166748625", + "title": "ProductCheckInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchdeactproduct-harmonyosnext-0000002166748613", + "title": "批量去激活商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856", + "title": "创建商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section695217568397", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section8711909", + "text": "此接口用于根据AppId查询是否有激活的商品。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/check" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "checkInfos", + "M", + "List", + "检查结果列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section49198053" + } + ], + "title": "查询是否有在线商品", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:43.639Z", + "family": "pms", + "endpoint": "isproductactive-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/isproductactive-harmonyosnext.parameters.json b/pkg/domain/reference/pms/isproductactive-harmonyosnext.parameters.json new file mode 100644 index 0000000..e6f4da8 --- /dev/null +++ b/pkg/domain/reference/pms/isproductactive-harmonyosnext.parameters.json @@ -0,0 +1,10 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-isproductactive-harmonyosnext-0000002166670145#section4531181919117" + } +] diff --git a/pkg/domain/reference/pms/levelgroup-harmonyosnext.json b/pkg/domain/reference/pms/levelgroup-harmonyosnext.json new file mode 100644 index 0000000..b13f0fd --- /dev/null +++ b/pkg/domain/reference/pms/levelgroup-harmonyosnext.json @@ -0,0 +1,273 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group/level \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n\n\n{\n \"requestId\": \"12312313\",\n \"groupId\": \"1231\",\n \"productGroupInfoList\": [\n {\n \"productId\": \"1231231\",\n \"subLevel\": 1\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section2884102017316", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pglevelinfo-harmonyosnext-0000002175237277", + "title": "ProductGroupLevelInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848", + "title": "查询商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", + "title": "查询商品详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section2884102017316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section8711909", + "text": "此接口用于更新商品订阅分组等级信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group/level" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "groupId", + "M", + "String", + "订阅组ID。" + ], + [ + "productGroupInfoList", + "M", + "List", + "订阅组等级信息列表。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section49198053" + } + ], + "title": "更新商品订阅分组等级信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:58:45.160Z", + "family": "pms", + "endpoint": "levelgroup-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/levelgroup-harmonyosnext.parameters.json b/pkg/domain/reference/pms/levelgroup-harmonyosnext.parameters.json new file mode 100644 index 0000000..fc17658 --- /dev/null +++ b/pkg/domain/reference/pms/levelgroup-harmonyosnext.parameters.json @@ -0,0 +1,35 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section1146731320212" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545" + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": true, + "description": "订阅组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545" + }, + { + "name": "productGroupInfoList", + "in": "body", + "type": "array", + "required": true, + "description": "订阅组等级信息列表。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-levelgroup-harmonyosnext-0000002175107485#section48988321545", + "itemsType": "object" + } +] diff --git a/pkg/domain/reference/pms/resourcemanage-harmonyosnext.json b/pkg/domain/reference/pms/resourcemanage-harmonyosnext.json new file mode 100644 index 0000000..3fc9d77 --- /dev/null +++ b/pkg/domain/reference/pms/resourcemanage-harmonyosnext.json @@ -0,0 +1,285 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/resource\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n------WebKitFormBoundary28YcHHCfiNiQrZUL \n Content-Disposition: form-data; name=\"file\"; filename=\"20240929-184623(WeLinkPC).jpg\" \n Content-Type: image/jpeg \n ------WebKitFormBoundary28YcHHCfiNiQrZUL \n Content-Disposition: form-data; name=\"fileType\" \n 1 \n ------WebKitFormBoundary28YcHHCfiNiQrZUL \n Content-Disposition: form-data; name=\"zoneId\" \n 1 \n ------WebKitFormBoundary28YcHHCfiNiQrZUL \n Content-Disposition: form-data; name=\"fileName\" \n 20240929-184623(WeLinkPC).jpg \n ------WebKitFormBoundary28YcHHCfiNiQrZUL--" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section2884102017316", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"upload resource success.\"\n },\n \"resourceId\": \"7560C083F4584F7DA60E22BCBDAF5379\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844", + "title": "创建商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section2884102017316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section8711909", + "text": "此接口用于提交上传资源。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/resource" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列。" + ], + [ + "file", + "M", + "MultipartFile", + "上传的文件。" + ], + [ + "fileType", + "M", + "String", + "上传文件的类型,固定取值: 1:图片" + ], + [ + "zoneId", + "M", + "String", + "上传区域的ID,固定取值: 1:中国区" + ], + [ + "fileName", + "M", + "String", + "上传文件的名称。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ], + [ + "resourceId", + "M", + "String", + "上传成功后的资源ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section49198053" + } + ], + "title": "上传资源", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T05:10:35.009Z" +} diff --git a/pkg/domain/reference/pms/resourcemanage-harmonyosnext.parameters.json b/pkg/domain/reference/pms/resourcemanage-harmonyosnext.parameters.json new file mode 100644 index 0000000..30f6cd5 --- /dev/null +++ b/pkg/domain/reference/pms/resourcemanage-harmonyosnext.parameters.json @@ -0,0 +1,57 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section1146731320212" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "maxLength": 64 + }, + { + "name": "file", + "in": "file", + "type": "file", + "required": true, + "description": "上传的文件。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545" + }, + { + "name": "fileType", + "in": "body", + "type": "string", + "required": true, + "description": "上传文件的类型,固定取值: 1:图片", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "enum": [ + "1" + ] + }, + { + "name": "zoneId", + "in": "body", + "type": "string", + "required": true, + "description": "上传区域的ID,固定取值: 1:中国区", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545", + "enum": [ + "1" + ] + }, + { + "name": "fileName", + "in": "body", + "type": "string", + "required": true, + "description": "上传文件的名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-resourcemanage-harmonyosnext-0000002131361792#section48988321545" + } +] diff --git a/pkg/domain/reference/pms/reviewproduct-harmonyosnext.json b/pkg/domain/reference/pms/reviewproduct-harmonyosnext.json new file mode 100644 index 0000000..9da2eb7 --- /dev/null +++ b/pkg/domain/reference/pms/reviewproduct-harmonyosnext.json @@ -0,0 +1,267 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPOST https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/review\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n requestId: \"535CD6B53C984CED9F521769F190FE8F\",\n productIdList: [\"2FCE5A4E19A24AD6906419015671FA61\"]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section2884102017316", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 1,\n \"errorMsg\": \"productId can not be empty\"\n },\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductinfo-harmonyosnext-0000002131350708", + "title": "查询商品详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproduct-harmonyosnext-0000002131508844", + "title": "创建商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchaddproduct-harmonyosnext-0000002131350704", + "title": "批量创建商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section48988321545", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section2884102017316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section8711909", + "text": "此接口用于提交商品审核。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/review" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列。" + ], + [ + "productIdList", + "M", + "List", + "待审核商品列表,一次最多提交20个商品审核。商品ID是系统生成的ID,非用户指定,商品ID可以通过查询商品详情接口进行查询。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section48988321545" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section49198053" + } + ], + "title": "提交商品审核", + "updatedAt": "2025-08-14 09:12", + "checkedAt": "2026-10-07T02:59:33.769Z", + "family": "pms", + "endpoint": "reviewproduct-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/reviewproduct-harmonyosnext.parameters.json b/pkg/domain/reference/pms/reviewproduct-harmonyosnext.parameters.json new file mode 100644 index 0000000..6b0625e --- /dev/null +++ b/pkg/domain/reference/pms/reviewproduct-harmonyosnext.parameters.json @@ -0,0 +1,28 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section1146731320212" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section48988321545", + "maxLength": 64 + }, + { + "name": "productIdList", + "in": "body", + "type": "array", + "required": true, + "description": "待审核商品列表,一次最多提交20个商品审核。商品ID是系统生成的ID,非用户指定,商品ID可以通过查询商品详情接口进行查询。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reviewproduct-harmonyosnext-0000002166681241#section48988321545", + "itemsType": "string" + } +] diff --git a/pkg/domain/reference/pms/updateproduct-android.json b/pkg/domain/reference/pms/updateproduct-android.json new file mode 100644 index 0000000..8cabd82 --- /dev/null +++ b/pkg/domain/reference/pms/updateproduct-android.json @@ -0,0 +1,271 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n \n{ \n \"requestId\": \"8700018795\", \n \"resource\": { \n \"productNo\": \"manageproductput5\", \n \"appId\": \"30140205131\", \n \"productName\": \"创建商品定义信息1000002\", \n \"purchaseType\": \"consumable\", \n \"status\": \"inactive\", \n \"defaultPrice\": \"1000002\", \n \"currency\": \"CNY\", \n \"country\": \"CN\", \n \"defaultLocale\": \"zh-CN\", \n \"productDesc\": \"测试商品描述1000002\", \n \"languages\": [{ \n \"locale\": \"zh_CN\", \n \"productName\": \"创建商品定义信息1000002\", \n \"productDesc\": \"测试商品描述1000002\" \n }], \n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"1000002\" \n }] ,\n \"startDate\":1748244395917,\n \"endDate\":1748620800000,\n \"tag\":\"优惠活动\"\n } \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section288313163912", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-productinfo-android-0000002171288637", + "title": "ProductInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-android-0000002135929316", + "title": "按条件查询商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-android-0000002171407013", + "title": "批量更新商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section1692522315316", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section288313163912", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section8711909", + "text": "此接口用于更新商品定义信息,包含商品价格,展示语言和商品状态。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductInfo", + "商品信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section1692522315316" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section49198053" + } + ], + "title": "更新商品信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:35.451Z", + "family": "pms", + "endpoint": "updateproduct-android" +} diff --git a/pkg/domain/reference/pms/updateproduct-android.parameters.json b/pkg/domain/reference/pms/updateproduct-android.parameters.json new file mode 100644 index 0000000..1396bdd --- /dev/null +++ b/pkg/domain/reference/pms/updateproduct-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section11332165616018" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section1692522315316", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-android-0000002136087404#section1692522315316" + } +] diff --git a/pkg/domain/reference/pms/updateproduct-harmonyosnext.json b/pkg/domain/reference/pms/updateproduct-harmonyosnext.json new file mode 100644 index 0000000..9297a7d --- /dev/null +++ b/pkg/domain/reference/pms/updateproduct-harmonyosnext.json @@ -0,0 +1,267 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n \n{ \n \"requestId\": \"8700018795\", \n \"resource\": { \n \"productNo\": \"manageproductput5\", \n \"appId\": \"30140205131\", \n \"productName\": \"创建商品定义信息1000002\", \n \"purchaseType\": \"consumable\", \n \"status\": \"inactive\", \n \"defaultPrice\": \"1000002\", \n \"currency\": \"CNY\", \n \"country\": \"CN\", \n \"defaultLocale\": \"zh-CN\", \n \"productDesc\": \"测试商品描述1000002\", \n \"languages\": [{ \n \"locale\": \"zh_CN\", \n \"productName\": \"创建商品定义信息1000002\", \n \"productDesc\": \"测试商品描述1000002\" \n }], \n \"reviewResourceId\": \"22AA702C947A42A7AF059779D18E872A\",\n \"reviewPath\": \"我的-会员中心-黄金会员\",\n \"reviewNote\": \"新建商品\",\n \"taxIncluded\": 1,\n \"salesCountry\": [\n \"LK\",\"TW\",\"TJ\",\"TH\",\"TR\",\"TM\",\"AE\",\"UZ\",\"VN\",\"YE\",\"MN\",\"MM\",\"NP\",\"OM\",\"PK\",\"PS\",\"PH\",\n \"QA\",\"SA\",\"SG\",\"KZ\",\"KW\",\"KG\",\"LA\",\"LB\",\"MO\",\"MY\",\"MV\",\"CN\",\"CY\",\"GE\",\"HK\",\"ID\",\"IQ\",\n \"IL\",\"JP\",\"JO\",\"AM\",\"AZ\",\"BH\",\"BD\",\"BN\",\"KH\",\"SL\",\"ZA\",\"TZ\",\"TG\",\"TN\",\"UG\",\"ZM\",\"ZW\",\n \"MR\",\"MU\",\"YT\",\"MA\",\"MZ\",\"NA\",\"NE\",\"NG\",\"RE\",\"RW\",\"ST\",\"SN\",\"GM\",\"GH\",\"GN\",\"GW\",\"KE\",\n \"LS\",\"LR\",\"LY\",\"MG\",\"MW\",\"ML\",\"KM\",\"CG\",\"CD\",\"CI\",\"DJ\",\"EG\",\"GQ\",\"ER\",\"SZ\",\"ET\",\"GA\",\n \"DZ\",\"AO\",\"BJ\",\"BW\",\"BF\",\"CM\",\"CV\",\"CF\",\"TD\",\"PA\",\"PY\",\"PE\",\"PR\",\"LC\",\"TT\",\"UY\",\"VE\",\n \"GD\",\"GP\",\"GT\",\"GY\",\"HT\",\"HN\",\"JM\",\"MX\",\"NI\",\"CA\",\"KY\",\"CL\",\"CO\",\"CR\",\"DO\",\"EC\",\"SV\",\n \"GF\",\"AI\",\"AR\",\"AW\",\"BS\",\"BO\",\"BR\",\"VG\",\"SK\",\"SI\",\"ES\",\"SE\",\"CH\",\"UA\",\"GB\",\"VA\",\"MC\",\n \"ME\",\"NL\",\"MK\",\"NO\",\"PL\",\"PT\",\"RO\",\"RU\",\"SM\",\"RS\",\"MT\",\"MD\",\"LI\",\"LT\",\"LU\",\"IT\",\"LV\",\n \"HU\",\"IS\",\"IE\",\"FI\",\"FR\",\"DE\",\"GI\",\"GR\",\"GL\",\"BG\",\"HR\",\"CZ\",\"DK\",\"EE\",\"FO\",\"AL\",\"AD\",\n \"AT\",\"BY\",\"BE\",\"BA\",\"AU\",\"CK\",\"FJ\",\"PF\", \"NR\",\"NZ\",\"PG\",\"SB\",\"TO\"\n ],\n \"autoAddSaleCountry\": 1,\n \"prices\": [{ \n \"country\": \"CN\", \n \"price\": \"1000002\" \n }] \n } \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section288313163912", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-productinfo-harmonyosnext-0000002131350728", + "title": "ProductInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-bygetproductinfo-harmonyosnext-0000002166748609", + "title": "按条件查询商品信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-batchupdateproduct-harmonyosnext-0000002131508852", + "title": "批量更新商品" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section1692522315316", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section288313163912", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section8711909", + "text": "此接口用于更新商品定义信息,包含商品价格,展示语言和商品状态。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductInfo", + "商品信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section1692522315316" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section49198053" + } + ], + "title": "更新商品信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:37.159Z", + "family": "pms", + "endpoint": "updateproduct-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/updateproduct-harmonyosnext.parameters.json b/pkg/domain/reference/pms/updateproduct-harmonyosnext.parameters.json new file mode 100644 index 0000000..11b40ae --- /dev/null +++ b/pkg/domain/reference/pms/updateproduct-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section11332165616018" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section1692522315316", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproduct-harmonyosnext-0000002166670141#section1692522315316" + } +] diff --git a/pkg/domain/reference/pms/updateproductgroup-android.json b/pkg/domain/reference/pms/updateproductgroup-android.json new file mode 100644 index 0000000..57fcb2e --- /dev/null +++ b/pkg/domain/reference/pms/updateproductgroup-android.json @@ -0,0 +1,271 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/group\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123\",\n \"resource\": {\n \"groupId\": \"24D8D29153E64F92BCCBA4CA218108AB\",\n \"groupName\": \"product_group_modify_1000003\",\n \"status\": \"active\"\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section611020220573", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pgroupinfo-android-0000002171407037", + "title": "ProductGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308", + "title": "创建商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-android-0000002171407009", + "title": "查询商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section46842575213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section611020220573", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section8711909", + "text": "此接口用于更新商品订阅分组信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/group" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductGroupInfo", + "商品分组信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section46842575213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section49198053" + } + ], + "title": "更新商品订阅分组信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:38.602Z", + "family": "pms", + "endpoint": "updateproductgroup-android" +} diff --git a/pkg/domain/reference/pms/updateproductgroup-android.parameters.json b/pkg/domain/reference/pms/updateproductgroup-android.parameters.json new file mode 100644 index 0000000..a32cd14 --- /dev/null +++ b/pkg/domain/reference/pms/updateproductgroup-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section143161334908" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section46842575213", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品分组信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-android-0000002136087400#section46842575213" + } +] diff --git a/pkg/domain/reference/pms/updateproductgroup-harmonyosnext.json b/pkg/domain/reference/pms/updateproductgroup-harmonyosnext.json new file mode 100644 index 0000000..d21689a --- /dev/null +++ b/pkg/domain/reference/pms/updateproductgroup-harmonyosnext.json @@ -0,0 +1,267 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123\",\n \"resource\": {\n \"groupId\": \"24D8D29153E64F92BCCBA4CA218108AB\",\n \"groupName\": \"product_group_modify_1000003\",\n \"status\": \"active\"\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section611020220573", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": null\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pgroupinfo-harmonyosnext-0000002131508868", + "title": "ProductGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", + "title": "创建商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getproductgroup-harmonyosnext-0000002131508848", + "title": "查询商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section46842575213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section611020220573", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section8711909", + "text": "此接口用于更新商品订阅分组信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/group" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductGroupInfo", + "商品分组信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section46842575213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section49198053" + } + ], + "title": "更新商品订阅分组信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:40.203Z", + "family": "pms", + "endpoint": "updateproductgroup-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/updateproductgroup-harmonyosnext.parameters.json b/pkg/domain/reference/pms/updateproductgroup-harmonyosnext.parameters.json new file mode 100644 index 0000000..b3dbfd1 --- /dev/null +++ b/pkg/domain/reference/pms/updateproductgroup-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section143161334908" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section46842575213", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品分组信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updateproductgroup-harmonyosnext-0000002166670137#section46842575213" + } +] diff --git a/pkg/domain/reference/pms/updatepromotion-android.json b/pkg/domain/reference/pms/updatepromotion-android.json new file mode 100644 index 0000000..57c3968 --- /dev/null +++ b/pkg/domain/reference/pms/updatepromotion-android.json @@ -0,0 +1,271 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion\nContent-Type: application/json\nclient_id: ***\nAuthorization: Bearer ***\nappId: 1000001\n\n\n{\n \"requestId\": \"123\",\n \"resource\": {\n \"promotionId\": \"A8E40AE88EAC46BEA575FEF02DC99EF9\",\n \"productId\": \"9C1B4C23702341ACA3wwhpmsput\",\n \"startDate\": 1975010662000,\n \"endDate\": 1975269862000,\n \"status\": \"active\",\n \"strategy\": \"introductory\",\n \"promotionTitle\": \"创建put_10000003\",\n \"defaultLocale\": \"zh-CN\",\n \"country\": \"CN\",\n \"currency\": \"CNY\",\n \"promotionType\": 0,\n \"promotionDesc\": \"default desc\",\n \"defaultPrice\": \"50\",\n \"languages\": [{\n \"title\": \"创建put_10000003\",\n \"locale\": \"en-GB\",\n \"desc\": \"default desc\"\n }, {\n \"title\": \"创建put_10000003\",\n \"locale\": \"zh-CN\",\n \"desc\": \"default desc\"\n }],\n \"prices\": [{\n \"country\": \"EG\",\n \"price\": \"50\"\n }, {\n \"country\": \"CN\",\n \"price\": \"50\"\n }]\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section13314620222", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"update product promotion success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716", + "title": "HarmonyOS 5.0及以上 V2版本接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppromotioninfo-android-0000002135929348", + "title": "ProductPromotionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-android-0000002171407021", + "title": "创建商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-android-0000002135929328", + "title": "查询商品促销详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section281217918413", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section13314620222", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section8711909", + "text": "此接口用于更新商品促销信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v1/manage/product/promotion" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductPromotionInfo", + "商品促销价格信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section281217918413" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section49198053" + } + ], + "title": "更新商品促销信息", + "updatedAt": "2026-02-11 14:07", + "checkedAt": "2026-10-07T02:59:41.916Z", + "family": "pms", + "endpoint": "updatepromotion-android" +} diff --git a/pkg/domain/reference/pms/updatepromotion-android.parameters.json b/pkg/domain/reference/pms/updatepromotion-android.parameters.json new file mode 100644 index 0000000..3b6cea7 --- /dev/null +++ b/pkg/domain/reference/pms/updatepromotion-android.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section118191246818" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section281217918413", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品促销价格信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-android-0000002171288621#section281217918413" + } +] diff --git a/pkg/domain/reference/pms/updatepromotion-harmonyosnext.json b/pkg/domain/reference/pms/updatepromotion-harmonyosnext.json new file mode 100644 index 0000000..683f43b --- /dev/null +++ b/pkg/domain/reference/pms/updatepromotion-harmonyosnext.json @@ -0,0 +1,267 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section19934722144316", + "text": "请求示例\n\n以API Client为例:\n\nPUT https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion \nContent-Type: application/json \nclient_id: *** \nAuthorization: Bearer *** \nappId: 1000001 \n{ \n \"requestId\": \"123\", \n \"resource\": { \n \"promotionId\": \"A8E40AE88EAC46BEA575FEF02DC99EF9\", \n \"productId\": \"9C1B4C23702341ACA3wwhpmsput\", \n \"startDate\": 1975010662000, \n \"endDate\": 1975269862000, \n \"status\": \"active\", \n \"strategy\": \"introductory\", \n \"promotionTitle\": \"创建put_10000003\", \n \"defaultLocale\": \"zh-CN\", \n \"country\": \"CN\", \n \"currency\": \"CNY\", \n \"promotionType\": 4, \n \"promotionDesc\": \"default desc\", \n \"defaultPrice\": \"50\", \n \"languages\": [{ \n \"title\": \"创建put_10000003\", \n \"locale\": \"en-GB\", \n \"desc\": \"default desc\" \n }, { \n \"title\": \"创建put_10000003\", \n \"locale\": \"zh-CN\", \n \"desc\": \"default desc\" \n }], \n \"prices\": [{ \n \"country\": \"EG\", \n \"price\": \"50\" \n }, { \n \"country\": \"CN\", \n \"price\": \"50\" \n }] ,\n \"betweenOffersNumOfUnits\": 5,\n \"betweenOffersPeriodUnit\": \"M\"\n } \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section13314620222", + "text": "响应示例\n{\n \"error\": {\n \"errorCode\": 0,\n \"errorMsg\": \"update product promotion success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppromotioninfo-harmonyosnext-0000002166748633", + "title": "ProductPromotionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addpromotion-harmonyosnext-0000002131508856", + "title": "创建商品促销信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getpromotioninfo-harmonyosnext-0000002166748617", + "title": "查询商品促销详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section5189239225", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section2862142512223", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section482745132215", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section281217918413", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section19934722144316", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section13314620222", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section77276431240", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section8711909", + "text": "此接口用于更新商品促销信息。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section5189239225", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818", + "text": "API Client和OAuth Client区别参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818", + "text": "API Client方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818", + "text": "OAuth Client方式" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->数字商品服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/pms/product-price-service/v2/manage/product/promotion" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section2862142512223" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "必选(M)/可选(O)", + "类型", + "描述" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requestId", + "M", + "String(64)", + "请求序列,开发者自定义唯一标识符。" + ], + [ + "resource", + "M", + "ProductPromotionInfo", + "商品促销价格信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section281217918413" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "error", + "M", + "ErrorResult", + "包含返回码及描述信息的JSON字符串。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section49198053" + } + ], + "title": "更新商品促销信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:59:44.161Z", + "family": "pms", + "endpoint": "updatepromotion-harmonyosnext" +} diff --git a/pkg/domain/reference/pms/updatepromotion-harmonyosnext.parameters.json b/pkg/domain/reference/pms/updatepromotion-harmonyosnext.parameters.json new file mode 100644 index 0000000..9512fdb --- /dev/null +++ b/pkg/domain/reference/pms/updatepromotion-harmonyosnext.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section118191246818" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "请求序列,开发者自定义唯一标识符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section281217918413", + "maxLength": 64 + }, + { + "name": "resource", + "in": "body", + "type": "object", + "required": true, + "description": "商品促销价格信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-updatepromotion-harmonyosnext-0000002131350716#section281217918413" + } +] diff --git a/pkg/domain/reference/prefetch/device-getcache.json b/pkg/domain/reference/prefetch/device-getcache.json new file mode 100644 index 0000000..a4bb8f5 --- /dev/null +++ b/pkg/domain/reference/prefetch/device-getcache.json @@ -0,0 +1,408 @@ +{ + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "getcache" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/registration-and-verification-0000001053628148", + "title": "账号注册认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-debug-cert-0000002283256797", + "title": "申请调试证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E8%AE%BE%E5%A4%87%E8%BF%9E%E6%8E%A5%E7%AE%A1%E7%90%86", + "title": "设备连接管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98", + "title": "常见问题" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%87%86%E5%A4%87", + "title": "调试准备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%88%87%E6%8D%A2shell%E7%8E%AF%E5%A2%83", + "title": "切换shell环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "调试命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E6%A0%BC%E5%BC%8F", + "title": "命令格式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E9%80%89%E9%A1%B9", + "title": "命令选项" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E6%AD%A3%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "正常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "prefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "当前命令行工具支持的命令集如下:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "使用命令行工具调试周期性预加载之前,需要完成以下准备工作:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "prefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "调试命令", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试命令", + "text": "命令名“getcache”,提供获取周期性预加载数据的能力。" + }, + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n调试周期性预加载\n调试周期性预加载\n更新时间: 2026-04-20 14:34\n复制页面\n\nprefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。\n\n当前命令行工具支持的命令集如下:\n\n命令名\t描述\ngetcache\t提供获取周期性预加载数据的能力。\n调试准备\n\n使用命令行工具调试周期性预加载之前,需要完成以下准备工作:\n\n您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。\n\n您已在本地安装DevEco Studio 5.0.3 Release及以上版本。\n\n手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。\n\n设置HAP包的“Build Mode”为“debug”,且已申请调试证书。\n\n切换shell环境\n\nprefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。\n\nPC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。\n\n打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。\n\n输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。\n\n调试命令\n\n命令名“getcache”,提供获取周期性预加载数据的能力。\n\n命令格式\ncf_prefetch getcache -m \n命令选项\n命令选项\t必填(M)/选填(O)\t描述\t示例\n-m\tM\t应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。\tcf_prefetch getcache -m com.huawei.hms.xs.test\n调用示例\n正常场景\n\n输入cf_prefetch help,获取命令行工具的使用说明。\n\n输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。\n\n输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。\n\n异常场景\n\n链路不通,例如无网络情况;或周期性预加载配置不正确。\n\n命令行工具内部错误。\n\nHAP包非debug调试模式。\n\n应用包名输入错误。\n\n(可选)使用命令行工具调试周期性预加载\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n调试准备\n切换shell环境\n调试命令\n命令格式\n命令选项\n调用示例\n正常场景\n异常场景\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "命令名", + "描述" + ], + [ + "getcache", + "提供获取周期性预加载数据的能力。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug" + }, + { + "location": "", + "rows": [ + [ + "命令选项", + "必填(M)/选填(O)", + "描述", + "示例" + ], + [ + "-m", + "M", + "应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。", + "cf_prefetch getcache -m com.huawei.hms.xs.test" + ] + ], + "section": "命令选项", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令选项" + } + ], + "title": "调试周期性预加载", + "relatedDocuments": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-emulator", + "title": "使用模拟器调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n错误码\n错误码\n更新时间: 2026-04-20 14:34\n复制页面\n错误码\t描述\t解决方法\n1008200005\t周期性预加载执行失败。\t\n\n请从以下方面进行排查:\n\n- 检查设备网络连接情况。\n\n- 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。\n\n- 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。\n\n\n1008200009\t命令行工具内部错误。\t请通过在线工单系统联系技术支持人员定位问题。\n1008240000\tHAP包不在debug模式下。\t请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。\n1008240007\t无法获取当前HAP包信息,例如APP ID等。\t请检查应用包名合法性,输入正确的应用包名。\n调试周期性预加载\n使用模拟器调试\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码", + "描述", + "解决方法" + ], + [ + "1008200005", + "周期性预加载执行失败。", + "请从以下方面进行排查: - 检查设备网络连接情况。 - 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。 - 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。" + ], + [ + "1008200009", + "命令行工具内部错误。", + "请通过在线工单系统联系技术支持人员定位问题。" + ], + [ + "1008240000", + "HAP包不在debug模式下。", + "请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。" + ], + [ + "1008240007", + "无法获取当前HAP包信息,例如APP ID等。", + "请检查应用包名合法性,输入正确的应用包名。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode" + } + ], + "title": "错误码" + } + ], + "implementationNotes": [ + "Runs hdc -t DEVICE shell cf_prefetch getcache -m BUNDLE with separate argv. A successful process is not proof of a new fetch data timestamp. Debug HAP, supported ROM and an explicitly connected test device are prerequisites." + ] +} diff --git a/pkg/domain/reference/prefetch/fetch-deferred.json b/pkg/domain/reference/prefetch/fetch-deferred.json new file mode 100644 index 0000000..eb8bbb5 --- /dev/null +++ b/pkg/domain/reference/prefetch/fetch-deferred.json @@ -0,0 +1,1892 @@ +{ + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-develop-function-nodejs", + "title": "开发函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-test-function", + "title": "测试函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-deveco-studio/agc-harmonyos-clouddev-funccoding", + "title": "端云一体化工程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-call", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "云函数接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B-1", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let token = body.token;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let link = body.link; // 跳链安装预加载link信息" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",link:\" + link);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "开发者服务器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器", + "text": "开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "定义名称为prefetchData的接口,示例如下:" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发预加载资源接口\n开发预加载资源接口\n更新时间: 2026-09-01 11:59\n复制页面\n\n使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。\n\n云函数\n\n开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:\n\n开发函数:按照云函数接口规范开发函数。\n\n创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。\n\n测试函数:对函数进行测试,以确保函数代码运行正常。\n\n云函数接口规范\n预加载类型\tAPI名称\t说明\t参数\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tevent.body.appId:应用ID,获取方法请参见查看应用信息。\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.link:可选,跳链安装预加载延迟链接。\n\n\t自定义JSON字符串\n示例\n\n端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。\n\n安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n开发者服务器\n\n开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。\n\n开发者服务器接口规范\n预加载类型\tAPI/PATH名称\t说明\t参数\t请求方式\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tappId:应用ID,获取方法请参见查看应用信息。\tGET\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\tGET\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- link:可选,跳链安装预加载延迟链接。\n\n\tGET\t自定义JSON字符串\n示例\n\n定义名称为prefetchData的接口,示例如下:\n\nhttps://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy\n配置预加载\n调用预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n云函数\n云函数接口规范\n示例\n开发者服务器\n开发者服务器接口规范\n示例\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "预加载类型", + "API名称", + "说明", + "参数", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "event.body.appId:应用ID,获取方法请参见查看应用信息。", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.link:可选,跳链安装预加载延迟链接。", + "自定义JSON字符串" + ] + ], + "section": "云函数接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数接口规范" + }, + { + "location": "", + "rows": [ + [ + "预加载类型", + "API/PATH名称", + "说明", + "参数", + "请求方式", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "appId:应用ID,获取方法请参见查看应用信息。", + "GET", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "GET", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - link:可选,跳链安装预加载延迟链接。", + "GET", + "自定义JSON字符串" + ] + ], + "section": "开发者服务器接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器接口规范" + } + ], + "title": "开发预加载资源接口", + "relatedDocuments": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86", + "title": "工作原理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%85%B8%E5%9E%8B%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF", + "title": "典型应用场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%8F%90%E5%8D%87%E5%BA%94%E7%94%A8%E9%A6%96%E5%BC%80%E9%80%9F%E5%BA%A6", + "title": "提升应用首开速度" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%AE%9E%E7%8E%B0%E8%8A%82%E6%97%A5%E4%B8%BB%E9%A2%98%E5%8D%B3%E5%8F%91%E5%8D%B3%E7%8E%B0", + "title": "实现节日主题即发即现" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E7%BA%A6%E6%9D%9F%E4%B8%8E%E9%99%90%E5%88%B6", + "title": "约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E8%AE%BE%E5%A4%87%E9%99%90%E5%88%B6", + "title": "设备限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%95%B0%E6%8D%AE%E9%99%90%E5%88%B6", + "title": "数据限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E9%85%8D%E9%A2%9D%E9%99%90%E5%88%B6", + "title": "配额限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "当前支持如下三种预加载类型:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "提升应用首开速度", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#提升应用首开速度", + "text": "在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。" + }, + { + "section": "实现节日主题即发即现", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#实现节日主题即发即现", + "text": "很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。" + }, + { + "section": "设备限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#设备限制", + "text": "支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n概述\n概述\n更新时间: 2026-06-12 14:54\n复制页面\n\n从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。\n\n预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。\n\n当前支持如下三种预加载类型:\n\n安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。\n\n周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。\n\n跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。\n\n工作原理\n\n预加载服务根据配置的数据预加载策略从应用后台获取数据。\n\n预加载服务将获取的数据在本地进行缓存。\n\n应用使用获取的缓存数据,进行页面渲染。\n\n典型应用场景\n提升应用首开速度\n\n在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。\n\n实现节日主题即发即现\n\n很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。\n\n约束与限制\n设备限制\n\n支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。\n\n数据限制\n限制项\t说明\n数据类型\t仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。\n配额限制\n配额类型\t配额\n安装预加载缓存大小\t2MB\n周期性预加载缓存大小\t3MB\n跳链安装预加载缓存大小\t3MB\n预加载\n开发流程\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n工作原理\n典型应用场景\n提升应用首开速度\n实现节日主题即发即现\n约束与限制\n设备限制\n数据限制\n配额限制\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "限制项", + "说明" + ], + [ + "数据类型", + "仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。" + ] + ], + "section": "数据限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#数据限制" + }, + { + "location": "", + "rows": [ + [ + "配额类型", + "配额" + ], + [ + "安装预加载缓存大小", + "2MB" + ], + [ + "周期性预加载缓存大小", + "3MB" + ], + [ + "跳链安装预加载缓存大小", + "3MB" + ] + ], + "section": "配额限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#配额限制" + } + ], + "title": "概述" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-installprefetch", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载,总体流程如下:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发流程\n开发流程\n更新时间: 2026-04-20 14:34\n复制页面\n\n开发预加载,总体流程如下:\n\n配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。\n\n开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。\n\n调用预加载:在工程代码文件中调用预加载。\n\n概述\n配置预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "status": "browser-read", + "tables": [], + "title": "开发流程" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "数据来源为云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E7%BB%91%E5%AE%9A%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "绑定云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "数据来源为开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6-1", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E9%85%8D%E7%BD%AE%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9C%B0%E5%9D%80", + "title": "配置服务器地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "对于不同类型的开发者,支持的数据来源方式有所不同:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "下文介绍如何配置两种数据来源方式的预加载实现。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件-1", + "text": "已开通预加载服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "需要注意以下几点:" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n配置预加载\n配置预加载\n更新时间: 2026-04-24 16:10\n复制页面\n\n安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。\n\n对于不同类型的开发者,支持的数据来源方式有所不同:\n\n个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。\n\n非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。\n\n下文介绍如何配置两种数据来源方式的预加载实现。\n\n数据来源为云函数\n前提条件\n\n已开通预加载服务。\n\n已创建函数。\n\n绑定云函数\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。\n\n点击“保存”完成周期性预加载配置。\n\n若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。\n\n数据来源为开发者服务器\n前提条件\n\n已开通预加载服务。\n\n配置服务器地址\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n点击“下载地址”后的“修改”。\n\n以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。\n\n若配置“安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。\n\n开发流程\n开发预加载资源接口\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n数据来源为云函数\n前提条件\n绑定云函数\n数据来源为开发者服务器\n前提条件\n配置服务器地址\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "status": "browser-read", + "tables": [], + "title": "配置预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-install-and-periodic-prefetch", + "title": "调用全部预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "调试周期性预加载" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "错误码" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n(可选)使用命令行工具调试周期性预加载\n更新时间: 2026-10-10 20:02\n复制页面\n调试周期性预加载\n\n错误码\n\n调用全部预加载\n调试周期性预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "status": "browser-read", + "tables": [], + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "getcache" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/registration-and-verification-0000001053628148", + "title": "账号注册认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-debug-cert-0000002283256797", + "title": "申请调试证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E8%AE%BE%E5%A4%87%E8%BF%9E%E6%8E%A5%E7%AE%A1%E7%90%86", + "title": "设备连接管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98", + "title": "常见问题" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%87%86%E5%A4%87", + "title": "调试准备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%88%87%E6%8D%A2shell%E7%8E%AF%E5%A2%83", + "title": "切换shell环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "调试命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E6%A0%BC%E5%BC%8F", + "title": "命令格式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E9%80%89%E9%A1%B9", + "title": "命令选项" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E6%AD%A3%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "正常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "prefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "当前命令行工具支持的命令集如下:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "使用命令行工具调试周期性预加载之前,需要完成以下准备工作:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "prefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "调试命令", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试命令", + "text": "命令名“getcache”,提供获取周期性预加载数据的能力。" + }, + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n调试周期性预加载\n调试周期性预加载\n更新时间: 2026-04-20 14:34\n复制页面\n\nprefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。\n\n当前命令行工具支持的命令集如下:\n\n命令名\t描述\ngetcache\t提供获取周期性预加载数据的能力。\n调试准备\n\n使用命令行工具调试周期性预加载之前,需要完成以下准备工作:\n\n您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。\n\n您已在本地安装DevEco Studio 5.0.3 Release及以上版本。\n\n手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。\n\n设置HAP包的“Build Mode”为“debug”,且已申请调试证书。\n\n切换shell环境\n\nprefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。\n\nPC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。\n\n打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。\n\n输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。\n\n调试命令\n\n命令名“getcache”,提供获取周期性预加载数据的能力。\n\n命令格式\ncf_prefetch getcache -m \n命令选项\n命令选项\t必填(M)/选填(O)\t描述\t示例\n-m\tM\t应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。\tcf_prefetch getcache -m com.huawei.hms.xs.test\n调用示例\n正常场景\n\n输入cf_prefetch help,获取命令行工具的使用说明。\n\n输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。\n\n输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。\n\n异常场景\n\n链路不通,例如无网络情况;或周期性预加载配置不正确。\n\n命令行工具内部错误。\n\nHAP包非debug调试模式。\n\n应用包名输入错误。\n\n(可选)使用命令行工具调试周期性预加载\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n调试准备\n切换shell环境\n调试命令\n命令格式\n命令选项\n调用示例\n正常场景\n异常场景\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "命令名", + "描述" + ], + [ + "getcache", + "提供获取周期性预加载数据的能力。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug" + }, + { + "location": "", + "rows": [ + [ + "命令选项", + "必填(M)/选填(O)", + "描述", + "示例" + ], + [ + "-m", + "M", + "应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。", + "cf_prefetch getcache -m com.huawei.hms.xs.test" + ] + ], + "section": "命令选项", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令选项" + } + ], + "title": "调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-emulator", + "title": "使用模拟器调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n错误码\n错误码\n更新时间: 2026-04-20 14:34\n复制页面\n错误码\t描述\t解决方法\n1008200005\t周期性预加载执行失败。\t\n\n请从以下方面进行排查:\n\n- 检查设备网络连接情况。\n\n- 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。\n\n- 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。\n\n\n1008200009\t命令行工具内部错误。\t请通过在线工单系统联系技术支持人员定位问题。\n1008240000\tHAP包不在debug模式下。\t请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。\n1008240007\t无法获取当前HAP包信息,例如APP ID等。\t请检查应用包名合法性,输入正确的应用包名。\n调试周期性预加载\n使用模拟器调试\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码", + "描述", + "解决方法" + ], + [ + "1008200005", + "周期性预加载执行失败。", + "请从以下方面进行排查: - 检查设备网络连接情况。 - 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。 - 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。" + ], + [ + "1008200009", + "命令行工具内部错误。", + "请通过在线工单系统联系技术支持人员定位问题。" + ], + [ + "1008240000", + "HAP包不在debug模式下。", + "请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。" + ], + [ + "1008240007", + "无法获取当前HAP包信息,例如APP ID等。", + "请检查应用包名合法性,输入正确的应用包名。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode" + } + ], + "title": "错误码" + } + ], + "implementationNotes": [ + "Developer-server GET simulation; does not configure Huawei prefetch or prove device delivery. Never loads developer credentials. Installation response limit follows the overview quota of 2MiB; periodic and deferred responses are limited to 3MiB. The configuration guide gives a generic 3MB server-response limit; that does not override the smaller installation quota." + ] +} diff --git a/pkg/domain/reference/prefetch/fetch-install.json b/pkg/domain/reference/prefetch/fetch-install.json new file mode 100644 index 0000000..eb8bbb5 --- /dev/null +++ b/pkg/domain/reference/prefetch/fetch-install.json @@ -0,0 +1,1892 @@ +{ + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-develop-function-nodejs", + "title": "开发函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-test-function", + "title": "测试函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-deveco-studio/agc-harmonyos-clouddev-funccoding", + "title": "端云一体化工程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-call", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "云函数接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B-1", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let token = body.token;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let link = body.link; // 跳链安装预加载link信息" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",link:\" + link);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "开发者服务器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器", + "text": "开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "定义名称为prefetchData的接口,示例如下:" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发预加载资源接口\n开发预加载资源接口\n更新时间: 2026-09-01 11:59\n复制页面\n\n使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。\n\n云函数\n\n开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:\n\n开发函数:按照云函数接口规范开发函数。\n\n创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。\n\n测试函数:对函数进行测试,以确保函数代码运行正常。\n\n云函数接口规范\n预加载类型\tAPI名称\t说明\t参数\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tevent.body.appId:应用ID,获取方法请参见查看应用信息。\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.link:可选,跳链安装预加载延迟链接。\n\n\t自定义JSON字符串\n示例\n\n端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。\n\n安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n开发者服务器\n\n开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。\n\n开发者服务器接口规范\n预加载类型\tAPI/PATH名称\t说明\t参数\t请求方式\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tappId:应用ID,获取方法请参见查看应用信息。\tGET\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\tGET\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- link:可选,跳链安装预加载延迟链接。\n\n\tGET\t自定义JSON字符串\n示例\n\n定义名称为prefetchData的接口,示例如下:\n\nhttps://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy\n配置预加载\n调用预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n云函数\n云函数接口规范\n示例\n开发者服务器\n开发者服务器接口规范\n示例\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "预加载类型", + "API名称", + "说明", + "参数", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "event.body.appId:应用ID,获取方法请参见查看应用信息。", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.link:可选,跳链安装预加载延迟链接。", + "自定义JSON字符串" + ] + ], + "section": "云函数接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数接口规范" + }, + { + "location": "", + "rows": [ + [ + "预加载类型", + "API/PATH名称", + "说明", + "参数", + "请求方式", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "appId:应用ID,获取方法请参见查看应用信息。", + "GET", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "GET", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - link:可选,跳链安装预加载延迟链接。", + "GET", + "自定义JSON字符串" + ] + ], + "section": "开发者服务器接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器接口规范" + } + ], + "title": "开发预加载资源接口", + "relatedDocuments": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86", + "title": "工作原理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%85%B8%E5%9E%8B%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF", + "title": "典型应用场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%8F%90%E5%8D%87%E5%BA%94%E7%94%A8%E9%A6%96%E5%BC%80%E9%80%9F%E5%BA%A6", + "title": "提升应用首开速度" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%AE%9E%E7%8E%B0%E8%8A%82%E6%97%A5%E4%B8%BB%E9%A2%98%E5%8D%B3%E5%8F%91%E5%8D%B3%E7%8E%B0", + "title": "实现节日主题即发即现" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E7%BA%A6%E6%9D%9F%E4%B8%8E%E9%99%90%E5%88%B6", + "title": "约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E8%AE%BE%E5%A4%87%E9%99%90%E5%88%B6", + "title": "设备限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%95%B0%E6%8D%AE%E9%99%90%E5%88%B6", + "title": "数据限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E9%85%8D%E9%A2%9D%E9%99%90%E5%88%B6", + "title": "配额限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "当前支持如下三种预加载类型:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "提升应用首开速度", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#提升应用首开速度", + "text": "在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。" + }, + { + "section": "实现节日主题即发即现", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#实现节日主题即发即现", + "text": "很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。" + }, + { + "section": "设备限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#设备限制", + "text": "支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n概述\n概述\n更新时间: 2026-06-12 14:54\n复制页面\n\n从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。\n\n预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。\n\n当前支持如下三种预加载类型:\n\n安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。\n\n周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。\n\n跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。\n\n工作原理\n\n预加载服务根据配置的数据预加载策略从应用后台获取数据。\n\n预加载服务将获取的数据在本地进行缓存。\n\n应用使用获取的缓存数据,进行页面渲染。\n\n典型应用场景\n提升应用首开速度\n\n在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。\n\n实现节日主题即发即现\n\n很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。\n\n约束与限制\n设备限制\n\n支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。\n\n数据限制\n限制项\t说明\n数据类型\t仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。\n配额限制\n配额类型\t配额\n安装预加载缓存大小\t2MB\n周期性预加载缓存大小\t3MB\n跳链安装预加载缓存大小\t3MB\n预加载\n开发流程\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n工作原理\n典型应用场景\n提升应用首开速度\n实现节日主题即发即现\n约束与限制\n设备限制\n数据限制\n配额限制\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "限制项", + "说明" + ], + [ + "数据类型", + "仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。" + ] + ], + "section": "数据限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#数据限制" + }, + { + "location": "", + "rows": [ + [ + "配额类型", + "配额" + ], + [ + "安装预加载缓存大小", + "2MB" + ], + [ + "周期性预加载缓存大小", + "3MB" + ], + [ + "跳链安装预加载缓存大小", + "3MB" + ] + ], + "section": "配额限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#配额限制" + } + ], + "title": "概述" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-installprefetch", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载,总体流程如下:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发流程\n开发流程\n更新时间: 2026-04-20 14:34\n复制页面\n\n开发预加载,总体流程如下:\n\n配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。\n\n开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。\n\n调用预加载:在工程代码文件中调用预加载。\n\n概述\n配置预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "status": "browser-read", + "tables": [], + "title": "开发流程" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "数据来源为云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E7%BB%91%E5%AE%9A%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "绑定云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "数据来源为开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6-1", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E9%85%8D%E7%BD%AE%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9C%B0%E5%9D%80", + "title": "配置服务器地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "对于不同类型的开发者,支持的数据来源方式有所不同:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "下文介绍如何配置两种数据来源方式的预加载实现。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件-1", + "text": "已开通预加载服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "需要注意以下几点:" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n配置预加载\n配置预加载\n更新时间: 2026-04-24 16:10\n复制页面\n\n安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。\n\n对于不同类型的开发者,支持的数据来源方式有所不同:\n\n个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。\n\n非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。\n\n下文介绍如何配置两种数据来源方式的预加载实现。\n\n数据来源为云函数\n前提条件\n\n已开通预加载服务。\n\n已创建函数。\n\n绑定云函数\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。\n\n点击“保存”完成周期性预加载配置。\n\n若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。\n\n数据来源为开发者服务器\n前提条件\n\n已开通预加载服务。\n\n配置服务器地址\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n点击“下载地址”后的“修改”。\n\n以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。\n\n若配置“安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。\n\n开发流程\n开发预加载资源接口\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n数据来源为云函数\n前提条件\n绑定云函数\n数据来源为开发者服务器\n前提条件\n配置服务器地址\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "status": "browser-read", + "tables": [], + "title": "配置预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-install-and-periodic-prefetch", + "title": "调用全部预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "调试周期性预加载" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "错误码" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n(可选)使用命令行工具调试周期性预加载\n更新时间: 2026-10-10 20:02\n复制页面\n调试周期性预加载\n\n错误码\n\n调用全部预加载\n调试周期性预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "status": "browser-read", + "tables": [], + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "getcache" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/registration-and-verification-0000001053628148", + "title": "账号注册认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-debug-cert-0000002283256797", + "title": "申请调试证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E8%AE%BE%E5%A4%87%E8%BF%9E%E6%8E%A5%E7%AE%A1%E7%90%86", + "title": "设备连接管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98", + "title": "常见问题" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%87%86%E5%A4%87", + "title": "调试准备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%88%87%E6%8D%A2shell%E7%8E%AF%E5%A2%83", + "title": "切换shell环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "调试命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E6%A0%BC%E5%BC%8F", + "title": "命令格式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E9%80%89%E9%A1%B9", + "title": "命令选项" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E6%AD%A3%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "正常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "prefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "当前命令行工具支持的命令集如下:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "使用命令行工具调试周期性预加载之前,需要完成以下准备工作:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "prefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "调试命令", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试命令", + "text": "命令名“getcache”,提供获取周期性预加载数据的能力。" + }, + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n调试周期性预加载\n调试周期性预加载\n更新时间: 2026-04-20 14:34\n复制页面\n\nprefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。\n\n当前命令行工具支持的命令集如下:\n\n命令名\t描述\ngetcache\t提供获取周期性预加载数据的能力。\n调试准备\n\n使用命令行工具调试周期性预加载之前,需要完成以下准备工作:\n\n您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。\n\n您已在本地安装DevEco Studio 5.0.3 Release及以上版本。\n\n手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。\n\n设置HAP包的“Build Mode”为“debug”,且已申请调试证书。\n\n切换shell环境\n\nprefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。\n\nPC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。\n\n打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。\n\n输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。\n\n调试命令\n\n命令名“getcache”,提供获取周期性预加载数据的能力。\n\n命令格式\ncf_prefetch getcache -m \n命令选项\n命令选项\t必填(M)/选填(O)\t描述\t示例\n-m\tM\t应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。\tcf_prefetch getcache -m com.huawei.hms.xs.test\n调用示例\n正常场景\n\n输入cf_prefetch help,获取命令行工具的使用说明。\n\n输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。\n\n输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。\n\n异常场景\n\n链路不通,例如无网络情况;或周期性预加载配置不正确。\n\n命令行工具内部错误。\n\nHAP包非debug调试模式。\n\n应用包名输入错误。\n\n(可选)使用命令行工具调试周期性预加载\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n调试准备\n切换shell环境\n调试命令\n命令格式\n命令选项\n调用示例\n正常场景\n异常场景\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "命令名", + "描述" + ], + [ + "getcache", + "提供获取周期性预加载数据的能力。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug" + }, + { + "location": "", + "rows": [ + [ + "命令选项", + "必填(M)/选填(O)", + "描述", + "示例" + ], + [ + "-m", + "M", + "应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。", + "cf_prefetch getcache -m com.huawei.hms.xs.test" + ] + ], + "section": "命令选项", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令选项" + } + ], + "title": "调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-emulator", + "title": "使用模拟器调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n错误码\n错误码\n更新时间: 2026-04-20 14:34\n复制页面\n错误码\t描述\t解决方法\n1008200005\t周期性预加载执行失败。\t\n\n请从以下方面进行排查:\n\n- 检查设备网络连接情况。\n\n- 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。\n\n- 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。\n\n\n1008200009\t命令行工具内部错误。\t请通过在线工单系统联系技术支持人员定位问题。\n1008240000\tHAP包不在debug模式下。\t请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。\n1008240007\t无法获取当前HAP包信息,例如APP ID等。\t请检查应用包名合法性,输入正确的应用包名。\n调试周期性预加载\n使用模拟器调试\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码", + "描述", + "解决方法" + ], + [ + "1008200005", + "周期性预加载执行失败。", + "请从以下方面进行排查: - 检查设备网络连接情况。 - 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。 - 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。" + ], + [ + "1008200009", + "命令行工具内部错误。", + "请通过在线工单系统联系技术支持人员定位问题。" + ], + [ + "1008240000", + "HAP包不在debug模式下。", + "请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。" + ], + [ + "1008240007", + "无法获取当前HAP包信息,例如APP ID等。", + "请检查应用包名合法性,输入正确的应用包名。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode" + } + ], + "title": "错误码" + } + ], + "implementationNotes": [ + "Developer-server GET simulation; does not configure Huawei prefetch or prove device delivery. Never loads developer credentials. Installation response limit follows the overview quota of 2MiB; periodic and deferred responses are limited to 3MiB. The configuration guide gives a generic 3MB server-response limit; that does not override the smaller installation quota." + ] +} diff --git a/pkg/domain/reference/prefetch/fetch-periodic.json b/pkg/domain/reference/prefetch/fetch-periodic.json new file mode 100644 index 0000000..eb8bbb5 --- /dev/null +++ b/pkg/domain/reference/prefetch/fetch-periodic.json @@ -0,0 +1,1892 @@ +{ + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-develop-function-nodejs", + "title": "开发函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-test-function", + "title": "测试函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-deveco-studio/agc-harmonyos-clouddev-funccoding", + "title": "端云一体化工程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-call", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E4%BA%91%E5%87%BD%E6%95%B0%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "云函数接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E7%A4%BA%E4%BE%8B-1", + "title": "示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "text": "使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "开发函数:按照云函数接口规范开发函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数", + "text": "测试函数:对函数进行测试,以确保函数代码运行正常。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "周期性预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let token = body.token;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "跳链安装预加载" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "import axios from 'axios';" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let myHandler = async function (event, context, callback, logger) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"event:\" + JSON.stringify(event));" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let env1 = context.env.env1; // 获取环境变量env1" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"env1: \" + env1)" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "try {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let body = event.body ? JSON.parse(event.body) : event;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let appId = body.appId;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let link = body.link; // 跳链安装预加载link信息" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"appId: \" + appId + \",link:\" + link);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "// http请求示例,请按照实际业务修改" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let headers = { 'k1': 'v1' }; // 请求header" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "let res; // 返回数据" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "await axios.post(url, {}, { headers }) // http post请求" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": ".then(response => {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "res = response.data;" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "})" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.info(\"--------Finished-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(res);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "} catch (error) {" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"--------Error-------\");" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "logger.error(\"error: \" + error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "callback(error);" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "}" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "};" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例", + "text": "export { myHandler };" + }, + { + "section": "开发者服务器", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器", + "text": "开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "定义名称为prefetchData的接口,示例如下:" + }, + { + "section": "示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#示例-1", + "text": "https://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发预加载资源接口\n开发预加载资源接口\n更新时间: 2026-09-01 11:59\n复制页面\n\n使用预加载服务之前,开发者需要完成云侧接口的开发,以提供预加载所需的资源数据。华为提供两种方式供开发者选择:云函数和开发者服务器,开发者可根据实际业务需要进行选择。\n\n云函数\n\n开发者需要先按照云函数接口规范开发函数,然后在AGC云端创建函数,并可测试函数运行是否正常。流程如下:\n\n开发函数:按照云函数接口规范开发函数。\n\n创建函数:函数业务代码开发完成后,即可在AGC云端创建函数。\n\n测试函数:对函数进行测试,以确保函数代码运行正常。\n\n云函数接口规范\n预加载类型\tAPI名称\t说明\t参数\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tevent.body.appId:应用ID,获取方法请参见查看应用信息。\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- event.body.appId:应用ID,获取方法请参见查看应用信息。\n\n- event.body.link:可选,跳链安装预加载延迟链接。\n\n\t自定义JSON字符串\n示例\n\n端云一体化工程预加载云函数示例如下。其中,axios依赖库为网络请求库,需要在“cloudfunctions/云函数名称/package.json”的“dependencies”中添加axios的1.7.7或以上版本依赖。\n\n安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n\n\n logger.info(\"appId: \" + appId);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n周期性预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let token = body.token;\n let paramsStr = body.params; // 如果需要解析json结构paramsStr中的参数,需要使用 let params = JSON.parse(paramsStr);\n\n\n logger.info(\"appId: \" + appId + \",token:\" + token + \",params:\" + paramsStr);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n\n跳链安装预加载\n\nimport axios from 'axios';\n\n\nlet myHandler = async function (event, context, callback, logger) {\n logger.info(\"event:\" + JSON.stringify(event));\n let env1 = context.env.env1; // 获取环境变量env1\n logger.info(\"env1: \" + env1)\n try {\n let body = event.body ? JSON.parse(event.body) : event;\n let appId = body.appId;\n let link = body.link; // 跳链安装预加载link信息\n\n\n logger.info(\"appId: \" + appId + \",link:\" + link);\n\n\n // http请求示例,请按照实际业务修改\n let url = 'https://example.com/prefetchApi'; // 页面资源数据的请求url\n let headers = { 'k1': 'v1' }; // 请求header\n let res; // 返回数据\n await axios.post(url, {}, { headers }) // http post请求\n .then(response => {\n res = response.data;\n })\n logger.info(\"--------Finished-------\");\n callback(res);\n } catch (error) {\n logger.error(\"--------Error-------\");\n logger.error(\"error: \" + error);\n callback(error);\n }\n};\n\n\nexport { myHandler };\nhandler.js\n开发者服务器\n\n开发者使用自己的服务器自行开发和实现预加载资源接口,接口需遵循开发者服务器接口规范。\n\n开发者服务器接口规范\n预加载类型\tAPI/PATH名称\t说明\t参数\t请求方式\t返回值\n安装预加载\t自定义\t获取预加载数据接口\tappId:应用ID,获取方法请参见查看应用信息。\tGET\t自定义JSON字符串\n周期性预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。\n\n- params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。\n\n\tGET\t自定义JSON字符串\n跳链安装预加载\t自定义\t获取预加载数据接口\t\n\n- appId:应用ID,获取方法请参见查看应用信息。\n\n- link:可选,跳链安装预加载延迟链接。\n\n\tGET\t自定义JSON字符串\n示例\n\n定义名称为prefetchData的接口,示例如下:\n\nhttps://www.example.com/prefetchData?appId=1234&token=xxxx¶ms=yyyy\n配置预加载\n调用预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n云函数\n云函数接口规范\n示例\n开发者服务器\n开发者服务器接口规范\n示例\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "预加载类型", + "API名称", + "说明", + "参数", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "event.body.appId:应用ID,获取方法请参见查看应用信息。", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - event.body.params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- event.body.appId:应用ID,获取方法请参见查看应用信息。 - event.body.link:可选,跳链安装预加载延迟链接。", + "自定义JSON字符串" + ] + ], + "section": "云函数接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#云函数接口规范" + }, + { + "location": "", + "rows": [ + [ + "预加载类型", + "API/PATH名称", + "说明", + "参数", + "请求方式", + "返回值" + ], + [ + "安装预加载", + "自定义", + "获取预加载数据接口", + "appId:应用ID,获取方法请参见查看应用信息。", + "GET", + "自定义JSON字符串" + ], + [ + "周期性预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - token:可选,注册周期性预加载任务时开发者自行传入的用户级认证信息,长度不超过2048个字符。 - params:可选,注册周期性预加载任务时开发者自行传入的自定义参数,长度不超过1024个字符。", + "GET", + "自定义JSON字符串" + ], + [ + "跳链安装预加载", + "自定义", + "获取预加载数据接口", + "- appId:应用ID,获取方法请参见查看应用信息。 - link:可选,跳链安装预加载延迟链接。", + "GET", + "自定义JSON字符串" + ] + ], + "section": "开发者服务器接口规范", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#开发者服务器接口规范" + } + ], + "title": "开发预加载资源接口", + "relatedDocuments": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86", + "title": "工作原理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%85%B8%E5%9E%8B%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF", + "title": "典型应用场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%8F%90%E5%8D%87%E5%BA%94%E7%94%A8%E9%A6%96%E5%BC%80%E9%80%9F%E5%BA%A6", + "title": "提升应用首开速度" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E5%AE%9E%E7%8E%B0%E8%8A%82%E6%97%A5%E4%B8%BB%E9%A2%98%E5%8D%B3%E5%8F%91%E5%8D%B3%E7%8E%B0", + "title": "实现节日主题即发即现" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E7%BA%A6%E6%9D%9F%E4%B8%8E%E9%99%90%E5%88%B6", + "title": "约束与限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E8%AE%BE%E5%A4%87%E9%99%90%E5%88%B6", + "title": "设备限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E6%95%B0%E6%8D%AE%E9%99%90%E5%88%B6", + "title": "数据限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview#%E9%85%8D%E9%A2%9D%E9%99%90%E5%88%B6", + "title": "配额限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "当前支持如下三种预加载类型:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "text": "同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务根据配置的数据预加载策略从应用后台获取数据。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "预加载服务将获取的数据在本地进行缓存。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "工作原理", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#工作原理", + "text": "应用使用获取的缓存数据,进行页面渲染。" + }, + { + "section": "提升应用首开速度", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#提升应用首开速度", + "text": "在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。" + }, + { + "section": "实现节日主题即发即现", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#实现节日主题即发即现", + "text": "很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。" + }, + { + "section": "设备限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#设备限制", + "text": "支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n概述\n概述\n更新时间: 2026-06-12 14:54\n复制页面\n\n从5.0.3(15)版本开始,新增支持安装预加载和周期性预加载功能;从6.1.0(23)版本开始,新增支持跳链安装预加载功能。\n\n预加载是Cloud Foundation Kit提供的一种可提前加载所需资源的服务。通过预加载,可以将页面所需的文本、图片、音频、视频等资源数据提前加载到本地进行缓存,以提升应用页面加载速度。预加载仅以字符串数据形式进行缓存,应用使用预加载时不需要修改原有数据格式,获取缓存后可直接进行解析,并且可以对隐私、敏感数据进行加密。\n\n当前支持如下三种预加载类型:\n\n安装预加载:适用于安装应用后首次打开,应用首页加载提速场景。在应用安装时下载云侧应用数据进行缓存,应用打开时直接获取本地首开页面缓存数据呈现内容。\n\n周期性预加载:适用于任意页面加载提速的场景,可与安装预加载结合使用。系统每隔12h拉取一次指定页面(不局限首开页面)的云侧数据并将其缓存到本地,并可将静态资源放置到云端,减少包体大小。比较适合节日主题资源、H5离线包等场景。\n\n跳链安装预加载:适用于被分享用户安装应用后首次打开,应用详情页加载提速场景,可与安装预加载、周期性预加载结合使用。在应用安装过程中,预加载结合App Linking Kit的延迟链接功能,可提前将用户之前点击的详情页数据缓存到本地。当用户首次打开应用时,即可直接跳转到相应的详情页,并即时加载本地缓存的数据呈现内容。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n同时还支持H5预加载组件FastWeb,它是基于Open Harmony基础组件开发的高性能Web容器,具有预启动、预渲染、预编译JavaScript生成字节码缓存、离线资源免拦截注入等能力,可为应用中Web页面的加载进行提速。H5预加载组件FastWeb无需使用Cloud Foundation Kit能力,详细使用方法可参考Web容器FastWeb。\n\n工作原理\n\n预加载服务根据配置的数据预加载策略从应用后台获取数据。\n\n预加载服务将获取的数据在本地进行缓存。\n\n应用使用获取的缓存数据,进行页面渲染。\n\n典型应用场景\n提升应用首开速度\n\n在应用启动前或初始化阶段,为避免出现首页内容加载慢、白屏等情况,开发者可以使用预加载将一些必要的资源,例如图片、音频、视频或数据文件,提前加载到本地进行缓存。用户首次访问应用时,可直接从缓存中获取数据,这样就减少了从服务器重新下载资源的时间,提升了应用首开速度,从而提高用户留存率。\n\n实现节日主题即发即现\n\n很多应用会在节日更换特定主题内容进行活动营销,用户打开应用时需要从服务器上获取相关资源来呈现内容,可能会造成页面加载速度较慢而导致用户体验不佳。开发者可以使用预加载,在节日活动开始前通过周期性的数据拉取提前将主题资源获取到本地,活动开始用户访问时直接从本地获取即可,减少了网络请求的时间和带宽消耗,从而能够更快地展示节日主题,实现即发即现的效果,提升用户体验。\n\n约束与限制\n设备限制\n\n支持Phone、Tablet设备。并且从6.1.0(23)版本开始,新增支持PC/2in1设备。\n\n数据限制\n限制项\t说明\n数据类型\t仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。\n配额限制\n配额类型\t配额\n安装预加载缓存大小\t2MB\n周期性预加载缓存大小\t3MB\n跳链安装预加载缓存大小\t3MB\n预加载\n开发流程\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n工作原理\n典型应用场景\n提升应用首开速度\n实现节日主题即发即现\n约束与限制\n设备限制\n数据限制\n配额限制\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "限制项", + "说明" + ], + [ + "数据类型", + "仅支持缓存文本、图片、音频、视频等静态资源数据,不支持代码、脚本等动态资源数据。" + ] + ], + "section": "数据限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#数据限制" + }, + { + "location": "", + "rows": [ + [ + "配额类型", + "配额" + ], + [ + "安装预加载缓存大小", + "2MB" + ], + [ + "周期性预加载缓存大小", + "3MB" + ], + [ + "跳链安装预加载缓存大小", + "3MB" + ] + ], + "section": "配额限制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/cloudfoundation-prefetch-overview#配额限制" + } + ], + "title": "概述" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-installprefetch", + "title": "调用预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-overview", + "title": "概述" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载,总体流程如下:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "text": "调用预加载:在工程代码文件中调用预加载。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n开发流程\n开发流程\n更新时间: 2026-04-20 14:34\n复制页面\n\n开发预加载,总体流程如下:\n\n配置预加载:在AGC云端预加载界面选择数据来源类型,并进行相关配置。\n\n开发预加载资源接口:根据选择的数据来源类型,开发对应的云侧接口,以提供预加载所需的资源数据。\n\n调用预加载:在工程代码文件中调用预加载。\n\n概述\n配置预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "status": "browser-read", + "tables": [], + "title": "开发流程" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-create-and-config-function", + "title": "创建函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-enable-prefetch", + "title": "开通预加载服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/applinking-deferredlink", + "title": "通过延迟链接跳转至应用详情页" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev#%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E5%8F%A3%E8%A7%84%E8%8C%83", + "title": "开发者服务器接口规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-devprocess", + "title": "开发流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-cloud-interdev", + "title": "开发预加载资源接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "数据来源为云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E7%BB%91%E5%AE%9A%E4%BA%91%E5%87%BD%E6%95%B0", + "title": "绑定云函数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90%E4%B8%BA%E5%BC%80%E5%8F%91%E8%80%85%E6%9C%8D%E5%8A%A1%E5%99%A8", + "title": "数据来源为开发者服务器" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6-1", + "title": "前提条件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#%E9%85%8D%E7%BD%AE%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9C%B0%E5%9D%80", + "title": "配置服务器地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "对于不同类型的开发者,支持的数据来源方式有所不同:" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "text": "下文介绍如何配置两种数据来源方式的预加载实现。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已开通预加载服务。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件", + "text": "已创建函数。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "点击“保存”完成周期性预加载配置。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "绑定云函数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#绑定云函数", + "text": "(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。" + }, + { + "section": "前提条件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#前提条件-1", + "text": "已开通预加载服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "登录AppGallery Connect,点击“开发与服务”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "跳链安装预加载仅支持在HarmonyOS应用中调用。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "点击“下载地址”后的“修改”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "需要注意以下几点:" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "域名:须填写完整的域名。例如www.example.com,不可写为example.com。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "IP地址:须填写准确的IP地址,确保没有输入错误。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "若配置“安装预加载”,重复步骤4-6即可。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + }, + { + "section": "配置服务器地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config#配置服务器地址", + "text": "(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n配置预加载\n配置预加载\n更新时间: 2026-04-24 16:10\n复制页面\n\n安装预加载、周期性预加载和跳链安装预加载需分别进行配置,且三者均可通过云函数和开发者服务器(即HTTPS请求)两种数据来源方式来实现。\n\n对于不同类型的开发者,支持的数据来源方式有所不同:\n\n个人开发者:数据来源默认选择云函数,且仅支持通过云函数来实现预加载。需要开通云函数服务并创建函数才可以配置。\n\n非个人开发者:数据来源支持云函数和开发者服务器两种。可根据实际需要进行选择。\n\n下文介绍如何配置两种数据来源方式的预加载实现。\n\n数据来源为云函数\n前提条件\n\n已开通预加载服务。\n\n已创建函数。\n\n绑定云函数\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“云函数”,然后点击“函数名称”后的“修改”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n以“周期性预加载”为例,在“函数名称”下拉框选择实现周期性预加载的函数名称。\n\n点击“保存”完成周期性预加载配置。\n\n若配置“安装预加载”或“跳链安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改绑定的云函数,只需点击“函数名称”后的“修改”进行更新。\n\n数据来源为开发者服务器\n前提条件\n\n已开通预加载服务。\n\n配置服务器地址\n\n登录AppGallery Connect,点击“开发与服务”。\n\n在项目列表中点击您的项目,在项目下的应用列表中选择需要配置预加载的HarmonyOS应用/元服务。\n\n在左侧导航栏选择“云开发(Serverless)> 预加载”,进入预加载页面。\n\n根据实际需要,在“周期性预加载”、“安装预加载”或者“跳链安装预加载”区域,“数据来源”选择“开发者服务器”。\n\n说明\n\n跳链安装预加载仅支持在HarmonyOS应用中调用。\n\n由于跳链安装预加载功能需要使用App Linking Kit提供的延迟链接能力,因此在配置跳链安装预加载之前,请务必先完成延迟链接的开发。具体请参见通过延迟链接跳转至应用详情页。\n\n点击“下载地址”后的“修改”。\n\n以“周期性预加载”为例,“下载地址”以“https://”开头,输入框中输入服务器地址,配置完成后点击“保存”。\n\n需要注意以下几点:\n\n仅支持填写一个服务器地址,需包含预加载资源接口路径,如图中示例:prefetchData。\n\n域名:须填写完整的域名。例如www.example.com,不可写为example.com。\n\nIP地址:须填写准确的IP地址,确保没有输入错误。\n\n端口号:如果要指定端口号,可在服务器地址后面以冒号分隔,例如https://www.example.com:443。HTTPS协议的默认端口号(443)可以省略。\n\n后续AGC会周期性地向该处配置的开发者服务器(即下载地址)发起一个HTTP GET请求,其中包含的query参数请参考开发者服务器接口规范,获取到数据后会将整个HTTP body缓存在本地。\n\n说明\n\n开发者服务器接口返回的数据内容需仅包含文本、图片、视频、音频等供页面展示的静态资源,不支持包含代码、脚本等动态数据。\n\n开发者服务器接口返回的数据类型为其自定义格式的JSON或字符串数据,大小需限定在3MB以内。\n\n若配置“安装预加载”,重复步骤4-6即可。\n\n(可选)若后续需要修改下载地址,只需点击“下载地址”后的“修改”进行更新。\n\n开发流程\n开发预加载资源接口\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n数据来源为云函数\n前提条件\n绑定云函数\n数据来源为开发者服务器\n前提条件\n配置服务器地址\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "status": "browser-read", + "tables": [], + "title": "配置预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-call-install-and-periodic-prefetch", + "title": "调用全部预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "调试周期性预加载" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "text": "错误码" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n(可选)使用命令行工具调试周期性预加载\n更新时间: 2026-10-10 20:02\n复制页面\n调试周期性预加载\n\n错误码\n\n调用全部预加载\n调试周期性预加载\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "status": "browser-read", + "tables": [], + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "getcache" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/registration-and-verification-0000001053628148", + "title": "账号注册认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-debug-cert-0000002283256797", + "title": "申请调试证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E8%AE%BE%E5%A4%87%E8%BF%9E%E6%8E%A5%E7%AE%A1%E7%90%86", + "title": "设备连接管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/hdc#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98", + "title": "常见问题" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%87%86%E5%A4%87", + "title": "调试准备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%88%87%E6%8D%A2shell%E7%8E%AF%E5%A2%83", + "title": "切换shell环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4", + "title": "调试命令" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E6%A0%BC%E5%BC%8F", + "title": "命令格式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%91%BD%E4%BB%A4%E9%80%89%E9%A1%B9", + "title": "命令选项" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E6%AD%A3%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "正常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF", + "title": "异常场景" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "prefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "text": "当前命令行工具支持的命令集如下:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "使用命令行工具调试周期性预加载之前,需要完成以下准备工作:" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "您已在本地安装DevEco Studio 5.0.3 Release及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "调试准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试准备", + "text": "设置HAP包的“Build Mode”为“debug”,且已申请调试证书。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "prefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "PC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "切换shell环境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#切换shell环境", + "text": "输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。" + }, + { + "section": "调试命令", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#调试命令", + "text": "命令名“getcache”,提供获取周期性预加载数据的能力。" + }, + { + "section": "命令格式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令格式", + "text": "cf_prefetch getcache -m " + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch help,获取命令行工具的使用说明。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。" + }, + { + "section": "正常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#正常场景", + "text": "如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "链路不通,例如无网络情况;或周期性预加载配置不正确。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "命令行工具内部错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "HAP包非debug调试模式。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + }, + { + "section": "异常场景", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#异常场景", + "text": "应用包名输入错误。" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n调试周期性预加载\n调试周期性预加载\n更新时间: 2026-04-20 14:34\n复制页面\n\nprefetch_test_tool是为周期性预加载功能提供的一种命令行工具,开发者集成预加载服务后,使用该工具可以更方便、更高效地进行周期性预加载功能测试和调试,提高开发效率,同时确保预加载服务的平稳运行。\n\n当前命令行工具支持的命令集如下:\n\n命令名\t描述\ngetcache\t提供获取周期性预加载数据的能力。\n调试准备\n\n使用命令行工具调试周期性预加载之前,需要完成以下准备工作:\n\n您已在开发者联盟官网注册账号并通过实名认证,详情请参见账号注册认证。\n\n您已在本地安装DevEco Studio 5.0.3 Release及以上版本。\n\n手机/平板终端设备的ROM版本已升级至HarmonyOS 6.0.0 Beta5及以上版本。\n\n设置HAP包的“Build Mode”为“debug”,且已申请调试证书。\n\n切换shell环境\n\nprefetch_test_tool命令行工具基于hdc shell调试,需要切换到hdc shell命令环境。\n\nPC连接调试设备。连接方式请根据实际情况选择,详情请参见设备连接管理。\n\n打开DevEco Studio,菜单栏选择“View > Tool Windows > Terminal”进入Terminal窗口。\n\n输入hdc shell,切换到hdc shell命令环境。切换过程中如果出现报错,请参见常见问题排查解决。\n\n调试命令\n\n命令名“getcache”,提供获取周期性预加载数据的能力。\n\n命令格式\ncf_prefetch getcache -m \n命令选项\n命令选项\t必填(M)/选填(O)\t描述\t示例\n-m\tM\t应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。\tcf_prefetch getcache -m com.huawei.hms.xs.test\n调用示例\n正常场景\n\n输入cf_prefetch help,获取命令行工具的使用说明。\n\n输入cf_prefetch getcache -h,获取getcache命令支持的参数信息。\n\n输入cf_prefetch getcache -m ,立即向云侧请求获取一次周期性预加载数据。\n\n说明\n\n如果返回结果中的“fetch data timestamp”不是当前时间,则表示仍为上一次成功拉取数据的时间戳,此次数据拉取失败,请参见异常场景排查。\n\n异常场景\n\n链路不通,例如无网络情况;或周期性预加载配置不正确。\n\n命令行工具内部错误。\n\nHAP包非debug调试模式。\n\n应用包名输入错误。\n\n(可选)使用命令行工具调试周期性预加载\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n调试准备\n切换shell环境\n调试命令\n命令格式\n命令选项\n调用示例\n正常场景\n异常场景\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "命令名", + "描述" + ], + [ + "getcache", + "提供获取周期性预加载数据的能力。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug" + }, + { + "location": "", + "rows": [ + [ + "命令选项", + "必填(M)/选填(O)", + "描述", + "示例" + ], + [ + "-m", + "M", + "应用包名。此处的包名需要与您在AppGallery Connect中创建应用时配置的包名保持一致。", + "cf_prefetch getcache -m com.huawei.hms.xs.test" + ] + ], + "section": "命令选项", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug#命令选项" + } + ], + "title": "调试周期性预加载" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloud-foundation-kit-guide", + "title": "Cloud Foundation Kit(云开发服务)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-service", + "title": "预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-debugging", + "title": "(可选)使用命令行工具调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-prefetch-config", + "title": "配置预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-debug", + "title": "调试周期性预加载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-emulator", + "title": "使用模拟器调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "text": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录" + } + ], + "renderedText": "您当前正在浏览新版开发者文档中心,目录分类和层级有所调整。点击左侧当前文档分类名称前的“☰”图标,可切换文档分类。 了解新版目录\n\n指南与API参考\n指南\n应用服务\nCloud Foundation Kit(云开发服务)\n预加载\n(可选)使用命令行工具调试周期性预加载\n错误码\n错误码\n更新时间: 2026-04-20 14:34\n复制页面\n错误码\t描述\t解决方法\n1008200005\t周期性预加载执行失败。\t\n\n请从以下方面进行排查:\n\n- 检查设备网络连接情况。\n\n- 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。\n\n- 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。\n\n\n1008200009\t命令行工具内部错误。\t请通过在线工单系统联系技术支持人员定位问题。\n1008240000\tHAP包不在debug模式下。\t请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。\n1008240007\t无法获取当前HAP包信息,例如APP ID等。\t请检查应用包名合法性,输入正确的应用包名。\n调试周期性预加载\n使用模拟器调试\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码", + "描述", + "解决方法" + ], + [ + "1008200005", + "周期性预加载执行失败。", + "请从以下方面进行排查: - 检查设备网络连接情况。 - 确保周期性预加载配置正确。若配置不正确,请参考配置预加载重新配置。 - 确保云函数数据存储到中国境内(香港特别行政区、澳门特别行政区、中国台湾除外)。" + ], + [ + "1008200009", + "命令行工具内部错误。", + "请通过在线工单系统联系技术支持人员定位问题。" + ], + [ + "1008240000", + "HAP包不在debug模式下。", + "请确保HAP包的“Build Mode”设置为“debug”,且已申请调试证书。" + ], + [ + "1008240007", + "无法获取当前HAP包信息,例如APP ID等。", + "请检查应用包名合法性,输入正确的应用包名。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-capabilities/cloudfoundation-commandtool-errorcode" + } + ], + "title": "错误码" + } + ], + "implementationNotes": [ + "Developer-server GET simulation; does not configure Huawei prefetch or prove device delivery. Never loads developer credentials. Installation response limit follows the overview quota of 2MiB; periodic and deferred responses are limited to 3MiB. The configuration guide gives a generic 3MB server-response limit; that does not override the smaller installation quota." + ] +} diff --git a/pkg/domain/reference/projects/addappfingerprint.json b/pkg/domain/reference/projects/addappfingerprint.json new file mode 100644 index 0000000..fadddfa --- /dev/null +++ b/pkg/domain/reference/projects/addappfingerprint.json @@ -0,0 +1,197 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "title": "获取应用简略信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065", + "title": "获取配置文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077", + "title": "查询证书指纹和AppSecret" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section886219295206", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section843129163214", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section026332842518", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section49483413", + "text": "此接口用于设置应用的证书指纹信息。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165", + "text": "本接口只支持OAuth客户端方式。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/cds/app-distirbution/v1/all/app-extra-info/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "uid", + "M", + "String", + "开发者账号ID,可通过查询开发者账号ID查询。" + ], + [ + "teamId", + "M", + "String", + "应用归属的团队账号ID,可以通过获取应用简略信息接口获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section886219295206" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "addCertFingerprints", + "M", + "List", + "需要添加的证书指纹,证书指纹中不能包含冒号。 1个应用最多只能有5个证书指纹。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section843129163214" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section4770825143714" + } + ], + "title": "添加证书指纹", + "updatedAt": "2025-10-30 11:38", + "checkedAt": "2026-10-07T02:56:30.244Z", + "family": "projects", + "endpoint": "addappfingerprint" +} diff --git a/pkg/domain/reference/projects/addappfingerprint.parameters.json b/pkg/domain/reference/projects/addappfingerprint.parameters.json new file mode 100644 index 0000000..3fb7f05 --- /dev/null +++ b/pkg/domain/reference/projects/addappfingerprint.parameters.json @@ -0,0 +1,45 @@ +[ + { + "name": "oauth2Token", + "in": "header", + "type": "string", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165" + }, + { + "name": "uid", + "in": "header", + "type": "string", + "required": true, + "description": "开发者账号ID,可通过查询开发者账号ID查询。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165" + }, + { + "name": "teamId", + "in": "header", + "type": "string", + "required": true, + "description": "应用归属的团队账号ID,可以通过获取应用简略信息接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section236517415165" + }, + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section886219295206" + }, + { + "name": "addCertFingerprints", + "in": "body", + "type": "array", + "required": true, + "description": "需要添加的证书指纹,证书指纹中不能包含冒号。 1个应用最多只能有5个证书指纹。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218#section843129163214", + "itemsType": "string", + "maxItems": 5, + "itemsPattern": "^[^:]*$" + } +] diff --git a/pkg/domain/reference/projects/appbriefinfo.json b/pkg/domain/reference/projects/appbriefinfo.json new file mode 100644 index 0000000..dbd7706 --- /dev/null +++ b/pkg/domain/reference/projects/appbriefinfo.json @@ -0,0 +1,320 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#ZH-CN_TOPIC_0000001111845106__p15218928192818", + "title": "AppBriefInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#ZH-CN_TOPIC_0000001111845106__p1663313164299", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065", + "title": "获取配置文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section19541434122811", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section49483413", + "text": "批量查询应用简略信息。接口调用者的角色:账号持有者、管理员、App管理员、开发。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section236517415165", + "text": "本接口只支持OAuth客户端方式。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section4770825143714", + "text": "AppBriefInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section4770825143714", + "text": "DeviceTypeInfo" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/cds/app-distirbution/v1/all/app-brief-info/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "userID", + "M", + "Integer", + "主账号用户id,即团队ID。通过获取团队列表接口获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "O", + "String", + "需要查询的应用ID列表,多个值间以半角逗号分隔。 appId和packageNames必须传一个,如果同时存在则以appId为准。" + ], + [ + "packageNames", + "O", + "String", + "需要查询的应用包名,多个包名用逗号分隔,最大100个。 appId和packageNames必须传一个,如果同时存在则以appId为准。" + ], + [ + "appType", + "O", + "String", + "应用类型。 1:移动应用(包括普通应用和游戏) 2:电视应用 4:路由器应用 8:华为VR应用 9:手表应用 19:RPK应用 23:大屏快应用 27:车机应用 28:车机快应用 29:运动手表 30:云游戏 9998:ios应用 9999:web应用" + ], + [ + "appDistStatus", + "O", + "String", + "应用分发状态列表,多个值间以半角逗号分隔。 -999:审核中 -995:升级中 0:不通过 1:已下架(含强制下架) 62:待上架 101:已上架(含升级不通过,申请下架失败) 99999:申请下架 9998:草稿 9997:已删除" + ], + [ + "fromRecCount", + "O", + "Integer", + "起始页数。从1开始,表示第1个。如果不传,默认值:1。" + ], + [ + "maxReqCount", + "O", + "Integer", + "每页返回条数;缺省20(最大1000)。" + ], + [ + "sortType", + "O", + "String", + "排序方式。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appInfos", + "M", + "List", + "应用简略信息列表。" + ], + [ + "notExistIDs", + "M", + "String", + "不存在的应用ID列表,多个间以逗号分隔。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section4770825143714" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "prodSerialNo", + "M", + "Integer", + "应用序列号。" + ], + [ + "appID", + "M", + "String", + "应用ID。" + ], + [ + "appName", + "M", + "String", + "应用名称。" + ], + [ + "projectId", + "M", + "String", + "项目ID。" + ], + [ + "appType", + "M", + "String", + "应用类型。 1:移动应用(包括普通应用和游戏) 2:电视应用 4:路由器应用 8:华为VR应用 9:手表应用 19:RPK应用 23:大屏快应用 27:车机应用 28:车机快应用 29:运动手表 30:云游戏 9998:ios应用 9999:web应用" + ], + [ + "packageName", + "M", + "String", + "应用包名。" + ], + [ + "teamId", + "M", + "String", + "应用归属的团队账号id。" + ], + [ + "packageType", + "M", + "Integer", + "软件包类型。 1:APK 2:RPK 3:WPK 4:EXE(云应用)" + ], + [ + "deviceTypes", + "M", + "List", + "应用的设备类型。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section4770825143714" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "appAdapters", + "M", + "String", + "适配设备类型,多个间逗号分隔。 1:荣耀立方(路由器) 4:手机 5:平板 6:VR 7:手表(智能表Android wear系统) 8:TV 9:路由器 11:儿童手表 12:智能手表 13:带屏音箱" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section4770825143714" + } + ], + "title": "获取应用简略信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T05:24:11.249Z" +} diff --git a/pkg/domain/reference/projects/appbriefinfo.parameters.json b/pkg/domain/reference/projects/appbriefinfo.parameters.json new file mode 100644 index 0000000..a04b206 --- /dev/null +++ b/pkg/domain/reference/projects/appbriefinfo.parameters.json @@ -0,0 +1,92 @@ +[ + { + "name": "oauth2Token", + "in": "header", + "type": "string", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section236517415165" + }, + { + "name": "userID", + "in": "header", + "type": "integer", + "required": true, + "description": "主账号用户id,即团队ID。通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": false, + "description": "需要查询的应用ID列表,多个值间以半角逗号分隔。 appId和packageNames必须传一个,如果同时存在则以appId为准。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508" + }, + { + "name": "packageNames", + "in": "query", + "type": "string", + "required": false, + "description": "需要查询的应用包名,多个包名用逗号分隔,最大100个。 appId和packageNames必须传一个,如果同时存在则以appId为准。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508" + }, + { + "name": "appType", + "in": "query", + "type": "string", + "required": false, + "description": "应用类型。 1:移动应用(包括普通应用和游戏) 2:电视应用 4:路由器应用 8:华为VR应用 9:手表应用 19:RPK应用 23:大屏快应用 27:车机应用 28:车机快应用 29:运动手表 30:云游戏 9998:ios应用 9999:web应用", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "enum": [ + "1", + "2", + "4", + "8", + "9", + "19", + "23", + "27", + "28", + "29", + "30", + "9998", + "9999" + ] + }, + { + "name": "appDistStatus", + "in": "query", + "type": "string", + "required": false, + "description": "应用分发状态列表,多个值间以半角逗号分隔。 -999:审核中 -995:升级中 0:不通过 1:已下架(含强制下架) 62:待上架 101:已上架(含升级不通过,申请下架失败) 99999:申请下架 9998:草稿 9997:已删除", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "pattern": "^(?:-999|-995|0|1|62|101|99999|9998|9997)(?:,(?:-999|-995|0|1|62|101|99999|9998|9997))*$" + }, + { + "name": "fromRecCount", + "in": "query", + "type": "integer", + "required": false, + "description": "起始页数。从1开始,表示第1个。如果不传,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "minimum": 1 + }, + { + "name": "maxReqCount", + "in": "query", + "type": "integer", + "required": false, + "description": "每页返回条数;缺省20(最大1000)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "maximum": 1000 + }, + { + "name": "sortType", + "in": "query", + "type": "string", + "required": false, + "description": "排序方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508" + } +] diff --git a/pkg/domain/reference/projects/appbriefinfo.rules.json b/pkg/domain/reference/projects/appbriefinfo.rules.json new file mode 100644 index 0000000..cde41a6 --- /dev/null +++ b/pkg/domain/reference/projects/appbriefinfo.rules.json @@ -0,0 +1,24 @@ +[ + { + "id": "application-package-count", + "kind": "csv_count", + "field": "query.packageNames", + "minItems": 1, + "maxItems": 100, + "unlessPresent": "query.appId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "message": "packageNames accepts at most 100 nonempty comma-separated package names.", + "suggestion": "Use at most 100 package names, or select applications with appId, which takes precedence." + }, + { + "id": "application-identity", + "kind": "at_least_one", + "fields": [ + "query.appId", + "query.packageNames" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106#section423141017508", + "message": "Supply appId or packageNames to select applications.", + "suggestion": "Provide a comma-separated appId list or packageNames list; appId takes precedence when both exist." + } +] diff --git a/pkg/domain/reference/projects/getconfigfile.json b/pkg/domain/reference/projects/getconfigfile.json new file mode 100644 index 0000000..4e90c4f --- /dev/null +++ b/pkg/domain/reference/projects/getconfigfile.json @@ -0,0 +1,207 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "title": "获取应用简略信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "title": "获取应用简略信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218", + "title": "添加证书指纹" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section918911523284", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section49483413", + "text": "获取应用的配置文件。接口调用者的角色:账号持有者、管理员、App管理员、开发。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section236517415165", + "text": "本接口支持使用Service Account方式和OAuth客户端方式,二者区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section236517415165", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/cpms/project-management-service/v1/config-file" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "需要获取配置文件的应用ID,可以通过获取应用简略信息接口获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileName", + "M", + "String", + "配置文件名。" + ], + [ + "content", + "M", + "String", + "文件内容。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section4770825143714" + } + ], + "title": "获取配置文件", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:32.464Z", + "family": "projects", + "endpoint": "getconfigfile" +} diff --git a/pkg/domain/reference/projects/getconfigfile.parameters.json b/pkg/domain/reference/projects/getconfigfile.parameters.json new file mode 100644 index 0000000..97e42f5 --- /dev/null +++ b/pkg/domain/reference/projects/getconfigfile.parameters.json @@ -0,0 +1,10 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "需要获取配置文件的应用ID,可以通过获取应用简略信息接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getconfigfile-0000001158365065#section886219295206" + } +] diff --git a/pkg/domain/reference/projects/getteamlist.json b/pkg/domain/reference/projects/getteamlist.json new file mode 100644 index 0000000..a0dc23e --- /dev/null +++ b/pkg/domain/reference/projects/getteamlist.json @@ -0,0 +1,207 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#ZH-CN_TOPIC_0000001158245075__p957917412411", + "title": "Team" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "title": "获取应用简略信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section178003100284", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section49483413", + "text": "获取开发者的团队账号列表信息。接口调用者的角色:账号持有者、管理员、App管理员、开发。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section236517415165", + "text": "本接口只支持OAuth客户端方式。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section4770825143714", + "text": "Team" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/ups/user-permission-service/v1/user-team-list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section236517415165" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teams", + "M", + "List", + "团队列表信息。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section4770825143714" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "name", + "M", + "String", + "团队名称。" + ], + [ + "id", + "M", + "String", + "团队ID。" + ], + [ + "countryCode", + "M", + "String", + "团队所属国家的国家码。" + ], + [ + "userType", + "M", + "Integer", + "团队账号类型: 1:个人开发者 2:企业开发者" + ], + [ + "siteId", + "M", + "Integer", + "团队账号持有者所在站点。 1:中国站点 5:新加坡站点 7:德国站点 8:俄罗斯站点" + ], + [ + "upSiteId", + "O", + "Integer", + "团队账号持有者UP注册地所在站点。" + ], + [ + "lastLoginTime", + "O", + "String", + "账号最后登录时间。 格式为:YYYY-MM-DD HH:mm:ss" + ], + [ + "isMirror", + "M", + "Boolean", + "是否为镜像账号。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section4770825143714" + } + ], + "title": "获取团队列表", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:56:33.514Z", + "family": "projects", + "endpoint": "getteamlist" +} diff --git a/pkg/domain/reference/projects/getteamlist.parameters.json b/pkg/domain/reference/projects/getteamlist.parameters.json new file mode 100644 index 0000000..565aea1 --- /dev/null +++ b/pkg/domain/reference/projects/getteamlist.parameters.json @@ -0,0 +1,10 @@ +[ + { + "name": "oauth2Token", + "in": "header", + "type": "string", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075#section236517415165" + } +] diff --git a/pkg/domain/reference/projects/queryappfingerprint.json b/pkg/domain/reference/projects/queryappfingerprint.json new file mode 100644 index 0000000..ebf32ee --- /dev/null +++ b/pkg/domain/reference/projects/queryappfingerprint.json @@ -0,0 +1,186 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询开发者账号ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "title": "获取应用简略信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addappfingerprint-0000001111685218", + "title": "添加证书指纹" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108", + "title": "查询服务开通状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section886219295206", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section026332842518", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section49483413", + "text": "此接口用于根据应用ID查询App Secret、证书指纹信息。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165", + "text": "本接口只支持OAuth客户端方式。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/cds/app-distirbution/v1/all/app-extra-info/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "uid", + "M", + "String", + "开发者账号ID,可通过查询开发者账号ID查询。" + ], + [ + "teamId", + "M", + "String", + "应用归属的团队账号ID,可以通过获取应用简略信息接口获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "secret", + "M", + "String", + "应用的App Secret。" + ], + [ + "certFingerprints", + "O", + "List", + "应用的证书指纹信息。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section4770825143714" + } + ], + "title": "查询证书指纹和AppSecret", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:56:34.746Z", + "family": "projects", + "endpoint": "queryappfingerprint" +} diff --git a/pkg/domain/reference/projects/queryappfingerprint.parameters.json b/pkg/domain/reference/projects/queryappfingerprint.parameters.json new file mode 100644 index 0000000..9b5dabe --- /dev/null +++ b/pkg/domain/reference/projects/queryappfingerprint.parameters.json @@ -0,0 +1,34 @@ +[ + { + "name": "oauth2Token", + "in": "header", + "type": "string", + "required": true, + "description": "认证信息,传入获取用户授权码中获取的Access Token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165" + }, + { + "name": "uid", + "in": "header", + "type": "string", + "required": true, + "description": "开发者账号ID,可通过查询开发者账号ID查询。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165" + }, + { + "name": "teamId", + "in": "header", + "type": "string", + "required": true, + "description": "应用归属的团队账号ID,可以通过获取应用简略信息接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section236517415165" + }, + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077#section886219295206" + } +] diff --git a/pkg/domain/reference/projects/queryprojectdetail.json b/pkg/domain/reference/projects/queryprojectdetail.json new file mode 100644 index 0000000..1ddd502 --- /dev/null +++ b/pkg/domain/reference/projects/queryprojectdetail.json @@ -0,0 +1,450 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#ZH-CN_TOPIC_0000001158365067__zh-cn_topic_0000001059897765_p16958125112238", + "title": "Project" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#ZH-CN_TOPIC_0000001158365067__zh-cn_topic_0000001059897765_p14226276613", + "title": "AppBriefInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#ZH-CN_TOPIC_0000001158365067__p999854164318", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108", + "title": "查询服务开通状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220", + "title": "查询项目列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section35551630174017", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section536103419362", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section49483413", + "text": "此接口用于查询指定项目的详细项目信息和项目下的应用列表信息。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section236517415165", + "text": "本接口支持使用Service Account方式和OAuth客户端方式,二者区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369", + "text": "Project" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369", + "text": "AppBriefInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369", + "text": "DeviceTypeInfo" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/project-service/v1/projects/{projectId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "projectId", + "M", + "String", + "需要查询的项目ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section35551630174017" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "queryFlag", + "O", + "String", + "是否需要查询项目下的应用信息。 0:不需要 1:需要 如果不传,默认值:0,响应参数中将不会返回appList。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "project", + "M", + "Project", + "项目信息。如果未查到项目信息,则返回空。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "projectId", + "O", + "String", + "项目ID" + ], + [ + "name", + "O", + "String", + "项目名称。" + ], + [ + "description", + "O", + "String", + "项目描述信息。" + ], + [ + "siteId", + "O", + "String", + "项目的数据存储位置。 SG:新加坡站点 DE:德国站点 RU:俄罗斯站点 CN:中国站点 如果项目未设置数据存储位置,则为空。" + ], + [ + "teamId", + "O", + "String", + "项目归属的团队账号ID。" + ], + [ + "appList", + "O", + "List", + "该项目下的应用列表信息。如果请求参数queryFlag传入0,则不返回此参数。" + ], + [ + "downloadKey", + "O", + "Integer", + "项目中是否下载密钥。 1:下载 0:不下载" + ], + [ + "createTime", + "O", + "Integer", + "项目创建时间的UTC时间戳。" + ], + [ + "updateTime", + "O", + "Integer", + "最近一次项目修改时间的UTC时间戳。" + ], + [ + "accessTime", + "O", + "Integer", + "开发者账号在AppGallery Connect控制台中最近一次访问项目的时间,格式为UTC时间戳。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "O", + "String", + "应用ID。" + ], + [ + "appName", + "O", + "String", + "应用名称。" + ], + [ + "appType", + "O", + "Integer", + "应用类型。 1:APK 2:RPK 3:WPK 4:EXE(云应用) 5:iOS应用 6:WEB应用" + ], + [ + "deviceType", + "O", + "Integer", + "设备类型。 4:手机 5:平板 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "detailType", + "O", + "Integer", + "应用的详细类型。 1:移动应用 2:电视应用 4:路由器应用 8:VR应用 9:手表应用 19:手机快应用 23:电视快应用 27:车机应用 28:车机快应用 9998:iOS应用 9999:WEB应用" + ], + [ + "appIcon", + "O", + "String", + "应用图标的URL地址。" + ], + [ + "packageName", + "O", + "String", + "应用包名。" + ], + [ + "hasPermission", + "O", + "Integer", + "当前开发者账号是否对应用有权限。 0:否 1:是" + ], + [ + "deviceTypes", + "O", + "List", + "应用的设备类型,可支持多个设备。" + ], + [ + "iosAppStoreId", + "O", + "String", + "应用在苹果APP Store上的ID,对iOS应用有效。" + ], + [ + "iosTeamId", + "O", + "String", + "iOS团队ID,对iOS应用有效。" + ], + [ + "parentType", + "O", + "Integer", + "应用的一级分类。 2:游戏 13:应用" + ], + [ + "childType", + "O", + "String", + "应用的二级分类,详细请参见应用分类。" + ], + [ + "grandChildType", + "O", + "String", + "应用的三级分类,详细请参见应用分类。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "appAdapters", + "M", + "String", + "适配设备类型,多个间逗号分隔。 1:荣耀立方(路由器) 4:手机 5:平板 6:VR 7:手表(智能表Android wear系统) 8:TV 9:路由器 11:儿童手表 12:智能手表 13:带屏音箱" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section1517418179369" + } + ], + "title": "查询项目详情及项目下的应用", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:36.578Z", + "family": "projects", + "endpoint": "queryprojectdetail" +} diff --git a/pkg/domain/reference/projects/queryprojectdetail.parameters.json b/pkg/domain/reference/projects/queryprojectdetail.parameters.json new file mode 100644 index 0000000..f8c0b47 --- /dev/null +++ b/pkg/domain/reference/projects/queryprojectdetail.parameters.json @@ -0,0 +1,22 @@ +[ + { + "name": "projectId", + "in": "path", + "type": "string", + "required": true, + "description": "需要查询的项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section35551630174017" + }, + { + "name": "queryFlag", + "in": "query", + "type": "string", + "required": false, + "description": "是否需要查询项目下的应用信息。 0:不需要 1:需要 如果不传,默认值:0,响应参数中将不会返回appList。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067#section886219295206", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference/projects/queryprojectlist.json b/pkg/domain/reference/projects/queryprojectlist.json new file mode 100644 index 0000000..bc5aa14 --- /dev/null +++ b/pkg/domain/reference/projects/queryprojectlist.json @@ -0,0 +1,450 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#ZH-CN_TOPIC_0000001111685220__zh-cn_topic_0000001060508129_p16958125112238", + "title": "Project" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#ZH-CN_TOPIC_0000001111685220__zh-cn_topic_0000001060508129_p14226276613", + "title": "AppBriefInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#ZH-CN_TOPIC_0000001111685220__p19821926104516", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067", + "title": "查询项目详情及项目下的应用" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-errorcode-0000001118183972", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section11563121420590", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section49483413", + "text": "此接口用于查询指定团队账号下的项目列表信息。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165", + "text": "本接口仅支持Service Account方式和OAuth客户端方式,二者区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314", + "text": "GetProjectListRsp" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314", + "text": "Project" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314", + "text": "AppBriefInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314", + "text": "DeviceTypeInfo" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/project-service/v1/projects" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "teamId", + "M", + "String", + "需要查询的团队账号ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fromPage", + "O", + "String", + "起始页,默认是1,表示从第1页开始查询。" + ], + [ + "pageSize", + "O", + "String", + "每页查询的条数,默认值:100。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "totalCount", + "M", + "Integer", + "项目的总个数。" + ], + [ + "returnCount", + "M", + "Integer", + "返回的项目个数。" + ], + [ + "projectList", + "O", + "List", + "项目列表信息。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "projectId", + "O", + "String", + "项目ID。" + ], + [ + "name", + "O", + "String", + "项目名称。" + ], + [ + "description", + "O", + "String", + "项目描述。" + ], + [ + "siteId", + "O", + "String", + "项目的数据存储位置。 SG:新加坡站点 DE:德国站点 RU:俄罗斯站点 CN:中国站点 如果项目未设置数据存储位置,则为空。" + ], + [ + "teamId", + "O", + "String", + "项目归属的团队账号ID。" + ], + [ + "appList", + "O", + "List", + "该项目下的应用列表信息。" + ], + [ + "createTime", + "O", + "Integer", + "项目创建时间。" + ], + [ + "updateTime", + "O", + "Integer", + "项目修改时间。" + ], + [ + "accessTime", + "O", + "Integer", + "项目访问时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "O", + "String", + "应用ID。" + ], + [ + "appName", + "O", + "String", + "应用名称。" + ], + [ + "appType", + "O", + "Integer", + "应用类型。 1:APK 2:RPK 3:WPK 4:EXE(云应用) 5:iOS应用 6:WEB应用" + ], + [ + "deviceType", + "O", + "Integer", + "设备类型。 4:手机 5:平板 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "detailType", + "O", + "Integer", + "应用的详细类型。 1:移动应用 2:电视应用 4:路由器应用 8:VR应用 9:手表应用 19:手机快应用 23:电视快应用 27:车机应用 28:车机快应用 9998:iOS应用 9999:WEB应用" + ], + [ + "appIcon", + "O", + "String", + "应用图标的URL地址。" + ], + [ + "packageName", + "O", + "String", + "应用包名。" + ], + [ + "hasPermission", + "O", + "Integer", + "当前开发者账号是否对应用有权限。 0:否 1:是" + ], + [ + "deviceTypes", + "O", + "List", + "应用的设备类型,可支持多个设备。" + ], + [ + "iosAppStoreId", + "O", + "String", + "应用在苹果APP Store上的ID,对iOS应用有效。" + ], + [ + "iosTeamId", + "O", + "String", + "iOS团队ID,对iOS应用有效。" + ], + [ + "parentType", + "O", + "Integer", + "应用的一级分类。 2:游戏 13:应用" + ], + [ + "childType", + "O", + "String", + "应用的二级分类,详细请参见应用分类。" + ], + [ + "grandChildType", + "O", + "String", + "应用的三级分类,详细请参见应用分类。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "appAdapters", + "M", + "String", + "适配设备类型,多个间逗号分隔。 1:荣耀立方(路由器) 4:手机 5:平板 6:VR 7:手表(智能表Android wear系统) 8:TV 9:路由器 11:儿童手表 12:智能手表 13:带屏音箱" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section184281720125314" + } + ], + "title": "查询项目列表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:37.663Z", + "family": "projects", + "endpoint": "queryprojectlist" +} diff --git a/pkg/domain/reference/projects/queryprojectlist.parameters.json b/pkg/domain/reference/projects/queryprojectlist.parameters.json new file mode 100644 index 0000000..f2e3f6f --- /dev/null +++ b/pkg/domain/reference/projects/queryprojectlist.parameters.json @@ -0,0 +1,26 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "需要查询的团队账号ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165" + }, + { + "name": "fromPage", + "in": "query", + "type": "string", + "required": false, + "description": "起始页,默认是1,表示从第1页开始查询。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section886219295206" + }, + { + "name": "pageSize", + "in": "query", + "type": "string", + "required": false, + "description": "每页查询的条数,默认值:100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section886219295206" + } +] diff --git a/pkg/domain/reference/projects/queryprojectlist.rules.json b/pkg/domain/reference/projects/queryprojectlist.rules.json new file mode 100644 index 0000000..b02083b --- /dev/null +++ b/pkg/domain/reference/projects/queryprojectlist.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectlist-0000001111685220#section236517415165", + "message": "teamId is required with OAuth authorization.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/projects/queryservice.json b/pkg/domain/reference/projects/queryservice.json new file mode 100644 index 0000000..a999d73 --- /dev/null +++ b/pkg/domain/reference/projects/queryservice.json @@ -0,0 +1,259 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmapi-0000001158245053", + "title": "Project Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appbriefinfo-0000001111845106", + "title": "获取应用简略信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#ZH-CN_TOPIC_0000001111845108__zh-cn_topic_0000001058910562_p16958125112238", + "title": "ServiceOrderAndApiStatus" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryappfingerprint-0000001158245077", + "title": "查询证书指纹和AppSecret" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryprojectdetail-0000001158365067", + "title": "查询项目详情及项目下的应用" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section4770825143714", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section026332842518", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section49483413", + "text": "此接口用于查询项目、应用开通的服务信息列表以及API的状态。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section236517415165", + "text": "本接口支持使用Service Account方式和OAuth客户端方式,二者区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section4770825143714", + "text": "ServiceOrderAndApiStatus" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/cpms/project-service/v1/services/order-api" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "projectId", + "M", + "String", + "应用所在的项目ID,可以通过获取应用简略信息接口获取。" + ], + [ + "appID", + "M", + "Integer", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "siteId", + "M", + "String", + "区域位置信息,当前取值为: SG:新加坡站点 DE:德国站点 RU:俄罗斯站点 CN:中国站点" + ], + [ + "serviceInfoList", + "M", + "ServiceOrderAndApiStatus[]", + "服务信息列表,包含所有服务的开通状态以及API开通状态。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section4770825143714" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "类型", + "参数说明" + ], + [ + "serviceName", + "String", + "服务名称。" + ], + [ + "serviceStatus", + "Integer", + "开通类型,取值范围: 0:正常开通 1:取消开通 2:恢复开通 3:无需在AppGallery Connect上开通" + ], + [ + "serviceDisplayName", + "String", + "AppGallery Connect展示的服务名称,包含中文和英文名称的JSON格式,例如{\"CN\":\"认证服务\",\"EN\":\"Auth Service\"}" + ], + [ + "apiName", + "String", + "API的名称。" + ], + [ + "apiStatus", + "Integer", + "API的开通状态。 0:关闭 1:开通" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section4770825143714" + } + ], + "title": "查询服务开通状态", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:38.722Z", + "family": "projects", + "endpoint": "queryservice" +} diff --git a/pkg/domain/reference/projects/queryservice.parameters.json b/pkg/domain/reference/projects/queryservice.parameters.json new file mode 100644 index 0000000..7df8f56 --- /dev/null +++ b/pkg/domain/reference/projects/queryservice.parameters.json @@ -0,0 +1,18 @@ +[ + { + "name": "projectId", + "in": "query", + "type": "string", + "required": true, + "description": "应用所在的项目ID,可以通过获取应用简略信息接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section886219295206" + }, + { + "name": "appID", + "in": "query", + "type": "integer", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-queryservice-0000001111845108#section886219295206" + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-add-device.json b/pkg/domain/reference/provisioning/provision-api-add-device.json new file mode 100644 index 0000000..2072ebc --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-add-device.json @@ -0,0 +1,296 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section3511106143614", + "text": "请求样例\nPOST /api/publish/v2/device HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"deviceList\": [\n {\n \"deviceName\": \"testDevice\",\n \"udid\": \"111111111222****************************************333333444444\",\n \"deviceType\": 1\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"successedCount\": 1,\n \"failedCount\": 0,\n \"failedAddDeviceDetail\": [\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "title": "AddDeviceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceresult-0000002271160641", + "title": "AddDeviceResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685", + "title": "删除证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306", + "title": "查询设备列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section3511106143614", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1177261917102", + "text": "此接口用于批量添加调试/测试设备。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/device" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceList", + "M", + "List", + "添加调试/测试设备的信息列表。 数组长度不超过1000。 说明 支持重新添加在过去一年内被删除的设备,只需输入新的deviceName,并输入原始的udid即可。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "successedCount", + "M", + "Integer(32)", + "添加成功的设备数量。" + ], + [ + "failedCount", + "M", + "Integer(32)", + "添加失败的设备数量。" + ], + [ + "failedAddDeviceDetail", + "O", + "List", + "添加失败的设备详情。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section44293557100" + } + ], + "title": "批量添加设备", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:26.284Z", + "family": "provisioning", + "endpoint": "provision-api-add-device" +} diff --git a/pkg/domain/reference/provisioning/provision-api-add-device.parameters.json b/pkg/domain/reference/provisioning/provision-api-add-device.parameters.json new file mode 100644 index 0000000..8b63b1c --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-add-device.parameters.json @@ -0,0 +1,57 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "maxLength": 64 + }, + { + "name": "deviceList", + "in": "body", + "type": "array", + "required": true, + "description": "添加调试/测试设备的信息列表。 数组长度不超过1000。 说明 支持重新添加在过去一年内被删除的设备,只需输入新的deviceName,并输入原始的udid即可。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section16551174881019", + "itemsType": "object", + "maxItems": 1000, + "itemsProperties": [ + { + "name": "deviceName", + "in": "body", + "type": "string", + "required": true, + "description": "设备名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "maxLength": 100 + }, + { + "name": "udid", + "in": "body", + "type": "string", + "required": true, + "description": "设备UDID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "maxLength": 64 + }, + { + "name": "deviceType", + "in": "body", + "type": "integer", + "required": true, + "description": "设备类型。 取值范围: 1:运动手表 2:智能手表 4:手机 5:平板 8:智慧屏 19:PC/2in1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "enum": [ + "1", + "2", + "4", + "5", + "8", + "19" + ] + } + ] + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-add-device.rules.json b/pkg/domain/reference/provisioning/provision-api-add-device.rules.json new file mode 100644 index 0000000..32e6411 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-add-device.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-device-0000002236041498#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-add-fingerprints.json b/pkg/domain/reference/provisioning/provision-api-add-fingerprints.json new file mode 100644 index 0000000..ca98e18 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-add-fingerprints.json @@ -0,0 +1,252 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section104718299345", + "text": "请求样例\nPOST /api/provision/v1/fingerprints HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1********57\n{\n \"fingerprintList\": [\n \"C47DC731DCFB59445230C24D8****C5C16C7995C674379ADE9E2A614497201B\",\n \"CF8588F671F26336AEBC86114****C2BDAB27C4426B3090FE36CA3A7ADDC4F25\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113", + "title": "查询已申请的受限ACL权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316", + "title": "查询证书指纹" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section104718299345", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section1177261917102", + "text": "此接口用于新增证书指纹。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/provision/v1/fingerprints" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fingerprintList", + "M", + "List", + "证书指纹列表。 最大长度50个。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section44293557100" + } + ], + "title": "新增证书指纹", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:27.746Z", + "family": "provisioning", + "endpoint": "provision-api-add-fingerprints" +} diff --git a/pkg/domain/reference/provisioning/provision-api-add-fingerprints.parameters.json b/pkg/domain/reference/provisioning/provision-api-add-fingerprints.parameters.json new file mode 100644 index 0000000..a9caae9 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-add-fingerprints.parameters.json @@ -0,0 +1,22 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section236517415165", + "maxLength": 32 + }, + { + "name": "fingerprintList", + "in": "body", + "type": "array", + "required": true, + "description": "证书指纹列表。 最大长度50个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-add-fingerprints-0000002431201480#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 128, + "maxItems": 50 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-apply-cent.json b/pkg/domain/reference/provisioning/provision-api-apply-cent.json new file mode 100644 index 0000000..8ecaae7 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-apply-cent.json @@ -0,0 +1,292 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section104718299345", + "text": "请求样例\nPOST /api/publish/v3/cert HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"csr\": \"-----BEGIN NEW CERTIFICATE REQUEST-----****-----END NEW CERTIFICATE REQUEST-----\",\n \"certName\": \"test\",\n \"certType\": 1\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"certInfo\": {\n \"id\": \"14***************72\",\n \"certName\": \"test\",\n \"certType\": 1,\n \"createTime\": 1844593505000,\n \"expireTime\": 1718363106749,\n \"certDownloadUrl\": \"https://****de0d.cer?X-Amz-Algorithm=****\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-certinfo-0000002236041510", + "title": "CertInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629", + "title": "查询证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section104718299345", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1177261917102", + "text": "此接口用于申请二进制证书、In-house发布证书、调试证书或发布证书。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/cert" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "csr", + "M", + "String(2048)", + "证书的CSR。" + ], + [ + "certName", + "M", + "String(100)", + "证书名称。" + ], + [ + "certType", + "M", + "Integer(32)", + "证书类型。 取值范围: 1:调试 2:发布 3:In-house发布 4:二进制证书(用于二进制程序签名) 说明 二进制证书目前为受限开放,如需体验可通过在线工单系统与我们联系。 工单“问题分类”请选择“AppGallery Connect > 证书、APP ID和Profile > 证书”,并在“问题描述”中提供如下信息: 企业名称与资质 应用名称及APP ID 应用的业务场景与用途 申请的证书类型:二进制证书" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "certInfo", + "O", + "CertInfo", + "证书信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section44293557100" + } + ], + "title": "申请证书", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:29.169Z", + "family": "provisioning", + "endpoint": "provision-api-apply-cent" +} diff --git a/pkg/domain/reference/provisioning/provision-api-apply-cent.parameters.json b/pkg/domain/reference/provisioning/provision-api-apply-cent.parameters.json new file mode 100644 index 0000000..275adeb --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-apply-cent.parameters.json @@ -0,0 +1,43 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "maxLength": 64 + }, + { + "name": "csr", + "in": "body", + "type": "string", + "required": true, + "description": "证书的CSR。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019", + "maxLength": 2048 + }, + { + "name": "certName", + "in": "body", + "type": "string", + "required": true, + "description": "证书名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019", + "maxLength": 100 + }, + { + "name": "certType", + "in": "body", + "type": "integer", + "required": true, + "description": "证书类型。 取值范围: 1:调试 2:发布 3:In-house发布 4:二进制证书(用于二进制程序签名) 说明 二进制证书目前为受限开放,如需体验可通过在线工单系统与我们联系。 工单“问题分类”请选择“AppGallery Connect > 证书、APP ID和Profile > 证书”,并在“问题描述”中提供如下信息: 企业名称与资质 应用名称及APP ID 应用的业务场景与用途 申请的证书类型:二进制证书", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section16551174881019", + "enum": [ + "1", + "2", + "3", + "4" + ] + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-apply-cent.rules.json b/pkg/domain/reference/provisioning/provision-api-apply-cent.rules.json new file mode 100644 index 0000000..1b804ad --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-apply-cent.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-cent-0000002236201302#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-apply-provision.json b/pkg/domain/reference/provisioning/provision-api-apply-provision.json new file mode 100644 index 0000000..476e57c --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-apply-provision.json @@ -0,0 +1,318 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section536473017364", + "text": "请求样例\nPOST /api/publish/v3/provision HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"provisionName\": \"testProvision\",\n \"provisionType\": 1,\n \"certId\": \"34******28\",\n \"appId\": \"69****117\",\n \"deviceIdList\": [\n \"14****208\"\n ],\n \"aclPermissionList\": [\n \"\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"provisionInfo\": {\n \"id\": \"14***************04\",\n \"provisionName\": \"testProvision\",\n \"provisionType\": 1,\n \"certName\": \"0614-debug\",\n \"deviceList\": [\n {\n \"id\": \"14***************80\",\n \"deviceName\": \"de******me\",\n \"udid\": \"111111111222****************************************333333444444\",\n \"deviceType\": 1,\n \"createTime\": \"2024-06-14 11:55:28.676\"\n }\n ],\n \"aclPermissionList\": [\n \"\"\n ],\n \"aclPermissionAuditState\": 0,\n \"provisionDownloadUrl\": \"https://****/CN/2024061412/1718367940748-6ef9436f-6cd0-4b65-a1df-62174c795b40.p7b?X-Amz-Algorithm=****\",\n \"updateTime\": 1718363106749,\n \"expireTime\": 1844598288000,\n \"appId\": \"69****117\",\n \"tempFlag\": \"0\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306", + "title": "查询设备列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721", + "title": "申请受限ACL权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-provisioninfo-0000002236041514", + "title": "ProvisionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633", + "title": "删除设备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506", + "title": "查询Profile列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section536473017364", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1177261917102", + "text": "此接口用于申请指定设备发布Profile、In-house发布Profile、调试Profile或发布Profile。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/provision" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "provisionName", + "M", + "String(256)", + "Profile名称。" + ], + [ + "provisionType", + "M", + "Integer(32)", + "Profile类型。 取值范围: 1:调试 2:发布 3:In-house发布 6:指定设备发布" + ], + [ + "certId", + "M", + "String(32)", + "证书ID。" + ], + [ + "appId", + "M", + "String(20)", + "应用ID。" + ], + [ + "deviceIdList", + "O", + "List", + "调试/测试设备ID列表。 可通过查询设备列表接口获取。 数组长度不超过4000。" + ], + [ + "aclPermissionList", + "O", + "List", + "受限ACL权限列表。 数组长度不超过1000。 说明 仅支持受限ACL权限已审核通过的应用使用,申请方式可参见申请受限ACL权限。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "provisionInfo", + "O", + "ProvisionInfo", + "Profile信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section44293557100" + } + ], + "title": "申请Profile", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:31.554Z", + "family": "provisioning", + "endpoint": "provision-api-apply-provision" +} diff --git a/pkg/domain/reference/provisioning/provision-api-apply-provision.parameters.json b/pkg/domain/reference/provisioning/provision-api-apply-provision.parameters.json new file mode 100644 index 0000000..2a0b199 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-apply-provision.parameters.json @@ -0,0 +1,74 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "maxLength": 64 + }, + { + "name": "provisionName", + "in": "body", + "type": "string", + "required": true, + "description": "Profile名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxLength": 256 + }, + { + "name": "provisionType", + "in": "body", + "type": "integer", + "required": true, + "description": "Profile类型。 取值范围: 1:调试 2:发布 3:In-house发布 6:指定设备发布", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "enum": [ + "1", + "2", + "3", + "6" + ] + }, + { + "name": "certId", + "in": "body", + "type": "string", + "required": true, + "description": "证书ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxLength": 32 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "maxLength": 20 + }, + { + "name": "deviceIdList", + "in": "body", + "type": "array", + "required": false, + "description": "调试/测试设备ID列表。 可通过查询设备列表接口获取。 数组长度不超过4000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 32, + "maxItems": 4000 + }, + { + "name": "aclPermissionList", + "in": "body", + "type": "array", + "required": false, + "description": "受限ACL权限列表。 数组长度不超过1000。 说明 仅支持受限ACL权限已审核通过的应用使用,申请方式可参见申请受限ACL权限。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 256, + "maxItems": 1000 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-apply-provision.rules.json b/pkg/domain/reference/provisioning/provision-api-apply-provision.rules.json new file mode 100644 index 0000000..e75aeca --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-apply-provision.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-apply-provision-0000002271000689#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-applyacl.json b/pkg/domain/reference/provisioning/provision-api-applyacl.json new file mode 100644 index 0000000..2e11b4f --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-applyacl.json @@ -0,0 +1,274 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section1067322214331", + "text": "请求示例\nPOST /api/provision/v1/user/permission/apply HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"attachment\": \"CN/2025102002/********.app\",\n \"aclPermissionList\": [\n {\n \"name\": \"ohos.permission.********\",\n \"reason\": \"因为需要***所以需要**权限\"\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756", + "title": "OpenApplyPermissionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044", + "title": "查询可申请的ACL权限列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150", + "title": "查询受限ACL权限的申请状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section992664711544", + "text": "此接口用于申请受限ACL权限。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/provision/v1/user/permission/apply" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "attachment", + "O", + "String", + "附件的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ], + [ + "aclPermissionList", + "M", + "OpenApplyPermissionInfo", + "受限ACL权限申请列表。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section163825114565" + } + ], + "title": "申请受限ACL权限", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:33.033Z", + "family": "provisioning", + "endpoint": "provision-api-applyacl" +} diff --git a/pkg/domain/reference/provisioning/provision-api-applyacl.parameters.json b/pkg/domain/reference/provisioning/provision-api-applyacl.parameters.json new file mode 100644 index 0000000..2bed0be --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-applyacl.parameters.json @@ -0,0 +1,48 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section236517415165", + "maxLength": 32 + }, + { + "name": "attachment", + "in": "body", + "type": "string", + "required": false, + "description": "附件的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section16551174881019" + }, + { + "name": "aclPermissionList", + "in": "body", + "type": "array", + "required": true, + "description": "受限ACL权限申请列表。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-applyacl-0000002502198721#section16551174881019", + "itemsType": "object", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "type": "string", + "required": true, + "description": "受限ACL权限名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756", + "maxLength": 256 + }, + { + "name": "reason", + "in": "body", + "type": "string", + "required": true, + "description": "受限ACL权限的申请理由。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756", + "maxLength": 256 + } + ] + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-delete-cent.json b/pkg/domain/reference/provisioning/provision-api-delete-cent.json new file mode 100644 index 0000000..5ea32d1 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-cent.json @@ -0,0 +1,270 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section57681057163514", + "text": "请求样例\nPOST /api/publish/v2/cert/delete HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"certIds\": [\n \"1443604834804035072\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629", + "title": "查询证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498", + "title": "批量添加设备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section57681057163514", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1177261917102", + "text": "此接口用于删除创建的证书。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/cert/delete" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "certIds", + "M", + "List", + "证书ID列表。 数组长度为1~100。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section44293557100" + } + ], + "title": "删除证书", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:34.515Z", + "family": "provisioning", + "endpoint": "provision-api-delete-cent" +} diff --git a/pkg/domain/reference/provisioning/provision-api-delete-cent.parameters.json b/pkg/domain/reference/provisioning/provision-api-delete-cent.parameters.json new file mode 100644 index 0000000..6b07c14 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-cent.parameters.json @@ -0,0 +1,23 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "maxLength": 64 + }, + { + "name": "certIds", + "in": "body", + "type": "array", + "required": true, + "description": "证书ID列表。 数组长度为1~100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 32, + "minItems": 1, + "maxItems": 100 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-delete-cent.rules.json b/pkg/domain/reference/provisioning/provision-api-delete-cent.rules.json new file mode 100644 index 0000000..4d04639 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-cent.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-cent-0000002271000685#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-delete-device.json b/pkg/domain/reference/provisioning/provision-api-delete-device.json new file mode 100644 index 0000000..25f70d4 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-device.json @@ -0,0 +1,270 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section181211234366", + "text": "请求样例\nPOST /api/publish/v2/device/delete HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"deviceIdList\": [\n \"14**********80\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306", + "title": "查询设备列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689", + "title": "申请Profile" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section181211234366", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1177261917102", + "text": "此接口用于删除已添加的设备。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/device/delete" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceIdList", + "M", + "List", + "待删除的设备ID列表。 数组长度不超过1000。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section44293557100" + } + ], + "title": "删除设备", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:36.151Z", + "family": "provisioning", + "endpoint": "provision-api-delete-device" +} diff --git a/pkg/domain/reference/provisioning/provision-api-delete-device.parameters.json b/pkg/domain/reference/provisioning/provision-api-delete-device.parameters.json new file mode 100644 index 0000000..a6a048b --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-device.parameters.json @@ -0,0 +1,22 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "maxLength": 64 + }, + { + "name": "deviceIdList", + "in": "body", + "type": "array", + "required": true, + "description": "待删除的设备ID列表。 数组长度不超过1000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 32, + "maxItems": 1000 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-delete-device.rules.json b/pkg/domain/reference/provisioning/provision-api-delete-device.rules.json new file mode 100644 index 0000000..a7b1a06 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-device.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-device-0000002271160633#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-delete-fingerprints.json b/pkg/domain/reference/provisioning/provision-api-delete-fingerprints.json new file mode 100644 index 0000000..a42ca59 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-fingerprints.json @@ -0,0 +1,252 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section104718299345", + "text": "请求样例\nDELETE /api/provision/v1/fingerprints HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1********57\n{\n \"fingerprintList\": [\n \"C47DC731DCFB59445230C24D8****C5C16C7995C674379ADE9E2A614497201B\",\n \"CF8588F671F26336AEBC86114****C2BDAB27C4426B3090FE36CA3A7ADDC4F25\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316", + "title": "查询证书指纹" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-0000002271160637", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section104718299345", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section1177261917102", + "text": "此接口用于删除证书指纹。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/provision/v1/fingerprints" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fingerprintList", + "M", + "List", + "证书指纹列表。 最大长度50个。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section44293557100" + } + ], + "title": "删除证书指纹", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:38.114Z", + "family": "provisioning", + "endpoint": "provision-api-delete-fingerprints" +} diff --git a/pkg/domain/reference/provisioning/provision-api-delete-fingerprints.parameters.json b/pkg/domain/reference/provisioning/provision-api-delete-fingerprints.parameters.json new file mode 100644 index 0000000..4578d67 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-fingerprints.parameters.json @@ -0,0 +1,22 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section236517415165", + "maxLength": 32 + }, + { + "name": "fingerprintList", + "in": "body", + "type": "array", + "required": true, + "description": "证书指纹列表。 最大长度50个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-fingerprints-0000002464839925#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 128, + "maxItems": 50 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-delete-provision.json b/pkg/domain/reference/provisioning/provision-api-delete-provision.json new file mode 100644 index 0000000..f9e6760 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-provision.json @@ -0,0 +1,270 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1760574810364", + "text": "请求样例\nDELETE /api/publish/v2/provision?id=10******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer *******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766", + "title": "修改Profile绑定的设备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044", + "title": "查询可申请的ACL权限列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section16551174881019", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section1760574810364", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1177261917102", + "text": "此接口用于删除申请的Profile。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/provision" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "M", + "String(32)", + "待删除Profile的ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section44293557100" + } + ], + "title": "删除Profile", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:39.600Z", + "family": "provisioning", + "endpoint": "provision-api-delete-provision" +} diff --git a/pkg/domain/reference/provisioning/provision-api-delete-provision.parameters.json b/pkg/domain/reference/provisioning/provision-api-delete-provision.parameters.json new file mode 100644 index 0000000..79a4468 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-provision.parameters.json @@ -0,0 +1,20 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "maxLength": 64 + }, + { + "name": "id", + "in": "query", + "type": "string", + "required": true, + "description": "待删除Profile的ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section16551174881019", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-delete-provision.rules.json b/pkg/domain/reference/provisioning/provision-api-delete-provision.rules.json new file mode 100644 index 0000000..c5090ec --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-delete-provision.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-delete-provision-0000002236201310#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-eligible-acl.json b/pkg/domain/reference/provisioning/provision-api-eligible-acl.json new file mode 100644 index 0000000..2586eee --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-eligible-acl.json @@ -0,0 +1,285 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section1849181410211", + "text": "请求示例\nPOST /api/provision/v1/user/permission/apply/list HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"lang\": \"zh\",\n \"start\": 1,\n \"pageSize\": 10\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section94914141220", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"OK\"\n },\n \"totalCount\": 1,\n \"permissionList\": [\n {\n \"id\": \"24*********75\",\n \"permissionName\": \"ohos.permission.******\",\n \"apl\": \"system_basic\",\n \"grantType\": \"system_grant\",\n \"supportDevice\": [\n \"PC/2in1\"\n ],\n \"startApiVersion\": \"22\",\n \"permissionLanguages\": [\n {\n \"language\": \"zh\",\n \"desc\": \"允许应用****\"\n }\n ]\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-permission-0000002585695085", + "title": "Permission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310", + "title": "删除Profile" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721", + "title": "申请受限ACL权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section3481414422", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section44815141222", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section1849181410211", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section15496141721", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-eligible-acl-0000002554975044#section94914141220", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section992664711544", + "text": "此接口用于查询指定APP ID下所有可申请的ACL权限列表。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、开发。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/provision/v1/user/permission/apply/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section3481414422" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "O", + "String(10)", + "ACL权限的语言类型。 取值范围: zh:中文 en:英文 ru:俄语 默认值:zh" + ], + [ + "start", + "O", + "Integer", + "起始页。 最小值:1,表示从第1页开始查询。 默认值:1" + ], + [ + "pageSize", + "O", + "Integer", + "每页返回条数。 取值范围:[1,1000] 默认值:10" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "totalCount", + "O", + "Integer(32)", + "总记录条数。" + ], + [ + "permissionList", + "O", + "List", + "ACL权限信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section15496141721" + } + ], + "title": "查询可申请的ACL权限列表", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:53:41.036Z", + "family": "provisioning", + "endpoint": "provision-api-eligible-acl" +} diff --git a/pkg/domain/reference/provisioning/provision-api-eligible-acl.parameters.json b/pkg/domain/reference/provisioning/provision-api-eligible-acl.parameters.json new file mode 100644 index 0000000..0e56d44 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-eligible-acl.parameters.json @@ -0,0 +1,44 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section236517415165", + "maxLength": 32 + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": false, + "description": "ACL权限的语言类型。 取值范围: zh:中文 en:英文 ru:俄语 默认值:zh", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019", + "maxLength": 10, + "enum": [ + "zh", + "en", + "ru" + ] + }, + { + "name": "start", + "in": "body", + "type": "integer", + "required": false, + "description": "起始页。 最小值:1,表示从第1页开始查询。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019", + "minimum": 1 + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "每页返回条数。 取值范围:[1,1000] 默认值:10", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-eligible-acl-0000002554975044#section16551174881019", + "minimum": 1, + "maximum": 1000 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-get-fingerprints.json b/pkg/domain/reference/provisioning/provision-api-get-fingerprints.json new file mode 100644 index 0000000..00448d0 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-get-fingerprints.json @@ -0,0 +1,235 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section158711929153511", + "text": "请求样例\nGET /api/provision/v1/fingerprints HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1********57" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"fingerprintList\": [\n \"C47DC731DCFB59445230C24D8****C5C16C7995C674379ADE9E2A614497201B\",\n \"CF8588F671F26336AEBC86114****C2BDAB27C4426B3090FE36CA3A7ADDC4F25\"\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480", + "title": "新增证书指纹" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-fingerprints-0000002464839925", + "title": "删除证书指纹" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316#section158711929153511", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-get-fingerprints-0000002431361316#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section1177261917102", + "text": "此接口用于查询已创建的证书指纹。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/provision/v1/fingerprints" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "fingerprintList", + "M", + "List", + "证书指纹列表。 最大长度50个。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section44293557100" + } + ], + "title": "查询证书指纹", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:06.350Z", + "family": "provisioning", + "endpoint": "provision-api-get-fingerprints" +} diff --git a/pkg/domain/reference/provisioning/provision-api-get-fingerprints.parameters.json b/pkg/domain/reference/provisioning/provision-api-get-fingerprints.parameters.json new file mode 100644 index 0000000..08bf289 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-get-fingerprints.parameters.json @@ -0,0 +1,11 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-get-fingerprints-0000002431361316#section236517415165", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-getacl.json b/pkg/domain/reference/provisioning/provision-api-getacl.json new file mode 100644 index 0000000..ab82606 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-getacl.json @@ -0,0 +1,248 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section1067322214331", + "text": "请求示例\nGET /api/provision/v1/user/permission HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"userPermission\": {\n \"aclPermissionList\": \"**********\",\n \"createTime\": 17*********21,\n \"updateTime\": 17*********31\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721", + "title": "申请受限ACL权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-userpermission-0000002466197781", + "title": "UserPermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150", + "title": "查询受限ACL权限的申请状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-fingerprints-0000002431201480", + "title": "新增证书指纹" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section992664711544", + "text": "此接口用于查询申请的受限ACL权限信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section992664711544", + "text": "仅支持受限ACL权限已审核通过的应用使用,申请方式可参见申请受限ACL权限。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/provision/v1/user/permission" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section236517415165" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "userPermission", + "O", + "UserPermission", + "受限ACL权限信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section163825114565" + } + ], + "title": "查询已申请的受限ACL权限", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:07.685Z", + "family": "provisioning", + "endpoint": "provision-api-getacl" +} diff --git a/pkg/domain/reference/provisioning/provision-api-getacl.parameters.json b/pkg/domain/reference/provisioning/provision-api-getacl.parameters.json new file mode 100644 index 0000000..134d733 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-getacl.parameters.json @@ -0,0 +1,11 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getacl-0000002465770113#section236517415165", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-getaclapplystatus.json b/pkg/domain/reference/provisioning/provision-api-getaclapplystatus.json new file mode 100644 index 0000000..fff82c2 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-getaclapplystatus.json @@ -0,0 +1,238 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section1067322214331", + "text": "请求示例\nGET /api/provision/v1/user/permission/apply/status HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section9801143143518", + "text": "响应示例\n{\n \"aclPermissionList\": [\n {\n \"name\": \"ohos.permission.********\",\n \"status\": 0\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721", + "title": "申请受限ACL权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissionstatus-0000002502126131", + "title": "OpenApplyPermissionStatusInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-applyacl-0000002502198721", + "title": "申请受限ACL权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getacl-0000002465770113", + "title": "查询已申请的受限ACL权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-getaclapplystatus-0000002469246150#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section992664711544", + "text": "此接口用于查询受限ACL权限的申请状态,包含“申请中”和“审核通过”。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section992664711544", + "text": "申请方式可参见申请受限ACL权限。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/provision/v1/user/permission/apply/status" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "aclPermissionList", + "O", + "OpenApplyPermissionStatusInfo", + "受限ACL权限的申请状态列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section163825114565" + } + ], + "title": "查询受限ACL权限的申请状态", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:09.046Z", + "family": "provisioning", + "endpoint": "provision-api-getaclapplystatus" +} diff --git a/pkg/domain/reference/provisioning/provision-api-getaclapplystatus.parameters.json b/pkg/domain/reference/provisioning/provision-api-getaclapplystatus.parameters.json new file mode 100644 index 0000000..2c68647 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-getaclapplystatus.parameters.json @@ -0,0 +1,11 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-getaclapplystatus-0000002469246150#section236517415165", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-query-cent.json b/pkg/domain/reference/provisioning/provision-api-query-cent.json new file mode 100644 index 0000000..18b42c9 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-cent.json @@ -0,0 +1,286 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section158711929153511", + "text": "请求样例\nPOST /api/publish/v3/cert/list HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"certType\": 1,\n \"certIds\": [\n \"1443604834804035072\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"certList\": [\n {\n \"id\": \"14***************72\",\n \"certName\": \"test\",\n \"certType\": 1,\n \"createTime\": 1844593505000,\n \"expireTime\": 1718363106749,\n \"certDownloadUrl\": \"https://****de0d.cer?X-Amz-Algorithm=****\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-certinfo-0000002236041510", + "title": "CertInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-cent-0000002236201302", + "title": "申请证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-cent-0000002271000685", + "title": "删除证书" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section158711929153511", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-cent-0000002271160629#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1177261917102", + "text": "此接口用于查询创建的证书。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/cert/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "certType", + "O", + "Integer(32)", + "证书类型。 取值范围: 1:调试 2:发布 3:In-house发布 4:二进制证书(用于二进制程序签名)" + ], + [ + "certIds", + "O", + "List", + "证书ID列表。 数组长度为1~100。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "certInfo", + "O", + "List", + "证书信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section44293557100" + } + ], + "title": "查询证书", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:10.537Z", + "family": "provisioning", + "endpoint": "provision-api-query-cent" +} diff --git a/pkg/domain/reference/provisioning/provision-api-query-cent.parameters.json b/pkg/domain/reference/provisioning/provision-api-query-cent.parameters.json new file mode 100644 index 0000000..6fdaabf --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-cent.parameters.json @@ -0,0 +1,37 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "maxLength": 64 + }, + { + "name": "certType", + "in": "body", + "type": "integer", + "required": false, + "description": "证书类型。 取值范围: 1:调试 2:发布 3:In-house发布 4:二进制证书(用于二进制程序签名)", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section16551174881019", + "enum": [ + "1", + "2", + "3", + "4" + ] + }, + { + "name": "certIds", + "in": "body", + "type": "array", + "required": false, + "description": "证书ID列表。 数组长度为1~100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 32, + "minItems": 1, + "maxItems": 100 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-query-cent.rules.json b/pkg/domain/reference/provisioning/provision-api-query-cent.rules.json new file mode 100644 index 0000000..4dcb558 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-cent.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-cent-0000002271160629#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-query-device.json b/pkg/domain/reference/provisioning/provision-api-query-device.json new file mode 100644 index 0000000..1586ef9 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-device.json @@ -0,0 +1,304 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section6119151743611", + "text": "请求样例\nGET /api/publish/v2/device/list?deviceName=testDevice HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"deviceList\": [\n {\n \"id\": \"14***************80\",\n \"deviceName\": \"testDevice\"\n \"udid\": \"111111111222****************************************333333444444\",\n \"deviceType\": 1,\n \"createTime\": \"2024-06-14 11:55:28.676\",\n }\n ],\n \"totalCount\": 1\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-deviceinfo-0000002271000697", + "title": "DeviceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-add-device-0000002236041498", + "title": "批量添加设备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-device-0000002271160633", + "title": "删除设备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section6119151743611", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1177261917102", + "text": "此接口用于查询当前设备的信息。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/device/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceName", + "O", + "String(256)", + "设备名称。 支持模糊查询。" + ], + [ + "fromRecCount", + "O", + "Integer(32)", + "起始页数。 取值范围:最小为1 默认值:1" + ], + [ + "maxReqCount", + "O", + "Integer(32)", + "每页返回条数。 取值范围:[1,100] 默认值:20" + ], + [ + "order", + "O", + "Integer(32)", + "返回的结果排序方式。 取值范围: 1:创建时间降序 2:设备名称升序" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "totalCount", + "M", + "Integer(32)", + "总记录条数。" + ], + [ + "deviceList", + "O", + "List", + "设备详情。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section44293557100" + } + ], + "title": "查询设备列表", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:12.058Z", + "family": "provisioning", + "endpoint": "provision-api-query-device" +} diff --git a/pkg/domain/reference/provisioning/provision-api-query-device.parameters.json b/pkg/domain/reference/provisioning/provision-api-query-device.parameters.json new file mode 100644 index 0000000..b035cc9 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-device.parameters.json @@ -0,0 +1,51 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "maxLength": 64 + }, + { + "name": "deviceName", + "in": "query", + "type": "string", + "required": false, + "description": "设备名称。 支持模糊查询。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "maxLength": 256 + }, + { + "name": "fromRecCount", + "in": "query", + "type": "integer", + "required": false, + "description": "起始页数。 取值范围:最小为1 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "minimum": 1 + }, + { + "name": "maxReqCount", + "in": "query", + "type": "integer", + "required": false, + "description": "每页返回条数。 取值范围:[1,100] 默认值:20", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "minimum": 1, + "maximum": 100 + }, + { + "name": "order", + "in": "query", + "type": "integer", + "required": false, + "description": "返回的结果排序方式。 取值范围: 1:创建时间降序 2:设备名称升序", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section16551174881019", + "enum": [ + "1", + "2" + ] + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-query-device.rules.json b/pkg/domain/reference/provisioning/provision-api-query-device.rules.json new file mode 100644 index 0000000..6e3a114 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-device.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-device-0000002236201306#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-query-provision.json b/pkg/domain/reference/provisioning/provision-api-query-provision.json new file mode 100644 index 0000000..5acc7b4 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-provision.json @@ -0,0 +1,340 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section158441741193612", + "text": "请求样例\nGET /api/publish/v3/provision/list?fromRecCount=1&maxReqCount=100 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 691****117\nprovisionId: 1443****504" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"totalCount\": 0,\n \"provisionList\": [\n {\n \"id\": \"14***************04\",\n \"provisionName\": \"testProvision\",\n \"provisionType\": 1,\n \"certName\": \"0614-debug\",\n \"deviceList\": [\n {\n \"id\": \"14***************80\",\n \"deviceName\": \"de******me\",\n \"udid\": \"111111111222****************************************333333444444\",\n \"deviceType\": 1,\n \"createTime\": \"2024-06-14 11:55:28.676\"\n }\n ],\n \"aclPermissionList\": [\n \"\"\n ],\n \"aclPermissionAuditState\": 0,\n \"provisionDownloadUrl\": \"https://****/CN/2024061412/1718367940748-6ef9436f-6cd0-4b65-a1df-62174c795b40.p7b?X-Amz-Algorithm=****\",\n \"updateTime\": 1718363106749,\n \"expireTime\": 1844598288000,\n \"appId\": \"69****117\",\n \"tempFlag\": \"0\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-provisioninfo-0000002236041514", + "title": "ProvisionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-apply-provision-0000002271000689", + "title": "申请Profile" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766", + "title": "修改Profile绑定的设备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section16551174881019", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section158441741193612", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506#section631918718113", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1177261917102", + "text": "此接口用于查询申请的Profile。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/provision/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ], + [ + "provisionId", + "O", + "String", + "Profile的ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ], + [ + "provisionId", + "O", + "String", + "Profile的ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ], + [ + "provisionId", + "O", + "String", + "Profile的ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fromRecCount", + "O", + "Integer(32)", + "起始页数。 默认值:1" + ], + [ + "maxReqCount", + "O", + "Integer(32)", + "每页返回条数。 取值范围:[1,100] 默认值:10" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "totalCount", + "O", + "Integer(32)", + "总记录条数。" + ], + [ + "provisionList", + "O", + "List", + "Profile信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section44293557100" + } + ], + "title": "查询Profile列表", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:13.513Z", + "family": "provisioning", + "endpoint": "provision-api-query-provision" +} diff --git a/pkg/domain/reference/provisioning/provision-api-query-provision.parameters.json b/pkg/domain/reference/provisioning/provision-api-query-provision.parameters.json new file mode 100644 index 0000000..46a7c58 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-provision.parameters.json @@ -0,0 +1,46 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "maxLength": 32 + }, + { + "name": "provisionId", + "in": "header", + "type": "string", + "required": false, + "description": "Profile的ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015" + }, + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "maxLength": 64 + }, + { + "name": "fromRecCount", + "in": "query", + "type": "integer", + "required": false, + "description": "起始页数。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section16551174881019" + }, + { + "name": "maxReqCount", + "in": "query", + "type": "integer", + "required": false, + "description": "每页返回条数。 取值范围:[1,100] 默认值:10", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section16551174881019", + "minimum": 1, + "maximum": 100 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-query-provision.rules.json b/pkg/domain/reference/provisioning/provision-api-query-provision.rules.json new file mode 100644 index 0000000..b689a95 --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-query-provision.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-query-provision-0000002236041506#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-update-provision.json b/pkg/domain/reference/provisioning/provision-api-update-provision.json new file mode 100644 index 0000000..a24fccf --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-update-provision.json @@ -0,0 +1,291 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section536473017364", + "text": "请求样例\nPUT /api/publish/v3/provision HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"provisionId\": \"1443****504\",\n \"deviceIdList\": [\n \"14****208\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"provisionInfo\": {\n \"id\": \"14***************04\",\n \"provisionName\": \"testProvision\",\n \"provisionType\": 1,\n \"certName\": \"0614-debug\",\n \"deviceList\": [\n {\n \"id\": \"14***************80\",\n \"deviceName\": \"de******me\",\n \"udid\": \"111111111222****************************************333333444444\",\n \"deviceType\": 1,\n \"createTime\": \"2024-06-14 11:55:28.676\"\n }\n ],\n \"aclPermissionList\": [\n \"\"\n ],\n \"aclPermissionAuditState\": 0,\n \"provisionDownloadUrl\": \"https://****/CN/2024061412/1718367940748-6ef9436f-6cd0-4b65-a1df-62174c795b40.p7b?X-Amz-Algorithm=****\",\n \"updateTime\": 1718363106749,\n \"expireTime\": 1844598288000,\n \"appId\": \"69****117\",\n \"tempFlag\": \"0\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-device-0000002236201306", + "title": "查询设备列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-connectret-0000002271000693", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-provisioninfo-0000002236041514", + "title": "ProvisionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-query-provision-0000002236041506", + "title": "查询Profile列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-delete-provision-0000002236201310", + "title": "删除Profile" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section536473017364", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-update-provision-0000002469198766#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1177261917102", + "text": "此接口用于修改调试Profile绑定的调试设备,或者修改指定设备发布Profile绑定的测试设备。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1177261917102", + "text": "调试Profile/指定设备发布Profile必须是“生效”状态才支持修改设备。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/provision" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section112981825101019" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "provisionId", + "M", + "String(32)", + "Profile的ID。" + ], + [ + "deviceIdList", + "M", + "List", + "调试/测试设备ID列表。 可通过查询设备列表接口获取。 数组长度不超过4000。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "provisionInfo", + "O", + "ProvisionInfo", + "调试Profile/指定设备发布Profile信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section44293557100" + } + ], + "title": "修改Profile绑定的设备", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:14.683Z", + "family": "provisioning", + "endpoint": "provision-api-update-provision" +} diff --git a/pkg/domain/reference/provisioning/provision-api-update-provision.parameters.json b/pkg/domain/reference/provisioning/provision-api-update-provision.parameters.json new file mode 100644 index 0000000..826387e --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-update-provision.parameters.json @@ -0,0 +1,31 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "maxLength": 64 + }, + { + "name": "provisionId", + "in": "body", + "type": "string", + "required": true, + "description": "Profile的ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section16551174881019", + "maxLength": 32 + }, + { + "name": "deviceIdList", + "in": "body", + "type": "array", + "required": true, + "description": "调试/测试设备ID列表。 可通过查询设备列表接口获取。 数组长度不超过4000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section16551174881019", + "itemsType": "string", + "itemsMaxLength": 32, + "maxItems": 4000 + } +] diff --git a/pkg/domain/reference/provisioning/provision-api-update-provision.rules.json b/pkg/domain/reference/provisioning/provision-api-update-provision.rules.json new file mode 100644 index 0000000..460b1ac --- /dev/null +++ b/pkg/domain/reference/provisioning/provision-api-update-provision.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-provision-api-update-provision-0000002469198766#section1323714041015", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/add-packageurl.json b/pkg/domain/reference/publishing/add-packageurl.json new file mode 100644 index 0000000..cee3032 --- /dev/null +++ b/pkg/domain/reference/publishing/add-packageurl.json @@ -0,0 +1,312 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-notify-release-0000001158245063", + "title": "回调结果通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-notify-release-0000001158245063", + "title": "回调结果通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section39581727", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section133mcpsimp", + "title": "接口约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section164139546428", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section60996746", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section311913164588", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section39581727", + "text": "如果您将软件包保存在自己的服务器上,可以直接调用本接口将软件包提交到AppGallery Connect服务器。华为服务器会自动从下载地址中下载软件包后提交,不会关联版本。本操作只提交软件包,不发布软件包。接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section39581727", + "text": "该接口需要在华为侧下载软件包并处理后上传,耗时较长,为异步接口。接口会立即响应成功,但这并不意味着最终发布成功。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section39581727", + "text": "您可以遵循回调结果通知接口的约束, 开发并提供回调能力,通过本接口的callbackAddr参数传入回调地址,用于接收软件包处理结果。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section39581727", + "text": "您也可以自行调用查询应用信息接口判断应用是否已经提交审核成功(releaseState为4),或者登录AppGallery Connect官网查看提审状态。" + }, + { + "section": "接口约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section133mcpsimp", + "text": "非中国大陆开发者如需使用该API,应用发布地区必须包含中国大陆。中国大陆开发者无限制。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "text": "请求Body中使用JSON格式携带详细的发布信息,参数如下表所示。" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section311913164588", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-package-file/by-url" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section164139546428" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "downloadUrl", + "M", + "String(256)", + "由您自行提供的软件包下载地址。 APK:不超过4GB。 RPK:快应用不超过20MB,快游戏不超过30MB。 AAB:不超过150MB。 EXE(Windows应用):不超过4GB。" + ], + [ + "downloadFileName", + "M", + "String(64)", + "与downloadUrl配套的文件名,包括后缀。" + ], + [ + "callbackAddr", + "O", + "String(256)", + "回调地址,由您自行配置。软件包提交完成后由华为服务器调用回调结果通知接口通过该URL回调给您的开发者服务器。" + ], + [ + "requestId", + "M", + "String(64)", + "您自定义请求字符串,必须唯一标识此请求。结果回调时会携带该字段。" + ], + [ + "versionName", + "O", + "String(255)", + "Windows应用的软件包版本号。 文件类型为exe软件包时必选。" + ], + [ + "displayName", + "O", + "String(255)", + "注册表显示名称,用于唯一标识Windows应用。 文件类型为exe软件包时必选。" + ], + [ + "packageType", + "O", + "Integer(32)", + "软件包类型。 1:APK 2:RPK 8:EXE(Windows应用)" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section60996746" + } + ], + "title": "通过下载方式提交软件包", + "updatedAt": "2026-01-21 16:29", + "checkedAt": "2026-10-07T02:51:52.049Z", + "family": "publishing", + "endpoint": "add-packageurl" +} diff --git a/pkg/domain/reference/publishing/add-packageurl.parameters.json b/pkg/domain/reference/publishing/add-packageurl.parameters.json new file mode 100644 index 0000000..68c647c --- /dev/null +++ b/pkg/domain/reference/publishing/add-packageurl.parameters.json @@ -0,0 +1,80 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section164139546428" + }, + { + "name": "downloadUrl", + "in": "body", + "type": "string", + "required": true, + "description": "由您自行提供的软件包下载地址。 APK:不超过4GB。 RPK:快应用不超过20MB,快游戏不超过30MB。 AAB:不超过150MB。 EXE(Windows应用):不超过4GB。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 256 + }, + { + "name": "downloadFileName", + "in": "body", + "type": "string", + "required": true, + "description": "与downloadUrl配套的文件名,包括后缀。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 64 + }, + { + "name": "callbackAddr", + "in": "body", + "type": "string", + "required": false, + "description": "回调地址,由您自行配置。软件包提交完成后由华为服务器调用回调结果通知接口通过该URL回调给您的开发者服务器。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 256 + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "您自定义请求字符串,必须唯一标识此请求。结果回调时会携带该字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 64 + }, + { + "name": "versionName", + "in": "body", + "type": "string", + "required": false, + "description": "Windows应用的软件包版本号。 文件类型为exe软件包时必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 255 + }, + { + "name": "displayName", + "in": "body", + "type": "string", + "required": false, + "description": "注册表显示名称,用于唯一标识Windows应用。 文件类型为exe软件包时必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910", + "maxLength": 255 + }, + { + "name": "packageType", + "in": "body", + "type": "integer", + "required": false, + "description": "软件包类型。 1:APK 2:RPK 8:EXE(Windows应用)", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section15344132481910" + } +] diff --git a/pkg/domain/reference/publishing/add-packageurl.rules.json b/pkg/domain/reference/publishing/add-packageurl.rules.json new file mode 100644 index 0000000..6322d21 --- /dev/null +++ b/pkg/domain/reference/publishing/add-packageurl.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/app-age-rating.constraints.json b/pkg/domain/reference/publishing/app-age-rating.constraints.json new file mode 100644 index 0000000..7328803 --- /dev/null +++ b/pkg/domain/reference/publishing/app-age-rating.constraints.json @@ -0,0 +1,40 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "query.releaseType": { + "enum": [ + "1" + ] + }, + "query.releasePhase": { + "enum": [ + "0", + "3" + ] + }, + "body.feedback": { + "maxLength": 8192 + }, + "body.expectedRating": { + "enum": [ + "1", + "2", + "3", + "4", + "5" + ] + }, + "body.ratingRule": { + "enum": [ + "0", + "1" + ] + }, + "body.childFlag": { + "enum": [ + "0", + "1" + ] + } +} diff --git a/pkg/domain/reference/publishing/app-age-rating.json b/pkg/domain/reference/publishing/app-age-rating.json new file mode 100644 index 0000000..e2611bf --- /dev/null +++ b/pkg/domain/reference/publishing/app-age-rating.json @@ -0,0 +1,350 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section1067322214331", + "text": "请求示例\nPOST /api/publish/v2/app-age-rating HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"feedback\": \"{\\\"feedbackId\\\":\\\"\\\",\\\"questionnaireId\\\":\\\"xxx\\\",\\\"userId\\\":xxx\\,\\\"teamId\\\":xxx,\\\"teamName\\\":\\\"\\\",\\\"appId\\\":\\\"xxx\\\",\\\"recordId\\\":\\\"\\\",\\\"action\\\":\\\"submit\\\",\\\"extInfo\\\":\\\"\\\",\\\"agreePrivacy\\\":1,\\\"enrollAppIds\\\":\\\"xxx\\\",\\\"enrollAppNames\\\":\\\"\\\",\\\"status\\\":0,\\\"createTime\\\":,\\\"details\\\":[{\\\"questionId\\\":\\\"xxx\\\",\\\"questionNo\\\":1,\\\"optionId\\\":\\\"xxx\\\",\\\"optionNo\\\":2,\\\"valueType\\\":0},{\\\"xxx\\\"},{\\\"xxx\\\"}]}\",\n \"expectedRating\": 1,\n \"ratingRule\": 1,\n \"childFlag\": 0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"ratingResult\": 2,\n \"prohibitedCountry\": [\n \"RU\"\n ],\n \"otherRatingList\": [\n {\n \"gradeTypeId\": 7,\n \"gradeTypeName\": \"ClassInd\",\n \"ratingResult\": 1\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section1679462873111", + "title": "API客户端方式获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#ZH-CN_TOPIC_0000002236201262__zh-cn_topic_0000002208484113_p6282121175120", + "title": "feedback获取方式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-otherratingresult-0000002621935699", + "title": "OtherRatingResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169", + "title": "更新隐私政策协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585", + "title": "提交发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section23242264517", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section992664711544", + "text": "此接口用于申请或修改HarmonyOS应用/元服务的年龄分级。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section992664711544", + "text": "调用本接口前需完成应用分类设置,明确是游戏类应用还是普通应用。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section236517415165", + "text": "本接口请使用API客户端认证方式,请参见API客户端方式获取服务端授权获取客户端ID和access_token。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "feedback获取方式" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "该问卷为独立页面,需要开发者通过window.open()方法打开,并监听message事件获取问卷填写内容。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "调用window.open()方法打开页面,代码如下: window.open(\"https://developer.huawei.com/consumer/cn/service/josp/agc/amp/ageRatingQuestionnaire.html#/?appType={appType}&lang={lang}\") 其中,appType和lang为参数变量。 appType可选值为app/game,app为应用年龄分级问卷,game为游戏年龄分级问卷。 lang可选值为cn/en/ru,cn为中文问卷,en为英文问卷,ru为俄文问卷。 说明 如果无法打开问卷,请先退出AppGallery Connect登录,然后重新访问该页面。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "window.open(\"https://developer.huawei.com/consumer/cn/service/josp/agc/amp/ageRatingQuestionnaire.html#/?appType={appType}&lang={lang}\")" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "其中,appType和lang为参数变量。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "appType可选值为app/game,app为应用年龄分级问卷,game为游戏年龄分级问卷。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "lang可选值为cn/en/ru,cn为中文问卷,en为英文问卷,ru为俄文问卷。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "如果无法打开问卷,请先退出AppGallery Connect登录,然后重新访问该页面。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "填写完问卷后点击提交,问卷页面会发起postMessage请求,调用方通过监听message事件获取问卷内容feedback,代码如下: window.addEventListener(\"message\", (event) => { console.log(event.data); //问卷内容feedback })" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "window.addEventListener(\"message\", (event) => {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "console.log(event.data); //问卷内容feedback" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386", + "text": "})" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-age-rating" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID。" + ], + [ + "Authorization", + "M", + "String", + "认证信息。 格式:Authorization: Bearer ${access_token}" + ], + [ + "appId", + "M", + "String(32)", + "应用ID。 获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "releaseType", + "O", + "Integer(32)", + "应用发布方式。 取值范围: 1:全网 默认值:1" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section23242264517" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "feedback", + "M", + "String(8192)", + "问卷内容。 说明 具体请参见feedback获取方式。" + ], + [ + "expectedRating", + "O", + "Integer(32)", + "预期年龄分级。 取值范围: 1:巴西适用所有年龄段,中国区及其他区域年满3周岁 2:中国区年满8周岁,巴西年满10周岁,其他区域年满7周岁 3:巴西年满14周岁,中国区及其他区域年满12周岁 4:年满16周岁 5:年满18周岁" + ], + [ + "ratingRule", + "O", + "Integer(32)", + "年龄分级生效规则。 取值范围: 0:以问卷内容评级结果为准。 1:当预期年龄分级expectedRating设置的值大于问卷评级结果中的年龄值时,以预期年龄分级为准,否则以问卷内容评级结果为准。" + ], + [ + "childFlag", + "O", + "Integer(32)", + "应用是否仅面向儿童。 取值范围: 0:应用不仅面向儿童 1:应用仅面向儿童" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "ratingResult", + "O", + "Integer(32)", + "华为年龄分级标准的结果。 取值范围: -1:拒绝评级 1:年满3周岁 2:中国区年满8周岁,其他区域年满7周岁 3:年满12周岁 4:年满16周岁 5:年满18周岁" + ], + [ + "rejectReason", + "O", + "List", + "拒绝评级的原因,返回不满足系统要求的问卷分类ID集合。 数组长度不超过50。 请根据该参数返回的ID找到对应的问卷分类,然后修改内容。 ID对应的问卷分类如下: 389265604458119891:暴力内容 389265604458119892:令人恐惧的内容 389265604458119893:性相关的内容 389265604458119894:不良语言 389265604458119895:受管制物品与活动 389265604458119896:模拟赌博、真实赌博或法定货币支付。 389265604458119897:法律与道德 389265604458119898:用户间交互 389265604458119899:用户信息收集 389265604458119900:其他 389265604458119901:金融类" + ], + [ + "prohibitedCountry", + "O", + "List", + "评级成功时存在禁止发布的国家区域的国家码集合。 数组长度不超过300。" + ], + [ + "otherRatingList", + "O", + "List", + "其他年龄分级标准的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262#section163825114565" + } + ], + "title": "申请年龄分级", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:45.706Z", + "family": "publishing", + "endpoint": "app-age-rating" +} diff --git a/pkg/domain/reference/publishing/app-create.constraints.json b/pkg/domain/reference/publishing/app-create.constraints.json new file mode 100644 index 0000000..c1684aa --- /dev/null +++ b/pkg/domain/reference/publishing/app-create.constraints.json @@ -0,0 +1,23 @@ +{ + "header.teamId": { + "maxLength": 64 + }, + "body.appName": { + "maxLength": 64 + }, + "body.packageName": { + "maxLength": 128 + }, + "body.parentType": { + "enum": [ + "2", + "13" + ] + }, + "body.installationFree": { + "enum": [ + "0", + "1" + ] + } +} diff --git a/pkg/domain/reference/publishing/app-create.json b/pkg/domain/reference/publishing/app-create.json new file mode 100644 index 0000000..8b5a70f --- /dev/null +++ b/pkg/domain/reference/publishing/app-create.json @@ -0,0 +1,318 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section104718299345", + "text": "请求样例\nPOST /api/publish/v3/app?projectId=10****59 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"appName\": \"appName\",\n \"packageName\": \"com.xxx.xxx\",\n \"parentType\": 13,\n \"installationFree\": 0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section6973261379", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"appId\": \"69****117\" \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617", + "title": "查询应用包名对应的appid" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1177261917102", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section112981825101019", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section138816328109", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section104718299345", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section44293557100", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section6973261379", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1177261917102", + "text": "此接口用于为HarmonyOS应用/元服务创建APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/app" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section112981825101019" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015" + }, + { + "authenticationBranch": "OAuth客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section1323714041015" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "projectId", + "O", + "String", + "项目ID,获取方法请参见查看应用信息。 如果不传projectId,系统会先在内部创建一个与应用同名的项目,随后再创建应用。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appName", + "M", + "String(64)", + "应用名称。" + ], + [ + "packageName", + "O", + "String(128)", + "应用包名,必须唯一,且不能与其他应用(包括Android应用)包名相同。 说明 installationFree取值为0(HarmonyOS应用)时,此参数必填。 installationFree取值为1(元服务)时,系统将自动生成包名,此参数无需填写。" + ], + [ + "parentType", + "M", + "Integer(32)", + "应用分类。 取值范围: 2:游戏 13:应用" + ], + [ + "installationFree", + "M", + "Integer(32)", + "应用类型。 取值范围: 0:HarmonyOS应用 1:元服务 默认值:0" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "appId", + "O", + "String", + "应用ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section44293557100" + } + ], + "title": "创建APP ID", + "updatedAt": "2026-09-04 16:04", + "checkedAt": "2026-10-07T05:11:11.924Z" +} diff --git a/pkg/domain/reference/publishing/app-create.rules.json b/pkg/domain/reference/publishing/app-create.rules.json new file mode 100644 index 0000000..b467a15 --- /dev/null +++ b/pkg/domain/reference/publishing/app-create.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "application-package-name", + "kind": "required_if", + "field": "body.packageName", + "when": { + "field": "body.installationFree", + "equals": "0" + }, + "message": "HarmonyOS应用 installationFree=0 时必须提供 packageName。", + "suggestion": "添加 --field packageName=你的唯一包名;元服务 installationFree=1 不需要包名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939#section16551174881019" + } +] diff --git a/pkg/domain/reference/publishing/app-file-info-v3.constraints.json b/pkg/domain/reference/publishing/app-file-info-v3.constraints.json new file mode 100644 index 0000000..7e9c97a --- /dev/null +++ b/pkg/domain/reference/publishing/app-file-info-v3.constraints.json @@ -0,0 +1,52 @@ +{ + "query.appId": { + "maxLength": 32 + }, + "query.releaseType": { + "enum": [ + "1" + ] + }, + "query.releasePhase": { + "enum": [ + "0", + "3" + ] + }, + "body.appIconList": { + "maxItems": 20 + }, + "body.screenShotList": { + "maxItems": 20 + }, + "body.introVideoList": { + "maxItems": 20 + }, + "body.rcmdVideoList": { + "maxItems": 20 + }, + "body.rcmdPicList": { + "maxItems": 20 + }, + "body.elecCertificate": { + "maxLength": 512 + }, + "body.certificateList": { + "maxItems": 10 + }, + "body.publicationList": { + "maxItems": 10 + }, + "body.packagePermissionIntroVideoList": { + "maxItems": 100 + }, + "body.otherCertificatesURL": { + "maxLength": 512 + }, + "body.updateScreenShotList": { + "maxItems": 20 + }, + "body.updateVideoList": { + "maxItems": 20 + } +} diff --git a/pkg/domain/reference/publishing/app-file-info-v3.json b/pkg/domain/reference/publishing/app-file-info-v3.json new file mode 100644 index 0000000..7800e9b --- /dev/null +++ b/pkg/domain/reference/publishing/app-file-info-v3.json @@ -0,0 +1,410 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section11786182613149", + "text": "请求示例\nPUT /api/publish/v3/app-file-info?appId=10******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 4141******68\nContent-Type: application/json\nAuthorization: Bearer *******\n{\n \"appIconList\": [{\n \"lang\": \"zh-CN\",\n \"fileInfoList\": [{\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.png\"],\n \"showType\": 0\n }]\n }\n ],\n \"screenShotList\": [{\n \"lang\": \"zh-CN\",\n \"fileInfoList\": [{\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.png\",\n \"CN/20241118**/17319******.png\"],\n \"showType\": 0\n },\n {\n \"deviceType\": 5,\n \"objectIdList\": [\"CN/20241118**/17319******.png\"],\n \"showType\": 0\n }]\n },\n {\n \"lang\": \"en-US\",\n \"fileInfoList\": [{\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.png\"],\n \"showType\": 0\n },\n {\n \"deviceType\": 5,\n \"objectIdList\": [\"CN/20241118**/17319******.png\",\n \"CN/20241118**/17319******.png\",\n \"CN/20241118**/17319******.png\"],\n \"showType\": 0\n }]\n }],\n \"introVideoList\": [\n {\n \"lang\": \"zh-CN\",\n \"fileInfoList\": [\n {\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.png\",\n \"CN/20241118**/17319******.png\"],\n \"showType\": 0\n }\n ]\n }\n ],\n \"rcmdVideoList\": [\n {\n \"lang\": \"zh-CN\",\n \"fileInfoList\": [\n {\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.png\",\n \"CN/20241118**/17319******.png\"],\n \"showType\": 0\n }\n ]\n }\n ],\n \"rcmdPicList\": [\n {\n \"lang\": \"zh-CN\",\n \"fileInfoList\": [\n {\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.png\",\n \"CN/20241118**/17319******.png\"],\n \"showType\": 0\n }\n ]\n }\n ],\n \"elecCertificate\": \"*****\",\n \"certificateList\": [\n \"*****\"\n ],\n \"publicationList\": [\n \"*****\"\n ],\n \"packagePermissionIntroVideoList\": [\n {\n \"lang\": \"zh-CN\",\n \"permissionName\": \"*****\",\n \"deviceType\": 4,\n \"objectId\": \"CN/2024052102/********.app\"\n }\n ],\n \"otherCertificatesURL\": \"CN/2024052102/********.zip\",\n \"updateScreenShotList\": [\n {\n \"lang\": \"zh-CN\",\n \"fileInfoList\": [\n {\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.jpg\"],\n \"showType\": 1\n }\n ]\n }\n ],\n \"updateVideoList\": [\n {\n \"lang\": \"zh-CN\",\n \"fileInfoList\": [\n {\n \"deviceType\": 4,\n \"objectIdList\": [\"CN/20241118**/17319******.mp4\",\n \"CN/20241118**/17319******.jpg\"],\n \"showType\": 1\n }\n ]\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1234123113169", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-requirement-0000002271160693", + "title": "应用文件要求" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/50000", + "title": "审核政策" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-requirement-0000002271160693", + "title": "应用文件要求" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "title": "PackagePermissionIntroVideo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621", + "title": "删除应用语言信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250", + "title": "更新应用软件包信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section41694086", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section156021546155912", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section11786182613149", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section19172900", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1234123113169", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section41694086", + "text": "图片、视频等文件上传完成后,通过该接口刷新HarmonyOS应用/元服务的文件信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section41694086", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "text": "请求Body中使用JSON格式携带更新的应用文件信息,参数如下表所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712", + "text": "各文件类型对应的文件上传要求请参见应用文件要求。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/app-file-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "需要更新的应用ID。" + ], + [ + "releaseType", + "O", + "Integer(32)", + "应用发布方式。 取值范围: 1:全网 默认值:1" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section156021546155912" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appIconList", + "O", + "List", + "应用图标信息。 数组长度不超过20。 说明 应用图标必须与软件包中的应用图标一致,且需符合审核政策与应用文件要求。" + ], + [ + "screenShotList", + "O", + "List", + "应用介绍截图信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。" + ], + [ + "introVideoList", + "O", + "List", + "应用介绍视频信息。 数组长度不超过20。 说明 在同一语言、同一设备下,同时更新的截图素材和视频素材方向必须保持一致,否则将报错。" + ], + [ + "rcmdVideoList", + "O", + "List", + "推荐视频信息。 数组长度不超过20。" + ], + [ + "rcmdPicList", + "O", + "List", + "推荐图片信息。 数组长度不超过20。" + ], + [ + "elecCertificate", + "O", + "String(512)", + "电子版本证书。" + ], + [ + "certificateList", + "O", + "List", + "应用版权证书或代理证书。 数组长度不超过10。" + ], + [ + "publicationList", + "O", + "List", + "版号证明。 数组长度不超过10。" + ], + [ + "packagePermissionIntroVideoList", + "O", + "List", + "包权限使用场景说明视频。 数组长度不超过100。 说明 隐私权限说明的“权限描述”、“权限使用设备范围”和“权限使用理由”从上传的软件包体中读取,无需通过接口更新。" + ], + [ + "otherCertificatesURL", + "O", + "String(512)", + "授权书及其他材料文件压缩包的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 若文件格式不正确,提交发布时会出错,具体限制如下: 压缩包必须为zip格式,不超过200MB。 解压后的大小不超过1GB。 文件夹层级不超过3层。 只能包含JPG、JPEG、BMP格式图片和PDF格式的文件,累计不超过200个。 说明 此字段只支持HarmonyOS应用,不支持元服务。" + ], + [ + "updateScreenShotList", + "O", + "List", + "更新截图素材。 数组长度不超过20。" + ], + [ + "updateVideoList", + "O", + "List", + "更新视频素材。 数组长度不超过20。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section1131102811712" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430#section19172900" + } + ], + "title": "更新应用文件信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:31.723Z", + "family": "publishing", + "endpoint": "app-file-info-v3" +} diff --git a/pkg/domain/reference/publishing/app-file-info.json b/pkg/domain/reference/publishing/app-file-info.json new file mode 100644 index 0000000..a185aa5 --- /dev/null +++ b/pkg/domain/reference/publishing/app-file-info.json @@ -0,0 +1,404 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section11786182613149", + "text": "请求示例\nPUT /api/publish/v2/app-file-info?appId=10******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 4141******68\nContent-Type: application/json\nAuthorization: Bearer *******\n{\n \"fileType\":5,\n \"files\":{\n \"fileName\":\"PhotoPlaza.apk\",\n \"fileDestUrl\":\"**716E24D17593E159601A67A7.apk\"\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1234123113169", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"pkgVersion\": []\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-langtype-0000001158245079", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-file-requirement-0000001158365071", + "title": "应用文件要求" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#ZH-CN_TOPIC_0000001111685202__zh-cn_topic_0000001058262127_p173701128151713", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#ZH-CN_TOPIC_0000001111685198__zh-cn_topic_0000001059070156_p261515481513", + "title": "publishCountry" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-delete-0000001111845088", + "title": "删除语言描述信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061", + "title": "提交发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section41694086", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section156021546155912", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1131102811712", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section11786182613149", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section19172900", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1234123113169", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section114825816489", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section41694086", + "text": "图片、视频、APK、RPK、AAB等文件上传完成后,通过该接口刷新应用文件信息。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1131102811712", + "text": "请求Body中使用JSON格式携带更新的应用文件信息,参数如下表所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1131102811712", + "text": "FileInfo" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1131102811712", + "text": "调用更新应用文件信息接口,需确保发布国家字段不能为空,具体参见publishCountry字段。" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section114825816489", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-file-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "需要更新的应用ID。" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section156021546155912" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "O", + "String(8)", + "语言种类,取值参见语言类型。 更新图片、视频时此参数必选。" + ], + [ + "imgShowType", + "O", + "Integer(1)", + "截图展现方式。 取值范围: 0:竖屏。 1:横屏。 当fileType为2时该参数必选。" + ], + [ + "videoShowType", + "O", + "Integer(1)", + "视频展现方式。 取值范围: 0:竖屏。 1:横屏。 当fileType为1时该参数必选,且视频及其海报实际的展示方式(横屏或竖屏)必须与videoShowType指定的方式一致。" + ], + [ + "clearArk", + "O", + "Integer(1)", + "是否清除方舟包(用于Android + 方舟升级到Android)。 取值范围: 1:需要清除方舟包; 0:不需要清除方舟包。 默认值:0" + ], + [ + "sensitivePermissionDesc", + "O", + "String(2048)", + "敏感权限描述。" + ], + [ + "fileType", + "M", + "Integer(1)", + "文件类型。 取值范围: 0:应用图标。 1:应用介绍视频及对应海报,最多3个视频以及对应海报,files中必须先传视频再传海报,且视频和海报必须交替上传,即先传第1组的视频再传对应的海报,再传下一组视频和海报。 2:应用介绍截图。 3:推荐视频,1个推荐视频以及对应海报。files中必须先传视频再传海报。 4:推荐图片。 5:软件包,如RPK、APK、AAB等。 6:代理证书或者代理版权图片。 7:电子证书PDF文件。尺寸不超过5MB。 8:文化部版号截图。 9:文化备案证明截图或者PDF,仅支持游戏应用。 10:VR封面图片。 11:VR应用截图。 12:VR应用推荐图片。 13:VR封面分层图片。 14:VR推荐图片4:3。 15:VR推荐图片1:1。 16:VR应用全景图。 各文件类型对应的文件上传要求,请参见应用文件要求。" + ], + [ + "files", + "M", + "List", + "应用文件信息。" + ], + [ + "deviceType", + "O", + "Integer", + "设备类型。 取值范围: 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机 更新多设备应用图片、视频时,该字段必填。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1131102811712" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileName", + "O", + "String", + "文件名称,包括文件的后缀名。 fileType为5时,此参数必选。" + ], + [ + "fileDestUrl", + "M", + "String", + "文件在文件服务器中的对象ID。 先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ], + [ + "versionName", + "O", + "String", + "Windows应用的软件包版本号。 文件类型为exe软件包时必选。" + ], + [ + "displayName", + "O", + "String", + "注册表显示名称,用于唯一标识Windows应用。 文件类型为exe软件包时必选。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section1131102811712" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "pkgVersion", + "O", + "List", + "软件包标识。仅在添加了软件包的接口返回,当前仅支持一个。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202#section19172900" + } + ], + "title": "更新应用文件信息", + "updatedAt": "2025-11-21 17:52", + "checkedAt": "2026-10-07T02:52:22.905Z", + "family": "publishing", + "endpoint": "app-file-info" +} diff --git a/pkg/domain/reference/publishing/app-info-query-v3.constraints.json b/pkg/domain/reference/publishing/app-info-query-v3.constraints.json new file mode 100644 index 0000000..b7de43a --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-query-v3.constraints.json @@ -0,0 +1,14 @@ +{ + "query.appId": { + "maxLength": 32 + }, + "query.lang": { + "maxLength": 16 + }, + "query.releaseType": { + "enum": [ + "1", + "6" + ] + } +} diff --git a/pkg/domain/reference/publishing/app-info-query-v3.json b/pkg/domain/reference/publishing/app-info-query-v3.json new file mode 100644 index 0000000..f668e7a --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-query-v3.json @@ -0,0 +1,313 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section423141017508", + "text": "请求样例\nGET /api/publish/v3/app-info?appId=10*****57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section585524622518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"appInfo\": {\n \"releaseState\": 4,\n \"defaultLang\": \"zh-CN\",\n \"parentType\": 13,\n \"harmonyChildType\": 10000014,\n \"kindMainTag\": 30000017,\n \"kindSubTags\": [\n 30000017,\n 30000018\n ],\n \"privacyPolicy\": \"https://*****.link\",\n \"appNetType\": 0,\n \"publishCountry\": \"CN\",\n \"contentRate\": \"{\\\"HW\\\":\\\"3+\\\"}\",\n \"appTariffType\": \"6\",\n \"publicationNumber\": \"*****\",\n \"developerNameCn\": \"******\",\n \"developerNameEn\": \"******\",\n \"developerWebsite\": \"https://****.****test.cn/consumer/cn/service/josp/***/index.html\",\n \"customInfo\": {\n \"phone\": \"0086-137xxxxxxxx\",\n \"email\": \"137*****@***.com\",\n \"qqNum\": \"137*****\",\n \"internalPath\": \"华为应用市场 > 我的 > 帮助与客服\"\n },\n \"elecCertificateUrl\": \"******\",\n \"certificateURLs\": \"https://***5819F41A7F216EF87637667B4E33C.jpg\",\n \"publicationURLs\": \"\",\n \"updateTime\": \"2024-11-12 02:14:50\",\n \"versionNumber\": \"1.0.0\",\n \"versionCode\": 1000000,\n \"buildVersion\": \"100.100.100\",\n \"versionId\": \"155236****020262400\",\n \"onShelfVersionNumber\": \"1.0.0\",\n \"onShelfVersionCode\": 1000000,\n \"onShelfVersionId\": \"155236****020262400\",\n \"shareLink\": \"string\",\n \"sensitivePermissionDesc\": \"string\",\n \"familyShareTag\": 0,\n \"deviceTypes\": [\n {\n \"deviceType\": 4,\n \"appAdapters\": \"\"\n }\n ],\n \"restrictedPermissionVideo\": \"\",\n \"privacyRightsUrl\": \"\",\n \"projectId\": \"2448791****2652411\",\n \"registeredIdType\": 2,\n \"registeredIdNumber\": \"12342220****544487\",\n \"privacyAgreementId\": \"17******56\",\n \"userAgreementUrl\": \"https://docs.p***e.com/baike/328370\",\n \"userAgreementIds\": [\n \"12***************89\",\n \"23***************78\",\n \"34***************67\"\n ],\n \"encrypted\": 0,\n \"invitationCount\": 1000,\n \"downloadCount\": 900,\n \"isAiGenerate\": 1,\n \"aiTypes\": [\n 1\n ],\n \"testUserName\": \"*****\",\n \"testUserPassword\": \"*****\",\n \"appRemark\": \"*****\",\n \"selfTestVideos\": \"{\"CN/2025102002/********.mp4\":\"文件名1\"}\",\n \"appReviewPhoneInfo\": {\n \"account\": \"137********\"\n },\n \"appReviewEmailInfo\": {\n \"account\": \"137*****@***.com\"\n },\n \"appReviewName\": \"*****\",\n \"versionVocs\": [\n {\n \"versionId\": \"10*****528\",\n \"packageId\": \"1573*******5952\",\n \"vocId\": \"18******24\",\n }\n ],\n \"reviewState\": 2,\n \"releaseTime\": \"2025-09-10 08:40:32\"\n },\n \"auditInfo\": {\n \"auditOpinion\": \"\"\n },\n \"languages\": [\n {\n \"lang\": \"zh-CN\",\n \"appName\": \"PhotoPlaza\",\n \"appDesc\": \"****\",\n \"briefInfo\": \"****\",\n \"newFeatures\": \"****\",\n \"icon\": \"https://****\",\n \"showType\": 1,\n \"videoShowType\": 1,\n \"introPic\": \"https://****\",\n \"introVideo\": \"\",\n \"rcmdPic\": \"\",\n \"rcmdVideo\": \"\",\n \"deviceMaterials\": [\n {\n \"deviceType\": 4,\n \"appIcon\": \"https://****\",\n \"screenShots\": [\n \"https://****\",\n \"https://****\",\n \"https://****\",\n \"https://****\"\n ],\n \"banner\": \"****\",\n \"showType\": 1,\n \"introVideos\": [\n \"****\"\n ],\n \"rcmdVideos\": [\n \"****\"\n ],\n \"promoGraphics\": [\n \"****\"\n ],\n \"rcmdPics\": \"****\",\n \"videoShowType\": 0\n }\n ]\n }\n ],\n \"phasedReleaseInfo\": {\n \"state\": \"SUSPEND\",\n \"description\": \"****\",\n \"releaseTime\": 1748591413000,\n \"latestSuspendTime\": 1748933392000,\n \"totalSuspendDays\": 1,\n \"currentPhaseDay\": 5\n },\n \"openTestInfo\": {\n \"startTime\": 1716*****000,\n \"endTime\": 1717*****000,\n \"testDesc\": \"版本描述demo\",\n \"testTaskInfo\": {\n \"groupInfos\": [\n {\n \"groupId\": \"761e*****************008\",\n \"groupName\": \"string\",\n \"addedTesterNum\": 0,\n \"bind\": 0\n }\n ],\n \"needShareLink\": 0,\n \"displayArea\": \"1\",\n \"needNotify\": 0\n }\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454", + "title": "AppInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-auditinfo-0000002271000649", + "title": "AuditInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-languageinfo-0000002236041462", + "title": "LanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597", + "title": "PhasedReleaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-opentestinfo-0000002678282119", + "title": "OpenTestInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743", + "title": "查询团队账号下的成员角色列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246", + "title": "更新应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section37920632", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section423141017508", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section74011072310", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section585524622518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section1151919326110", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section37920632", + "text": "此接口用于根据指定语言和应用ID查询HarmonyOS应用/元服务的详细信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section37920632", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/app-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "需要查询的应用ID。" + ], + [ + "lang", + "O", + "String(16)", + "需要查询的语言。 说明 取值参考语言类型。 不传该参数,则查询全部语言的应用信息。" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网 6:HarmonyOS测试发布方式(API>=10) 默认值:1" + ], + [ + "versionId", + "O", + "String", + "需要查询的版本ID。 注意 releaseType为6,该字段必填。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "appInfo", + "O", + "AppInfo", + "应用基本信息。" + ], + [ + "auditInfo", + "O", + "AuditInfo", + "审核意见信息。" + ], + [ + "languages", + "M", + "List", + "包含多种语言的应用信息。 如果查询时传递了语言类型,则返回当前语言的应用信息。 如果查询时未传递语言类型,则返回所有语言的应用信息。 如果查询时设置了异常的语言数据,例如不存在的语言类型,则返回空数组。" + ], + [ + "phasedReleaseInfo", + "O", + "PhasedReleaseInfo", + "分阶段发布信息。" + ], + [ + "openTestInfo", + "O", + "OpenTestInfo", + "测试版本信息,包含测试版本开始时间和结束时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section74011072310" + } + ], + "title": "查询应用信息", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T05:11:36.198Z" +} diff --git a/pkg/domain/reference/publishing/app-info-query-v3.rules.json b/pkg/domain/reference/publishing/app-info-query-v3.rules.json new file mode 100644 index 0000000..89cf6f7 --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-query-v3.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "test-version-id", + "kind": "required_if", + "field": "query.versionId", + "when": { + "field": "query.releaseType", + "equals": "6" + }, + "message": "查询HarmonyOS测试版本时必须提供 versionId。", + "suggestion": "先用 app-version-list 查询真实版本 ID,再添加 --query versionId=该ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422#section420734618165" + } +] diff --git a/pkg/domain/reference/publishing/app-info-query.json b/pkg/domain/reference/publishing/app-info-query.json new file mode 100644 index 0000000..cd8c4e8 --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-query.json @@ -0,0 +1,976 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section423141017508", + "text": "请求样例\nGET /api/publish/v2/app-info?appId=10*****57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section585524622518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"appInfo\": {\n \"releaseState\": 11,\n \"defaultLang\": \"zh-CN\",\n \"parentType\": 13,\n \"childType\": 26,\n \"grandChildType\": 10041,\n \"privacyPolicy\": \"https://*****.link\",\n \n \"isFree\": 1,\n \"price\": \"{\\\"CN\\\":\\\"0\\\"}\",\n \"priceDetail\": \"[]\",\n \"publishCountry\": \"AF,AE,OM,PK,PS,BH,QA,KW,LB,SA,IQ,IL,JO,AU,MO,PG,PF,PH,FJ,KR,KH,CK,LA,MV,MY,AS,BD,MM,NR,NP,JP,LK,SB,TW,TH,TO,VU,BN,HK,SG,NZ,IN,ID,VN,AZ,GE,KZ,KG,MN,TJ,TM,UZ,AM,ALL,CN,AL,IE,EE,AD,AT,BG,BE,IS,BA,PL,DK,DE,RU,FR,FO,VA,FI,GL,NL,ME,CZ,HR,LV,LT,LI,LU,RO,MT,MK,MD,MC,NO,PT,SE,CH,RS,CY,SM,SK,SI,UA,ES,GR,HU,IT,GB,GI,BY,TR,DZ,EG,ET,AO,BJ,BW,BF,BI,GQ,TG,ER,CV,GM,CG,CD,DJ,GN,GW,GH,GA,ZW,CM,KM,CI,KE,LS,LR,LY,RE,RW,MG,MW,ML,YT,MU,MR,MA,MZ,NA,ZA,SS,NE,NG,SL,SN,SC,ST,SZ,SO,TZ,TN,UG,YE,ZM,TD,CF,AR,AW,AI,AG,BB,BS,PY,PA,BR,PR,BO,BZ,DO,EC,GF,CO,CR,GD,GP,GY,HT,AN,HN,KY,MQ,MS,PE,MX,NI,SV,LC,VC,SR,TT,GT,VE,UY,JM,VG,CL,CA\",\n \"contentRate\": \"{\\\"HW\\\":\\\"3+\\\"}\",\n \"hispaceAutoDown\": 0,\n \"appTariffType\": \"6\",\n \"developerNameCn\": \"****\",\n \"developerNameEn\": \"****\",\n \"developerAddr\": \"\",\n \"developerEmail\": \"\",\n \"developerPhone\": \"\",\n \"developerWebsite\": \"\",\n \"certificateURLs\": \"https://***5819F41A7F216EF87637667B4E33C.jpg\",\n \"publicationURLs\": \"[\\\"\\\"]\",\n \"cultureRecordURLs\": \"[null]\",\n \"updateTime\": \"2021-03-26 07:47:39\",\n \"versionNumber\": \"6.5.0.300\",\n \"familyShareTag\": 0,\n \"deviceTypes\": [\n {\n \"deviceType\": 4,\n \"appAdapters\": \"4,5\"\n }\n ]\n },\n \"auditInfo\": {\n \"auditOpinion\": \"\"\n },\n \"languages\": [\n {\n \"lang\": \"en-US\",\n \"appName\": \"PhotoPlaza-en\",\n \"appDesc\": \"*****\",\n \"briefInfo\": \"*****\",\n \"newFeatures\": \"*****\",\n \"icon\": \"https://****D.png\",\n \"showType\": 0,\n \"videoShowType\": 1,\n \"introPic\": \"https://*****D0.jpg\",\n \"deviceMaterials\": [\n {\n \"deviceType\": 4,\n \"appIcon\": \"https://****8D.png\",\n \"screenShots\": [\n \"https://****1B.jpg\",\n \"https://****BA.jpg\",\n \"https://****CA.jpg\",\n \"https://****D0.jpg\"\n ],\n \"showType\": 0,\n \"vrCoverLayeredImage\": [],\n \"vrRecomGraphic4to3\": [],\n \"vrRecomGraphic1to1\": [],\n \"promoGraphics\": [],\n \"videoShowType\": 1\n }\n ]\n },\n {\n \"lang\": \"zh-CN\",\n \"appName\": \"PhotoPlaza\",\n \"appDesc\": \"****\",\n \"briefInfo\": \"****\",\n \"newFeatures\": \"****\",\n \"icon\": \"****8D.png\",\n \"showType\": 0,\n \"videoShowType\": 1,\n \"introPic\": \"https://****D0.jpg\",\n \"rcmdPic\": \",,,\",\n \"deviceMaterials\": [\n {\n \"deviceType\": 4,\n \"appIcon\": \"https://****8D.png\",\n \"screenShots\": [\n \"https://****1B.jpg\",\n \"https://****BA.jpg\",\n \"https://****CA.jpg\",\n \"https://****D0.jpg\"\n ],\n \"showType\": 0,\n \"vrCoverLayeredImage\": [],\n \"vrRecomGraphic4to3\": [],\n \"vrRecomGraphic1to1\": [],\n \"promoGraphics\": [],\n \"rcmdPics\": \",,,\",\n \"videoShowType\": 1\n }\n ]\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-reference-langtype-0000001158245079", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#ZH-CN_TOPIC_0000001158365045__zh-cn_topic_0000001057964443_p30604375", + "title": "AppInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#ZH-CN_TOPIC_0000001158365045__zh-cn_topic_0000001057964443_p54343776", + "title": "AuditInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#ZH-CN_TOPIC_0000001158365045__zh-cn_topic_0000001057964443_p50510538", + "title": "LanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#ZH-CN_TOPIC_0000001158365045__zh-cn_topic_0000001057964443_p113887247191", + "title": "PhasedReleaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#ZH-CN_TOPIC_0000001158365045__p1188514919140", + "title": "全网版本状态流转说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-langtype-0000001158245079", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#ZH-CN_TOPIC_0000001158365045__zh-cn_topic_0000001057964443_p17819165272318", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-langtype-0000001158245079", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#ZH-CN_TOPIC_0000001158365045__zh-cn_topic_0000001057964443_p1150115221462", + "title": "DeviceMaterial" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appid-list-0000001111845086", + "title": "查询应用包名对应的appid" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198", + "title": "更新应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section48249874", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section9113718", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section423141017508", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section585524622518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section19113171794011", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section48249874", + "text": "此接口用于根据指定语言和应用ID查询应用的详细信息。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "text": "AppInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "text": "全网版本状态流转说明" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "text": "DeviceTypeInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "text": "LanguageInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "text": "DeviceMaterial" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "text": "AuditInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606", + "text": "PhasedReleaseInfo" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section19113171794011", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "需要查询的应用ID。" + ], + [ + "lang", + "O", + "String", + "需要查询的语言,取值参考语言类型。不传该参数则查询全部语言的应用信息。" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "appInfo", + "O", + "AppInfo", + "应用基本信息。" + ], + [ + "auditInfo", + "O", + "AuditInfo", + "审核意见信息。" + ], + [ + "languages", + "M", + "List", + "包含多种语言的应用信息。 如果查询时传递了语言类型,则返回当前语言的应用信息。 如果查询时未传递语言类型,则返回所有语言的应用信息。 如果查询时设置了异常的语言数据(例如不存在的语言类型),则返回空数组。" + ], + [ + "phasedReleaseInfo", + "O", + "PhasedReleaseInfo", + "分阶段发布信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "releaseState", + "O", + "Integer(4)", + "应用状态。 releaseType为1时,状态含义如下。各状态间的转换请参见全网版本状态流转说明。 0:已上架 1:上架审核不通过 2:已下架(含强制下架) 3:待上架,预约上架 4:审核中 5:升级审核中 6:申请下架 7:草稿 8:升级审核不通过 9:下架审核不通过 10:应用被开发者下架 11:撤销上架 12:预审中 13:预审不通过" + ], + [ + "defaultLang", + "O", + "String(64)", + "应用的默认语言,取值参见语言类型。" + ], + [ + "parentType", + "M", + "Integer(4)", + "应用的一级分类,固定ID,取值参见应用游戏分类。" + ], + [ + "childType", + "M", + "Integer(4)", + "应用的二级分类,固定ID,取值参见应用游戏分类。" + ], + [ + "grandChildType", + "M", + "Integer(4)", + "应用的三级分类,固定ID,取值参见应用游戏分类。" + ], + [ + "privacyPolicy", + "M", + "String(255)", + "隐私政策声明的网页地址。 该网址会在应用的详情页面添加隐私政策跳转,可帮助用户清楚地了解您如何处理敏感的用户数据和设备数据。 隐私政策必须完整说明您的应用如何收集、使用和分享用户数据,包含但不限于如下情况建议提供: 面向儿童的App。 包含账户注册或需要访问用户的现有账户,或由法律另行规定。 对于收集用户或设备相关数据的App。" + ], + [ + "appNetType", + "O", + "Integer(1)", + "应用联网类型。 取值范围: 1:单机 2:网游 说明 此参数只支持游戏类应用。" + ], + [ + "isFree", + "O", + "Integer(1)", + "应用付费类型。 取值范围: 1:免费 0:付费" + ], + [ + "price", + "O", + "String(256)", + "应用价格,格式为{\"countryCode\":\"price\"}。countryCode为国家码,price为应用的价格。" + ], + [ + "priceDetail", + "O", + "String(8192)", + "应用在不同国家或地区的价格,json数组格式,不同国家和地区之间使用逗号分隔,例如:[{\"country\":\"CN\",\"currency\":\"CNY\",\"price\":\"18.00\"},{\"country\":\"DE\",\"currency\":\"EUR\",\"price\":\"2.50\"}]。 其中,country为国家码,currency为国家码所对应的币种,price为应用价格。" + ], + [ + "publishCountry", + "O", + "String(256)", + "应用发布国家的国家码,多个国家以英文逗号分隔,例如:“CN,DE,MC”。" + ], + [ + "contentRate", + "O", + "String(256)", + "应用分级,Json格式,例如{\"HW\":\"3+\"}。" + ], + [ + "isAppForcedUpdate", + "O", + "Integer(1)", + "应用是否强制升级。 取值范围: 0:不强制 1:强制" + ], + [ + "sensitivePermissionDesc", + "O", + "String(256)", + "敏感权限说明。" + ], + [ + "hispaceAutoDown", + "O", + "Integer(1)", + "是否允许华为应用市场抓包。 取值范围: 0:不允许 1:允许" + ], + [ + "appTariffType", + "O", + "String(16)", + "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 返回多个表示具备多个类型,例如“1,2,3”。" + ], + [ + "publicationNumber", + "O", + "String(50)", + "版号信息。" + ], + [ + "cultureRecordNumber", + "O", + "String(50)", + "文化部备案编号。" + ], + [ + "developerWebsite", + "O", + "String(255)", + "开发者官网。" + ], + [ + "developerNameCn", + "O", + "String(64)", + "开发者中文名称。" + ], + [ + "developerNameEn", + "O", + "String(64)", + "开发者英文名称。" + ], + [ + "elecCertificateUrl", + "O", + "String(256)", + "电子版权证书PDF地址。" + ], + [ + "certificateURLs", + "M", + "String(256)", + "应用版权证书或代理证书图片地址列表,逗号分隔,最多5个。" + ], + [ + "publicationURLs", + "O", + "String(1024)", + "版号证明,逗号分隔的地址,可以为图片或者PDF,最多3个。" + ], + [ + "cultureRecordURLs", + "O", + "String(256)", + "文化部备案证明地址,图片或者PDF。" + ], + [ + "updateTime", + "O", + "String(32)", + "更新时间,UTC时间格式:yyyy-mm-dd hh:mm:ss。" + ], + [ + "versionNumber", + "O", + "String(32)", + "版本号。" + ], + [ + "versionCode", + "O", + "Integer(64)", + "对应软件包中的versionCode。" + ], + [ + "versionId", + "O", + "String(32)", + "版本ID。" + ], + [ + "onShelfVersionNumber", + "O", + "String(32)", + "在架版本版本号。" + ], + [ + "onShelfVersionCode", + "O", + "Integer(64)", + "在架版本versionCode,对应软件包中的versionCode。" + ], + [ + "onShelfVersionId", + "O", + "String(32)", + "在架版本版本ID。" + ], + [ + "shareLink", + "O", + "String(1024)", + "分享链接。" + ], + [ + "familyShareTag", + "O", + "Integer(1)", + "是否可以家庭共享。0:不可以;1:可以。只有分发区域包含中国大陆的应用返回1。" + ], + [ + "deviceTypes", + "M", + "List", + "应用的设备类型信息,数组长度不超过6。" + ], + [ + "webGameFlag", + "O", + "Integer", + "该应用是否为网页游戏。 取值范围: 0:否 1:是" + ], + [ + "privacyRightsUrl", + "O", + "String(256)", + "隐私权利网址,即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。" + ], + [ + "isSignedCommitment", + "M", + "Integer", + "是否签署合规承诺函。 说明 当前仅元服务涉及签署合规承诺函。 取值范围: 空:表示未签署 1:表示已签署 默认值:空" + ], + [ + "registeredIdType", + "O", + "Integer(32)", + "备案证件类型。 取值范围: -1:清空数据,同时也会清空registeredIdNumber的内容。 1:面向企业,备案证件为社会信用 2:面向个人,备案证件为身份证 3:面向机构,备案证件为机构代码" + ], + [ + "registeredIdNumber", + "O", + "String(64)", + "备案证件号码。 取值范围: registeredIdType为1时,对应社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应机构代码" + ], + [ + "privacyAgreementId", + "O", + "String(32)", + "隐私协议ID。" + ], + [ + "userAgreementUrl", + "O", + "String(512)", + "用户协议URL。" + ], + [ + "invitationCount", + "O", + "Integer", + "邀请量。 如果是邀请测试,返回的是参与测试的用户数。 如果是公开测试,返回的是下载安装次数。" + ], + [ + "downloadCount", + "O", + "Integer", + "下载量。该版本启动下载的累计次数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 取值范围: 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "appAdapters", + "O", + "String", + "适配设备类型,多个类型以英文逗号分隔。 取值范围: 1:荣耀立方(路由器) 4:手机 5:平板 6:VR 7:手表 8:大屏 9:路由器 11:儿童表 12:智能手表 13:带屏音响" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "O", + "String(64)", + "当前语言,取值参考语言类型。" + ], + [ + "appName", + "O", + "String(64)", + "当前语言的应用名称。" + ], + [ + "appDesc", + "O", + "String(8000)", + "当前语言的应用描述。" + ], + [ + "briefInfo", + "O", + "String(60)", + "当前语言的一句话简介。" + ], + [ + "newFeatures", + "O", + "String(1000)", + "当前语言的新版本简介。" + ], + [ + "icon", + "O", + "String(256)", + "当前语言的图标地址。" + ], + [ + "showType", + "O", + "Integer(1)", + "当前语言的截图展现方式。 取值范围: 0:竖屏 1:横屏" + ], + [ + "videoShowType", + "O", + "Integer(1)", + "当前语言的视频展现方式。 取值范围: 0:竖屏 1:横屏" + ], + [ + "introPic", + "O", + "String(4096)", + "应用介绍的截图地址,多个地址以逗号隔开,最多不超过10个地址。" + ], + [ + "introVideo", + "O", + "String(4096)", + "应用的介绍视频地址和视频截图地址,最多5个视频,每个视频必须对应截图。例如:[{\"videoUrl\":\"XXX/app/000/000/375/20160512143416.mp4\",\"frameUrl\":\"XXX/app/000/000/375/20160512143416.68439491.jpg\"},{\"videoUrl\":\"/app/000/000/376/20160512143416.mp4\",\"frameUrl\":\"/app/000/000/376/20160512143416.68439491.jpg\"}]" + ], + [ + "rcmdPic", + "O", + "String(4096)", + "应用的推荐截图地址,多个地址以逗号隔开,最多不超过10个地址。" + ], + [ + "rcmdVideo", + "O", + "String(4096)", + "应用的推荐视频地址以及视频截图地址,最多5个视频,每个视频必须对应截图。例如:[{\"videoUrl\":\"XXX/app/000/000/375/20160512143416.mp4\",\"frameUrl\":\"XXX/app/000/000/375/20160512143416.68439491.jpg\"},{\"videoUrl\":\"/app/000/000/376/20160512143416.mp4\",\"frameUrl\":\"/app/000/000/376/20160512143416.68439491.jpg\"}]" + ], + [ + "deviceMaterials", + "O", + "List", + "设备相关的素材,包括图片、视频,数组长度不超过6。 应用为多设备时,只显示手机的相关素材信息。应用为单设备时,显示对应设备相关的素材信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer(1)", + "设备类型。 取值范围: 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "appIcon", + "O", + "String(256)", + "应用图标下载地址。" + ], + [ + "screenShots", + "O", + "String(2560)", + "应用截屏地址,多个地址以英文逗号隔开,最多不超过10个地址。" + ], + [ + "banner", + "O", + "String(255)", + "高清大图地址。" + ], + [ + "showType", + "O", + "Integer(1)", + "截图展现方式。 取值范围: 0:竖屏 1:横屏" + ], + [ + "vrCover", + "O", + "String(255)", + "VR封面图片下载地址。" + ], + [ + "vrShots", + "O", + "String(1280)", + "VR应用截屏地址,多个地址以英文逗号隔开,最多不超过5个地址。" + ], + [ + "vrRecomGraphic", + "O", + "String(255)", + "VR推荐图片下载地址。" + ], + [ + "vrCoverLayeredImage", + "O", + "String(512)", + "VR封面分层图片地址,固定要求两个地址,使用英文逗号分隔。第一个为前景图,第二个为背景图。" + ], + [ + "vrRecomGraphic4to3", + "O", + "String(512)", + "VR 4:3推荐图片地址,固定要求两个地址,使用英文逗号分隔。第一个为前景图,第二个为背景图。" + ], + [ + "vrRecomGraphic1to1", + "O", + "String(512)", + "VR 1:1推荐图片地址,固定要求两个地址,使用英文逗号分隔。第一个为前景图,第二个为背景图。" + ], + [ + "vrApplicationPanorama", + "O", + "String(255)", + "VR应用全景图地址。" + ], + [ + "introVedios", + "O", + "String(1300)", + "介绍视频,Json字符串格式,含有vedioUrl、frameUrl两个字段,数组长度最多5个。 示例: \"introVedios\": [\"{\\\"frameUrl\\\":\\\"https://**.cn:18445/FileServer/D11.jpeg\\\",\\\"vedioUrl\\\":\\\"https://*.*.cn:18445/82C.mp4\\\"}\" ]" + ], + [ + "rcmdVedios", + "O", + "String(1300)", + "推荐视频,Json字符串格式,含有vedioUrl、frameUrl两个字段。数组长度最多5个。 示例: \"rcmdVedios\": [\"{\\\"frameUrl\\\":\\\"https://*.*.cn:18445/5D7.jpeg\\\",\\\"vedioUrl\\\":\\\"https://*.*.cn:18445/97A.mp4\\\"}\"" + ], + [ + "promoGraphics", + "O", + "String(2560)", + "宣传图片地址,多个地址以英文逗号隔开,最多不超过10个地址。" + ], + [ + "rcmdPics", + "O", + "String(1280)", + "推荐图片地址,多个地址以英文逗号隔开,最多不超过10个地址。" + ], + [ + "videoShowType", + "O", + "Integer(1)", + "视频展现方式。 取值范围: 0:竖屏 1:横屏" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "auditOpinion", + "M", + "String(1024)", + "应用整体审核意见。" + ], + [ + "copyRightAuditResult", + "O", + "Integer(4)", + "版权审核结果。 取值范围: 0:通过 1:不通过 只有在中国大陆地区发布的应用才会返回。" + ], + [ + "copyRightAuditOpinion", + "O", + "String(1024)", + "版权审核意见。 只有在中国大陆地区发布的应用才会返回。" + ], + [ + "copyRightCodeAuditResult", + "O", + "Integer(4)", + "版号审核结果。 取值范围: 0:通过 1:不通过 只有在中国大陆地区发布的应用才会返回。" + ], + [ + "copyRightCodeAuditOpinion", + "O", + "String(1024)", + "版号审核意见。 只有在中国大陆地区发布的应用才会返回。" + ], + [ + "recordAuditResult", + "O", + "Integer(4)", + "备案审核结果。 取值范围: 0:通过 1:不通过 只有在中国大陆地区发布的应用才会返回。" + ], + [ + "recordAuditOpinion", + "O", + "String(1024)", + "备案审核意见。 只有在中国大陆地区发布的应用才会返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "state", + "M", + "String", + "分阶段发布状态。 取值范围: SUSPEND:暂停 RELEASE:发布中 CANCEL:取消 DRAFT:草稿" + ], + [ + "phasedReleaseStartTime", + "M", + "String(64)", + "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "phasedReleaseEndTime", + "M", + "String(64)", + "分阶段发布生效结束时间,UTC时间格式: yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "phasedReleasePercent", + "M", + "String(10)", + "分阶段发布百分比,取值范围为0.00到100.00,必须精确到两位小数,不含百分号。" + ], + [ + "phasedReleaseDescription", + "M", + "String(500)", + "分阶段发布说明。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section14914606" + } + ], + "title": "查询应用信息", + "updatedAt": "2025-11-21 17:52", + "checkedAt": "2026-10-07T02:52:24.177Z", + "family": "publishing", + "endpoint": "app-info-query" +} diff --git a/pkg/domain/reference/publishing/app-info-query.parameters.json b/pkg/domain/reference/publishing/app-info-query.parameters.json new file mode 100644 index 0000000..bcb2679 --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-query.parameters.json @@ -0,0 +1,38 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "需要查询的应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165" + }, + { + "name": "lang", + "in": "query", + "type": "string", + "required": false, + "description": "需要查询的语言,取值参考语言类型。不传该参数则查询全部语言的应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165" + }, + { + "name": "releaseType", + "in": "query", + "type": "integer", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section420734618165", + "enum": [ + "1", + "3" + ] + } +] diff --git a/pkg/domain/reference/publishing/app-info-query.rules.json b/pkg/domain/reference/publishing/app-info-query.rules.json new file mode 100644 index 0000000..45c645f --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-query.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/app-info-update-v3.constraints.json b/pkg/domain/reference/publishing/app-info-update-v3.constraints.json new file mode 100644 index 0000000..b08dec6 --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-update-v3.constraints.json @@ -0,0 +1,116 @@ +{ + "query.appId": { + "maxLength": 32 + }, + "query.releaseType": { + "enum": [ + "1" + ] + }, + "query.releasePhase": { + "enum": [ + "0", + "3" + ] + }, + "body.defaultLang": { + "maxLength": 16 + }, + "body.privacyPolicy": { + "maxLength": 255 + }, + "body.appNetType": { + "enum": [ + "1", + "2" + ] + }, + "body.publishCountry": { + "maxLength": 2048 + }, + "body.appTariffType": { + "maxLength": 16 + }, + "body.publicationNumber": { + "maxLength": 50 + }, + "body.developerWebsite": { + "maxLength": 255 + }, + "body.privacyRightsUrl": { + "maxLength": 256 + }, + "body.registeredDclType": { + "enum": [ + "-1", + "0", + "1", + "2" + ] + }, + "body.registeredIdType": { + "enum": [ + "-1", + "1", + "2", + "3" + ] + }, + "body.registeredIdNumber": { + "maxLength": 64 + }, + "body.registeredEntity": { + "enum": [ + "1", + "2" + ] + }, + "body.registeredEntityName": { + "maxLength": 1024 + }, + "body.privacyAgreementId": { + "maxLength": 32 + }, + "body.userAgreementUrl": { + "maxLength": 512 + }, + "body.userAgreementIds": { + "maxItems": 5 + }, + "body.encrypted": { + "enum": [ + "0", + "1" + ] + }, + "body.isAiGenerate": { + "enum": [ + "0", + "1" + ] + }, + "body.testUserName": { + "maxLength": 128 + }, + "body.testUserPassword": { + "maxLength": 128 + }, + "body.appRemark": { + "maxLength": 300 + }, + "body.selfTestVideos": { + "maxLength": 2000 + }, + "body.appReviewName": { + "maxLength": 256 + }, + "body.versionVocs": { + "maxItems": 1000 + }, + "body.kindSubTags": { + "maxItems": 4 + }, + "body.aiTypes": { + "enum": [] + } +} diff --git a/pkg/domain/reference/publishing/app-info-update-v3.json b/pkg/domain/reference/publishing/app-info-update-v3.json new file mode 100644 index 0000000..01ccbb4 --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-update-v3.json @@ -0,0 +1,527 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section32016488332", + "text": "请求示例\nPUT /api/publish/v3/app-info?appId=10*****57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******\n{\n \"defaultLang\": \"zh-CN\",\n \"harmonyChildType\": 10000014,\n \"kindMainTag\": 30000017,\n \"kindSubTags\": [\n 30000017,\n 30000018\n ],\n \"privacyPolicy\": \"https://*****.link\",\n \"appNetType\": 0,\n \"publishCountry\": \"CN\",\n \"appTariffType\": \"6\",\n \"publicationNumber\": \"*****\",\n \"developerWebsite\": \"https://****.****test.cn/consumer/cn/service/josp/***/index.html\",\n \"customInfo\": {\n \"phone\": \"0086-137xxxxxxxx\",\n \"email\": \"137*****@***.com\",\n \"qqNum\": \"137*****\",\n \"internalPath\": \"华为应用市场 > 我的 > 帮助与客服\"\n },\n \"deviceTypes\": [\n {\n \"deviceType\": 4,\n \"appAdapters\": \"\"\n }\n ],\n \"privacyRightsUrl\": \"\",\n \"registeredIdType\": 2,\n \"registeredIdNumber\": \"1234222****1544487\",\n \"privacyAgreementId\": \"string\",\n \"userAgreementUrl\": \"https://docs.p***e.com/baike/328370\",\n \"userAgreementIds\": [\n \"12***************89\",\n \"23***************78\",\n \"34***************67\"\n ],\n \"encrypted\": 0,\n \"isAiGenerate\": 1,\n \"aiTypes\": [\n 1\n ],\n \"testUserName\": \"*****\",\n \"testUserPassword\": \"*****\",\n \"appRemark\": \"*****\",\n \"selfTestVideos\": \"{\"CN/2025102002/********.mp4\":\"文件名1\"}\",\n \"appReviewPhoneInfo\": {\n \"account\": \"137********\"\n },\n \"appReviewEmailInfo\": {\n \"account\": \"137*****@***.com\"\n },\n \"appReviewName\": \"*****\",\n \"versionVocReq\": [\n {\n \"versionId\": \"10*****528\",\n \"packageId\": \"1573*******5952\",\n \"vocId\": \"18******24\"\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section76943261515", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-countrycode-0000002236201362", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/20250303", + "title": "个人信息出境授权声明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "title": "CustInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "title": "VersionVoc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "title": "查询应用未处理的问题工单" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569", + "title": "更新应用语言信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section37920632", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section32016488332", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section24713355", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section76943261515", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section467913441938", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section37920632", + "text": "此接口用于更新指定HarmonyOS应用/元服务的应用详情。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section37920632", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520", + "text": "请求Body中使用JSON格式携带更新的应用信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/app-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "需要更新的应用ID。" + ], + [ + "releaseType", + "O", + "Integer(32)", + "应用发布方式。 取值范围: 1:全网 默认值:1" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section886219295206" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "defaultLang", + "O", + "String(16)", + "应用的默认语言。 说明 取值参见语言类型。" + ], + [ + "harmonyChildType", + "O", + "Integer(4)", + "HarmonyOS应用/元服务的二级分类。 固定ID。 说明 取值参见应用游戏分类。" + ], + [ + "kindMainTag", + "O", + "Integer(4)", + "HarmonyOS应用/元服务主标签。 固定ID。 说明 取值参见应用游戏分类的“标签”列。" + ], + [ + "kindSubTags", + "O", + "List", + "HarmonyOS应用/元服务附属标签。 固定ID。最多可选4个附属标签。 说明 取值参见应用游戏分类的“标签”列。" + ], + [ + "privacyPolicy", + "O", + "String(255)", + "隐私政策网址。" + ], + [ + "appNetType", + "O", + "Integer", + "应用联网类型。 取值范围: 1:单机 2:网游 默认值:1" + ], + [ + "publishCountry", + "M", + "String(2048)", + "应用发布国家的国家码。 多个国家以英文逗号分隔,例如:“CN,DE,MC”。 如果取值为“OTHER”,则表示当App Gallery支持的国家或地区列表中新增某个国家或地区时,应用将自动分发到新增的国家和地区。 注意 取值不能只包含OTHER。 如果国家码有设置非CN的地区,将存在个人信息出境的情况,具体请参考个人信息出境授权声明。" + ], + [ + "appTariffType", + "O", + "String(16)", + "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 支持设置多个,使用英文逗号分隔,例如“1,2,3”。" + ], + [ + "publicationNumber", + "O", + "String(50)", + "版号信息。 此参数只支持游戏类应用。" + ], + [ + "developerWebsite", + "O", + "String(255)", + "开发者官网。" + ], + [ + "customInfo", + "O", + "CustInfo", + "客服信息。" + ], + [ + "deviceTypes", + "O", + "List", + "设备类型信息。" + ], + [ + "privacyRightsUrl", + "O", + "String(256)", + "隐私权利网址。 即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。" + ], + [ + "registeredDclType", + "O", + "Integer(32)", + "APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP" + ], + [ + "registeredIdType", + "O", + "Integer(32)", + "主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码)" + ], + [ + "registeredIdNumber", + "O", + "String(64)", + "主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码" + ], + [ + "registeredEntity", + "O", + "Integer(32)", + "主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 若在版本提交时,该字段值选择“一致”,则主办单位名称和证件号,将直接复用开发者联盟注册账号信息。 若您提交的主办单位信息与联盟账号信息不一致,该字段值却选择了“一致”,则系统将自动判定为“不一致”,将会影响审核结果。" + ], + [ + "registeredEntityName", + "O", + "String(1024)", + "主办单位名称。 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。" + ], + [ + "privacyAgreementId", + "O", + "String(32)", + "隐私协议ID。" + ], + [ + "userAgreementUrl", + "O", + "String(512)", + "用户协议URL。" + ], + [ + "userAgreementIds", + "O", + "List", + "用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。" + ], + [ + "encrypted", + "M", + "Integer(32)", + "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1" + ], + [ + "isAiGenerate", + "O", + "Integer(32)", + "是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。" + ], + [ + "aiTypes", + "O", + "List", + "涉及的AI生成合成服务类型。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景 说明 isAiGenerate取值为1(涉及)时,此参数必填。" + ], + [ + "testUserName", + "O", + "String(128)", + "应用审核信息的测试账号用户名。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号用户名。" + ], + [ + "testUserPassword", + "O", + "String(128)", + "应用审核信息的测试账号密码。 说明 如果存在需要登录后才可使用的功能,需要提供测试账号密码。" + ], + [ + "appRemark", + "O", + "String(300)", + "应用审核信息的备注。 提供有助于审核人员更准确、高效测试您应用的额外信息,比如在审核时需要的特别设置等。" + ], + [ + "selfTestVideos", + "O", + "String(2000)", + "应用审核信息的自测文件。 格式为JSON字符串,示例:{\"objectId1\":\"文件名1\",\"objectId2\":\"文件名2\"...} 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 最多可上传5个自测视频,总大小不超过500MB。 注意 此字段只支持元服务。 元服务需要与设备联动时,此参数必填。" + ], + [ + "appReviewPhoneInfo", + "O", + "AppReviewContact", + "应用负责人的手机号信息。用于沟通审核问题。" + ], + [ + "appReviewEmailInfo", + "O", + "AppReviewContact", + "应用负责人的邮箱账号信息。用于接收上架审核结果,应用整改或下架通知。" + ], + [ + "appReviewName", + "O", + "String(256)", + "应用负责人的姓名。" + ], + [ + "versionVocs", + "O", + "List", + "应用版本已解决问题。 数组长度不超过1000。 说明 调用查询应用未处理的问题工单接口可以查询用户反馈的应用问题。如果在应用版本更新时某些问题已经解决,可以将这些问题提交审核,工单平台验证通过后会关闭工单。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section24713355" + } + ], + "title": "更新应用基本信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:11:38.645Z" +} diff --git a/pkg/domain/reference/publishing/app-info-update-v3.rules.json b/pkg/domain/reference/publishing/app-info-update-v3.rules.json new file mode 100644 index 0000000..9ba0e19 --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-update-v3.rules.json @@ -0,0 +1,38 @@ +[ + { + "id": "ai-service-types", + "kind": "required_if", + "field": "body.aiTypes", + "when": { + "field": "body.isAiGenerate", + "equals": "1" + }, + "message": "涉及AI生成合成服务时必须提供 aiTypes。", + "suggestion": "添加 --field aiTypes=JSON数组,按官网填写实际涉及的服务类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520" + }, + { + "id": "mainland-entity", + "kind": "required_if", + "field": "body.registeredEntity", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "message": "APP服务器在中国大陆时必须填写主办单位。", + "suggestion": "根据实际账号主体关系填写 registeredEntity(1或2)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520" + }, + { + "id": "mainland-entity-name", + "kind": "required_if", + "field": "body.registeredEntityName", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "message": "APP服务器在中国大陆时必须填写主办单位名称。", + "suggestion": "填写实际主办单位名称 registeredEntityName。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246#section17512144171520" + } +] diff --git a/pkg/domain/reference/publishing/app-info-update.json b/pkg/domain/reference/publishing/app-info-update.json new file mode 100644 index 0000000..4cd0d4e --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-update.json @@ -0,0 +1,495 @@ +{ + "examples": [ + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section76943261515", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section37920632", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section12531813163019", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section24713355", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section76943261515", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section1026325810439", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-langtype-0000001158245079", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-apptype-0000001158365069", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-pricechange-0000001111845112", + "title": "价格换算规则" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-pricechange-0000001111845112", + "title": "价格换算规则" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#ZH-CN_TOPIC_0000001111685198__zh-cn_topic_0000001059070156_p17819165272318", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057", + "title": "更新语言描述信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section37920632", + "text": "此接口用于更新指定应用的应用详情。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section12531813163019", + "text": "本接口暂不支持俄罗斯个人开发者。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "text": "请求Body中使用JSON格式携带更新的应用信息,参数如下表所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "text": "DeviceTypeInfo" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section1026325810439", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1" + ], + [ + "appId", + "M", + "String", + "需要更新的应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section886219295206" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "defaultLang", + "O", + "String(64)", + "应用的默认语言,取值参见语言类型。" + ], + [ + "childType", + "O", + "Integer(4)", + "应用的二级分类,固定ID,取值参见应用游戏分类。" + ], + [ + "grandChildType", + "O", + "Integer(4)", + "应用的三级分类,固定ID,取值参见应用游戏分类。" + ], + [ + "privacyPolicy", + "M", + "String(255)", + "隐私声明地址。" + ], + [ + "appNetType", + "O", + "Integer(1)", + "应用联网类型。 取值范围: 1:单机 2:网游" + ], + [ + "isFree", + "O", + "Integer(1)", + "应用付费类型。 取值范围: 1:免费 0:付费 如果isFree为1,price和priceDetail参数将无效。" + ], + [ + "price", + "O", + "String(256)", + "应用价格,格式为{\"countryCode\":\"price\"}。countryCode为国家码,price为应用的价格。国家码列表请参见国家码,对应币种请参见ISO 4217标准。 AppGallery Connect会根据所在国家/地区的价格规则对最终价格做适当调整,具体规则请参见价格换算规则。 注意 当isFree为0时,此参数必选。" + ], + [ + "priceDetail", + "O", + "String(8192)", + "应用在不同国家或地区的价格,json数组格式,不同国家和地区之间使用逗号分隔,例如:[{\"country\":\"CN\",\"currency\":\"CNY\",\"price\":\"18.00\"},{{\"country\":\"DE\",\"currency\":\"EUR\",\"price\":\"2.50\"}}]。 其中,country为国家码,currency为国家码所对应的币种,price为应用价格。国家码列表请参见国家码,对应币种请参见ISO 4217标准。 AppGallery Connect会根据所在国家/地区的价格规则对最终价格做适当调整,具体规则请参见价格换算规则。 注意 当isFree为0时,此参数必选。" + ], + [ + "publishCountry", + "O", + "String(2048)", + "应用发布国家的国家码,多个国家以英文逗号分隔,例如:“CN,DE,MC”。如果取值为“OTHER”,表示当AppGallery支持的国家或地区列表中新增某个国家或地区时,应用将自动分发到新增的国家和地区。国家码列表请参见国家码。 注意 取值不能只包含OTHER。" + ], + [ + "isAppForcedUpdate", + "O", + "Integer(1)", + "应用是否强制升级。 取值范围: 0:不强制 1:强制" + ], + [ + "hispaceAutoDown", + "O", + "Integer(1)", + "是否允许华为应用市场抓包。 取值范围: 0:不允许 1:允许" + ], + [ + "appTariffType", + "O", + "String(16)", + "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 支持设置多个,使用英文逗号分隔,例如“1,2,3”。" + ], + [ + "publicationNumber", + "O", + "String(50)", + "版号信息。 此参数只支持游戏类应用。" + ], + [ + "cultureRecordNumber", + "O", + "String(50)", + "文化部备案编号。 此参数只支持游戏类应用。" + ], + [ + "developerWebsite", + "O", + "String(255)", + "开发者官网。" + ], + [ + "familyShareTag", + "O", + "Integer(1)", + "是否可以家庭共享。 取值范围: 0:不可以。 1:可以。" + ], + [ + "deviceTypes", + "O", + "List", + "设备类型信息。" + ], + [ + "webGameFlag", + "O", + "Integer", + "该应用是否为网页游戏。 取值范围: 0:否 1:是 该参数仅在应用为手机RPK游戏,且设备类型信息中适配设备类型包含Windows(appAdapters取值包含15)时才会生效。" + ], + [ + "privacyRightsUrl", + "O", + "String(256)", + "隐私权利网址,即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。" + ], + [ + "registeredDclType", + "O", + "Integer(32)", + "APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP" + ], + [ + "registeredIdType", + "O", + "Integer(32)", + "主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码)" + ], + [ + "registeredIdNumber", + "O", + "String(64)", + "主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码" + ], + [ + "registeredEntity", + "O", + "Integer(32)", + "主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 若在版本提交时,该字段值选择“一致”,则主办单位名称和证件号,将直接复用开发者联盟注册账号信息。 若您提交的主办单位信息与联盟账号信息不一致,该字段值却选择了“一致”,则系统将自动判定为“不一致”,将会影响审核结果。" + ], + [ + "registeredEntityName", + "O", + "String(1024)", + "主办单位名称。 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。" + ], + [ + "userAgreementUrl", + "O", + "String(512)", + "用户协议URL。" + ], + [ + "encrypted", + "O", + "Integer(32)", + "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 取值范围: 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机" + ], + [ + "appAdapters", + "M", + "String", + "适配设备类型,多个类型以英文逗号分隔。 取值范围: 1:荣耀立方(路由器) 4:手机 5:平板 6:VR 7:手表 8:大屏 9:路由器 11:儿童表 12:智能手表 13:带屏音响 15:Windows APK类型的软件包约束如下: 当deviceType为4时,appAdapters可选范围为:4,5,7(如果有7,4也必须选择),15(受限开放,需要联系华为运营开通) 当deviceType为6时,appAdapters可选范围为:4, 5。 当deviceType为7时,appAdapters可选范围为:11,12。 当deviceType为8时,appAdapters可选范围为:1,3,8。 RPK类型的软件包约束如下: 当deviceType为4时,appAdapters可选范围为:4,5,15 注意 修改设备类型信息时此字段必选,否则传入deviceType后会此参数会被置为空。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section24713355" + } + ], + "title": "更新应用基本信息", + "updatedAt": "2026-09-14 08:56", + "checkedAt": "2026-10-07T04:48:08.197Z" +} diff --git a/pkg/domain/reference/publishing/app-info-update.parameters.json b/pkg/domain/reference/publishing/app-info-update.parameters.json new file mode 100644 index 0000000..3dc0fce --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-update.parameters.json @@ -0,0 +1,322 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165" + }, + { + "name": "releaseType", + "in": "query", + "type": "integer", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section886219295206", + "enum": [ + "1", + "3" + ] + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "需要更新的应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section886219295206" + }, + { + "name": "defaultLang", + "in": "body", + "type": "string", + "required": false, + "description": "应用的默认语言,取值参见语言类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 64 + }, + { + "name": "childType", + "in": "body", + "type": "integer", + "required": false, + "description": "应用的二级分类,固定ID,取值参见应用游戏分类。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520" + }, + { + "name": "grandChildType", + "in": "body", + "type": "integer", + "required": false, + "description": "应用的三级分类,固定ID,取值参见应用游戏分类。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520" + }, + { + "name": "privacyPolicy", + "in": "body", + "type": "string", + "required": true, + "description": "隐私声明地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 255 + }, + { + "name": "appNetType", + "in": "body", + "type": "integer", + "required": false, + "description": "应用联网类型。 取值范围: 1:单机 2:网游", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "1", + "2" + ] + }, + { + "name": "isFree", + "in": "body", + "type": "integer", + "required": false, + "description": "应用付费类型。 取值范围: 1:免费 0:付费 如果isFree为1,price和priceDetail参数将无效。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ] + }, + { + "name": "price", + "in": "body", + "type": "string", + "required": false, + "description": "应用价格,格式为{\"countryCode\":\"price\"}。countryCode为国家码,price为应用的价格。国家码列表请参见国家码,对应币种请参见ISO 4217标准。 AppGallery Connect会根据所在国家/地区的价格规则对最终价格做适当调整,具体规则请参见价格换算规则。 注意 当isFree为0时,此参数必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 256 + }, + { + "name": "priceDetail", + "in": "body", + "type": "string", + "required": false, + "description": "应用在不同国家或地区的价格,json数组格式,不同国家和地区之间使用逗号分隔,例如:[{\"country\":\"CN\",\"currency\":\"CNY\",\"price\":\"18.00\"},{{\"country\":\"DE\",\"currency\":\"EUR\",\"price\":\"2.50\"}}]。 其中,country为国家码,currency为国家码所对应的币种,price为应用价格。国家码列表请参见国家码,对应币种请参见ISO 4217标准。 AppGallery Connect会根据所在国家/地区的价格规则对最终价格做适当调整,具体规则请参见价格换算规则。 注意 当isFree为0时,此参数必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 8192 + }, + { + "name": "publishCountry", + "in": "body", + "type": "string", + "required": false, + "description": "应用发布国家的国家码,多个国家以英文逗号分隔,例如:“CN,DE,MC”。如果取值为“OTHER”,表示当AppGallery支持的国家或地区列表中新增某个国家或地区时,应用将自动分发到新增的国家和地区。国家码列表请参见国家码。 注意 取值不能只包含OTHER。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 2048 + }, + { + "name": "isAppForcedUpdate", + "in": "body", + "type": "integer", + "required": false, + "description": "应用是否强制升级。 取值范围: 0:不强制 1:强制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ] + }, + { + "name": "hispaceAutoDown", + "in": "body", + "type": "integer", + "required": false, + "description": "是否允许华为应用市场抓包。 取值范围: 0:不允许 1:允许", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ] + }, + { + "name": "appTariffType", + "in": "body", + "type": "string", + "required": false, + "description": "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 支持设置多个,使用英文逗号分隔,例如“1,2,3”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 16 + }, + { + "name": "publicationNumber", + "in": "body", + "type": "string", + "required": false, + "description": "版号信息。 此参数只支持游戏类应用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 50 + }, + { + "name": "cultureRecordNumber", + "in": "body", + "type": "string", + "required": false, + "description": "文化部备案编号。 此参数只支持游戏类应用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 50 + }, + { + "name": "developerWebsite", + "in": "body", + "type": "string", + "required": false, + "description": "开发者官网。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 255 + }, + { + "name": "familyShareTag", + "in": "body", + "type": "integer", + "required": false, + "description": "是否可以家庭共享。 取值范围: 0:不可以。 1:可以。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ] + }, + { + "name": "deviceTypes", + "in": "body", + "type": "array", + "required": false, + "description": "设备类型信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "itemsType": "object", + "itemsProperties": [ + { + "name": "deviceType", + "in": "body", + "type": "integer", + "required": true, + "description": "设备类型。 取值范围: 4:手机 6:VR 7:手表 8:大屏 9:路由器 10:车机", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "4", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "name": "appAdapters", + "in": "body", + "type": "string", + "required": true, + "description": "适配设备类型,多个类型以英文逗号分隔。 取值范围: 1:荣耀立方(路由器) 4:手机 5:平板 6:VR 7:手表 8:大屏 9:路由器 11:儿童表 12:智能手表 13:带屏音响 15:Windows APK类型的软件包约束如下: 当deviceType为4时,appAdapters可选范围为:4,5,7(如果有7,4也必须选择),15(受限开放,需要联系华为运营开通) 当deviceType为6时,appAdapters可选范围为:4, 5。 当deviceType为7时,appAdapters可选范围为:11,12。 当deviceType为8时,appAdapters可选范围为:1,3,8。 RPK类型的软件包约束如下: 当deviceType为4时,appAdapters可选范围为:4,5,15 注意 修改设备类型信息时此字段必选,否则传入deviceType后会此参数会被置为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520" + } + ] + }, + { + "name": "webGameFlag", + "in": "body", + "type": "integer", + "required": false, + "description": "该应用是否为网页游戏。 取值范围: 0:否 1:是 该参数仅在应用为手机RPK游戏,且设备类型信息中适配设备类型包含Windows(appAdapters取值包含15)时才会生效。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ] + }, + { + "name": "privacyRightsUrl", + "in": "body", + "type": "string", + "required": false, + "description": "隐私权利网址,即关于您的用户实施其权利的网站地址,如用户删除、修改、导出其个人数据的入口。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 256 + }, + { + "name": "registeredDclType", + "in": "body", + "type": "integer", + "required": false, + "description": "APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "-1", + "0", + "1", + "2" + ] + }, + { + "name": "registeredIdType", + "in": "body", + "type": "integer", + "required": false, + "description": "主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码)", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "-1", + "1", + "2", + "3" + ] + }, + { + "name": "registeredIdNumber", + "in": "body", + "type": "string", + "required": false, + "description": "主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 64 + }, + { + "name": "registeredEntity", + "in": "body", + "type": "integer", + "required": false, + "description": "主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。 若在版本提交时,该字段值选择“一致”,则主办单位名称和证件号,将直接复用开发者联盟注册账号信息。 若您提交的主办单位信息与联盟账号信息不一致,该字段值却选择了“一致”,则系统将自动判定为“不一致”,将会影响审核结果。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "1", + "2" + ] + }, + { + "name": "registeredEntityName", + "in": "body", + "type": "string", + "required": false, + "description": "主办单位名称。 说明 当registeredDclType值为0(APP服务器在中国大陆)时,该字段必填。若不填写或填写错误,会导致审核不通过。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 1024 + }, + { + "name": "userAgreementUrl", + "in": "body", + "type": "string", + "required": false, + "description": "用户协议URL。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "maxLength": 512 + }, + { + "name": "encrypted", + "in": "body", + "type": "integer", + "required": false, + "description": "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference/publishing/app-info-update.rules.json b/pkg/domain/reference/publishing/app-info-update.rules.json new file mode 100644 index 0000000..7a0c394 --- /dev/null +++ b/pkg/domain/reference/publishing/app-info-update.rules.json @@ -0,0 +1,61 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + }, + { + "id": "conditional-price", + "kind": "required_if", + "field": "body.price", + "when": { + "field": "body.isFree", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "price is required when isFree=0.", + "suggestion": "Supply price for the selected application settings." + }, + { + "id": "conditional-priceDetail", + "kind": "required_if", + "field": "body.priceDetail", + "when": { + "field": "body.isFree", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "priceDetail is required when isFree=0.", + "suggestion": "Supply priceDetail for the selected application settings." + }, + { + "id": "conditional-registeredEntity", + "kind": "required_if", + "field": "body.registeredEntity", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "registeredEntity is required when registeredDclType=0.", + "suggestion": "Supply registeredEntity for the selected application settings." + }, + { + "id": "conditional-registeredEntityName", + "kind": "required_if", + "field": "body.registeredEntityName", + "when": { + "field": "body.registeredDclType", + "equals": "0" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198#section17512144171520", + "message": "registeredEntityName is required when registeredDclType=0.", + "suggestion": "Supply registeredEntityName for the selected application settings." + } +] diff --git a/pkg/domain/reference/publishing/app-package-info-query.constraints.json b/pkg/domain/reference/publishing/app-package-info-query.constraints.json new file mode 100644 index 0000000..b631c61 --- /dev/null +++ b/pkg/domain/reference/publishing/app-package-info-query.constraints.json @@ -0,0 +1,8 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "query.packageId": { + "maxLength": 32 + } +} diff --git a/pkg/domain/reference/publishing/app-package-info-query.json b/pkg/domain/reference/publishing/app-package-info-query.json new file mode 100644 index 0000000..9ca9032 --- /dev/null +++ b/pkg/domain/reference/publishing/app-package-info-query.json @@ -0,0 +1,269 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section1067322214331", + "text": "请求示例\nGET /api/publish/v2/app-package-info?packageId=10004151 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success.\"\n },\n \"packageInfo\": {\n \"packageId\": \"16****60\",\n \"fileName\": \"pe****.app\",\n \"versionCode\": 1000000,\n \"versionName\": \"1.0.0\",\n \"buildVersion\": \"10.10.50\",\n \"allPermissions\": [\n {\n \"id\": \"ohos.permission.WRITE_CONTACTS\",\n \"deviceMultiReasons\": [\n {\n \"lang\": \"zh_CN\",\n \"reason\": \"label1\",\n \"videoUrl\": \"https://****/CN/2024121101/****\"\n }\n ]\n },\n {\n \"id\": \"hos.permission.READ_CONTACTS\",\n \"deviceMultiReasons\": [\n {\n \"lang\": \"zh_CN\",\n \"reason\": \"label2\",\n \"videoUrl\": \"https://****/CN/2024121101/****\"\n }\n ]\n }\n ]\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packageinfo-0000002328964965", + "title": "PackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625", + "title": "更新分阶段发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "title": "查询软件包编译状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section165302018915", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section992664711544", + "text": "此接口用于查询HarmonyOS应用/元服务的软件包信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-package-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "packageId", + "M", + "String(32)", + "待查询的软件包ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section165302018915" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "packageInfo", + "M", + "PackageInfo", + "软件包信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#section163825114565" + } + ], + "title": "查询应用软件包信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:01.749Z", + "family": "publishing", + "endpoint": "app-package-info-query" +} diff --git a/pkg/domain/reference/publishing/app-package-info-update.constraints.json b/pkg/domain/reference/publishing/app-package-info-update.constraints.json new file mode 100644 index 0000000..b70dc75 --- /dev/null +++ b/pkg/domain/reference/publishing/app-package-info-update.constraints.json @@ -0,0 +1,19 @@ +{ + "query.releaseType": { + "enum": [ + "1" + ] + }, + "query.releasePhase": { + "enum": [ + "0", + "3" + ] + }, + "body.fileName": { + "maxLength": 255 + }, + "body.objectId": { + "maxLength": 512 + } +} diff --git a/pkg/domain/reference/publishing/app-package-info-update.json b/pkg/domain/reference/publishing/app-package-info-update.json new file mode 100644 index 0000000..700e7e0 --- /dev/null +++ b/pkg/domain/reference/publishing/app-package-info-update.json @@ -0,0 +1,316 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section11786182613149", + "text": "请求示例\nPUT /api/publish/v3/app-package-info?appId=10******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 4141******68\nContent-Type: application/json\nAuthorization: Bearer *******\n{\n \"fileName\": \"c******d.app\",\n \"objectId\": \"CN/2024112702/*****.app\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1234123113169", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"packageId\": \"1573*******5952\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469#ZH-CN_TOPIC_0000002328848469__p2219104885313", + "title": "packageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "title": "查询软件包编译状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430", + "title": "更新应用文件信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573", + "title": "更新版本上架时间" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section41694086", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section156021546155912", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1131102811712", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section11786182613149", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section19172900", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1234123113169", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section41694086", + "text": "APP软件包上传完成后,通过该接口刷新HarmonyOS应用/元服务的软件包信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section41694086", + "text": "该接口支持解析软件包中的构建版本号(buildVersion),用于区分同一主版本下的不同测试子版本。解析完成后,可以从查询应用软件包信息接口返回的packageInfo参数中获取buildVersion字段。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section41694086", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1131102811712", + "text": "请求Body中使用JSON格式携带更新的应用软件包信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/app-package-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "需要更新的应用ID。" + ], + [ + "releaseType", + "O", + "Integer(32)", + "应用发布方式。 取值范围: 1:全网 默认值:1" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section156021546155912" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileName", + "M", + "String(255)", + "文件名称,包括文件的后缀名。" + ], + [ + "objectId", + "M", + "String(512)", + "文件在文件服务器中的对象ID。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section1131102811712" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "packageId", + "O", + "String(32)", + "软件包上传后内部id,用于查询软件包编译状态接口调用。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section19172900" + } + ], + "title": "更新应用软件包信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:46.452Z", + "family": "publishing", + "endpoint": "app-package-info-update" +} diff --git a/pkg/domain/reference/publishing/app-shelf-off.constraints.json b/pkg/domain/reference/publishing/app-shelf-off.constraints.json new file mode 100644 index 0000000..b7d945a --- /dev/null +++ b/pkg/domain/reference/publishing/app-shelf-off.constraints.json @@ -0,0 +1,13 @@ +{ + "query.appId": { + "maxLength": 32 + }, + "query.reason": { + "maxLength": 1024 + }, + "query.releaseType": { + "enum": [ + "1" + ] + } +} diff --git a/pkg/domain/reference/publishing/app-shelf-off.json b/pkg/domain/reference/publishing/app-shelf-off.json new file mode 100644 index 0000000..f621053 --- /dev/null +++ b/pkg/domain/reference/publishing/app-shelf-off.json @@ -0,0 +1,260 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section174799228118", + "text": "请求示例\nPOST /api/publish/v2/app-shelf-off?appId=1******57&reason=****** HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******7168\nContent-Type: application/json\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section1778017301360", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637", + "title": "撤销审核" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section37012609", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section64678032", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section656012300173", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section39863245", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section198511327144414", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section174799228118", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section23224890", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section1778017301360", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section37012609", + "text": "此接口用于对已经上架的应用进行下架处理。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section37012609", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section64678032", + "text": "本接口仅对允许清单内用户开放,普通Publishing API开发者请勿调用本接口。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-shelf-off" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section656012300173" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "需要下架的应用ID。" + ], + [ + "reason", + "M", + "String(1024)", + "下架的原因描述。 说明 中文字符需要进行URL编码后再传入。" + ], + [ + "releaseType", + "O", + "Integer", + "下架的方式。 取值范围: 1:全网下架。 默认值:1" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section198511327144414" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "O", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450#section23224890" + } + ], + "title": "下架应用", + "updatedAt": "2026-07-31 09:08", + "checkedAt": "2026-10-07T04:58:02.750Z", + "family": "publishing", + "endpoint": "app-shelf-off" +} diff --git a/pkg/domain/reference/publishing/app-submit-v3.constraints.json b/pkg/domain/reference/publishing/app-submit-v3.constraints.json new file mode 100644 index 0000000..c0fe8dd --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit-v3.constraints.json @@ -0,0 +1,25 @@ +{ + "query.appId": { + "maxLength": 32 + }, + "body.releaseTime": { + "maxLength": 64 + }, + "body.remark": { + "maxLength": 300 + }, + "body.releaseType": { + "enum": [ + "1" + ] + }, + "body.releasePhase": { + "enum": [ + "0", + "3" + ] + }, + "body.phasedReleaseDescription": { + "maxLength": 500 + } +} diff --git a/pkg/domain/reference/publishing/app-submit-v3.json b/pkg/domain/reference/publishing/app-submit-v3.json new file mode 100644 index 0000000..159e9ee --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit-v3.json @@ -0,0 +1,300 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section1945115411389", + "text": "请求示例\nPOST /api/publish/v3/app-submit HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json; \nAuthorization: Bearer *****\nappId: 1******57\n{\n \"releaseTime\": \"2015-01-01T01:01:01+0800\",\n \"remark\": \"\",\n \"releaseType\": 1,\n \"releasePhase\": 3,\n \"phasedReleaseDescription\": \"******\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section15251637114113", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262", + "title": "申请年龄分级" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637", + "title": "撤销审核" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section41670133", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section292816392364", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section1945115411389", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section63342526", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section15251637114113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section1936503617277", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section41670133", + "text": "此接口用于提交HarmonyOS应用/元服务审核,调用本接口前必须保证应用信息已补充完整,应用软件包已经上传。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section41670133", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section41670133", + "text": "软件包采用异步解析方式,请您在传包后等候2分钟再调用提交发布接口。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820", + "text": "Body中使用JSON格式携带发布信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/app-submit" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section292816392364" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "releaseTime", + "O", + "String(64)", + "指定发布时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 可以不用填写,则表示立刻发布。 说明 如果在首次提交发布时已设置过releaseTime参数,撤销审核后再次提交发布时,需要将releaseTime参数重新设置为过去的时间,才能实现立即发布。" + ], + [ + "remark", + "O", + "String(300)", + "提审发布备注。 可以为空,如果填写则长度范围为10-300。" + ], + [ + "releaseType", + "O", + "Integer(32)", + "应用发布方式。 取值范围: 1:全网 默认值:1" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网发布 3:分阶段发布(7天内自动更新) 默认值:0" + ], + [ + "phasedReleaseDescription", + "O", + "String(500)", + "分阶段发布说明。 说明 releasePhase取值为3(分阶段发布)时,此参数必填。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section63342526" + } + ], + "title": "提交发布", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:47.737Z", + "family": "publishing", + "endpoint": "app-submit-v3" +} diff --git a/pkg/domain/reference/publishing/app-submit-v3.rules.json b/pkg/domain/reference/publishing/app-submit-v3.rules.json new file mode 100644 index 0000000..7888f84 --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit-v3.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "phased-release-description", + "kind": "required_if", + "field": "body.phasedReleaseDescription", + "when": { + "field": "body.releasePhase", + "equals": "3" + }, + "message": "分阶段发布时必须提供 phasedReleaseDescription。", + "suggestion": "添加 --field phasedReleaseDescription=分阶段发布说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#section11431111271820" + } +] diff --git a/pkg/domain/reference/publishing/app-submit-with-file.json b/pkg/domain/reference/publishing/app-submit-with-file.json new file mode 100644 index 0000000..b150f66 --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit-with-file.json @@ -0,0 +1,459 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section13158161231318", + "text": "请求示例\nPOST /api/publish/v2/app-submit-with-file?appId=10*****57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****168\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"downloadUrl\": \"https://***7A7.apk\",\n \"downloadFileName\":\"PhotoPlaza.apk\",\n \"requestId\":\"1111\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section205497599139", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-notify-release-0000001158245063", + "title": "回调结果通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-query-0000001158365045", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-notify-release-0000001158245063", + "title": "回调结果通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#ZH-CN_TOPIC_0000001111845092__zh-cn_topic_0000001058910556_p113887247191", + "title": "PhasedReleaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061", + "title": "提交发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204", + "title": "更新分阶段发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section39581727", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section133mcpsimp", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section5528235174214", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section13158161231318", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section60996746", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section205497599139", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section91504289502", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section39581727", + "text": "如果您将软件包保存在自己的服务器上,可以直接调用本接口提交应用审核,并传入软件包的下载地址。华为服务器会自动从下载地址中下载软件包后启动发布流程。接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section39581727", + "text": "该接口需要在华为侧下载软件包并处理后上传,耗时较长,为异步接口。接口会立即响应成功,但这并不意味着最终发布成功。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section39581727", + "text": "您可以遵循回调结果通知接口的约束, 开发并提供回调能力,通过本接口的callbackAddr参数传入回调地址,用于接收软件包处理结果。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section39581727", + "text": "您也可以自行调用查询应用信息接口判断应用是否已经提交审核成功(releaseState为4),或者登录AppGallery Connect官网查看提审状态。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section133mcpsimp", + "text": "非中国大陆开发者如需使用该API,应用发布地区必须包含中国大陆。中国大陆开发者无限制。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "text": "请求Body中使用JSON格式携带详细的发布信息,参数如下表所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "text": "PhasedReleaseInfo" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section91504289502", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-submit-with-file" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section5528235174214" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "releaseTime", + "O", + "String(64)", + "指定发布时间,如果为空表示审核通过立即上架。UTC时间:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "remark", + "O", + "String(300)", + "提交发布的备注信息,可以为空,如果填写,长度范围在10-300。" + ], + [ + "releaseType", + "O", + "Integer", + "发布方式。 取值范围: 1:全网。 3:分阶段。 默认值:1" + ], + [ + "downloadUrl", + "M", + "String", + "由您提供的软件包下载地址,支持APK/RPK/AAB/EXE等。 APK:不超过4GB。 RPK:快应用不超过20MB,快游戏不超过30MB。 AAB:不超过150MB。 EXE(Windows应用): 不超过4GB。" + ], + [ + "downloadFileName", + "M", + "String(64)", + "downloadUrl下载地址中下载的文件名,包括后缀。" + ], + [ + "callbackAddr", + "O", + "String", + "应用发布回调地址,由您自行配置。应用发布结果由华为服务器调用回调结果通知接口通过该URL回调给您的开发者服务器。" + ], + [ + "requestId", + "M", + "String", + "您自定义的请求字符串,必须唯一标识此请求。结果回调时会携带该字段。" + ], + [ + "clearArk", + "O", + "String", + "是否清除方舟包(用于Android + 方舟升级到Android)。 取值范围: 1:需要清除方舟包。 0:不需要清除方舟包。 默认值:0。" + ], + [ + "sensitivePermissionDesc", + "O", + "String", + "敏感信息。" + ], + [ + "phasedReleaseInfo", + "O", + "PhasedReleaseInfo", + "分阶段发布信息。releaseType为3时,此参数必选。" + ], + [ + "versionName", + "O", + "String", + "Windows应用的软件包版本号。 文件类型为exe软件包时必选。" + ], + [ + "displayName", + "O", + "String", + "注册表显示名称,用于唯一标识Windows用。 文件类型为exe软件包时必选。" + ], + [ + "isPureDetection", + "O", + "Integer", + "是否申请绿色应用认证。 取值范围: 0:否 1:是" + ], + [ + "sensitivePermissionIconUrl", + "O", + "String", + "绿色认证审核材料的objectId,isPureDetection=1时为必填项。该值为将绿色认证审核材料打成zip包,然后先调用获取上传文件地址接口,然后调用上传文件接口上传审核材料,最后得到获取上传文件地址接口返回的objectId。" + ], + [ + "isCommitSensitivePermissionTips", + "O", + "boolean", + "是否确认符合相关要求,true表示符合。isPureDetection=1时为必填项,且只可以填true。要求包括: 非必要的使用场景禁止桌面、锁屏和其他应用弹出窗口骚扰用户行为。 非必要的使用场景禁止发送无法删除的常驻通知。 禁止影响用户体验的广告,如抬头、强制插屏、侧边等。 禁止引导用户开启开发者选项。 禁止引导用户开启USB调试模式。 禁止通过热补丁,引入恶意行为和不符合以上条款的行为。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "state", + "O", + "String", + "此参数无需设置。" + ], + [ + "phasedReleaseStartTime", + "M", + "String(64)", + "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "phasedReleaseEndTime", + "M", + "String(64)", + "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "phasedReleasePercent", + "M", + "String(10)", + "分阶段发布百分比,取值范围为0.00到100.00,必须精确到两位小数,不含百分号。" + ], + [ + "phasedReleaseDescription", + "M", + "String(500)", + "分阶段发布说明。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section60996746" + } + ], + "title": "通过下载方式提交发布", + "updatedAt": "2026-01-21 16:29", + "checkedAt": "2026-10-07T02:52:28.134Z", + "family": "publishing", + "endpoint": "app-submit-with-file" +} diff --git a/pkg/domain/reference/publishing/app-submit-with-file.parameters.json b/pkg/domain/reference/publishing/app-submit-with-file.parameters.json new file mode 100644 index 0000000..ef94b82 --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit-with-file.parameters.json @@ -0,0 +1,195 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section5528235174214" + }, + { + "name": "releaseTime", + "in": "body", + "type": "string", + "required": false, + "description": "指定发布时间,如果为空表示审核通过立即上架。UTC时间:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64 + }, + { + "name": "remark", + "in": "body", + "type": "string", + "required": false, + "description": "提交发布的备注信息,可以为空,如果填写,长度范围在10-300。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 300 + }, + { + "name": "releaseType", + "in": "body", + "type": "integer", + "required": false, + "description": "发布方式。 取值范围: 1:全网。 3:分阶段。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "enum": [ + "1", + "3" + ] + }, + { + "name": "downloadUrl", + "in": "body", + "type": "string", + "required": true, + "description": "由您提供的软件包下载地址,支持APK/RPK/AAB/EXE等。 APK:不超过4GB。 RPK:快应用不超过20MB,快游戏不超过30MB。 AAB:不超过150MB。 EXE(Windows应用): 不超过4GB。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "downloadFileName", + "in": "body", + "type": "string", + "required": true, + "description": "downloadUrl下载地址中下载的文件名,包括后缀。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64 + }, + { + "name": "callbackAddr", + "in": "body", + "type": "string", + "required": false, + "description": "应用发布回调地址,由您自行配置。应用发布结果由华为服务器调用回调结果通知接口通过该URL回调给您的开发者服务器。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "requestId", + "in": "body", + "type": "string", + "required": true, + "description": "您自定义的请求字符串,必须唯一标识此请求。结果回调时会携带该字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "clearArk", + "in": "body", + "type": "string", + "required": false, + "description": "是否清除方舟包(用于Android + 方舟升级到Android)。 取值范围: 1:需要清除方舟包。 0:不需要清除方舟包。 默认值:0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "sensitivePermissionDesc", + "in": "body", + "type": "string", + "required": false, + "description": "敏感信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "phasedReleaseInfo", + "in": "body", + "type": "object", + "required": false, + "description": "分阶段发布信息。releaseType为3时,此参数必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "properties": [ + { + "name": "state", + "in": "body", + "type": "string", + "required": false, + "description": "此参数无需设置。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "phasedReleaseStartTime", + "in": "body", + "type": "string", + "required": true, + "description": "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64 + }, + { + "name": "phasedReleaseEndTime", + "in": "body", + "type": "string", + "required": true, + "description": "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 64 + }, + { + "name": "phasedReleasePercent", + "in": "body", + "type": "string", + "required": true, + "description": "分阶段发布百分比,取值范围为0.00到100.00,必须精确到两位小数,不含百分号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 10 + }, + { + "name": "phasedReleaseDescription", + "in": "body", + "type": "string", + "required": true, + "description": "分阶段发布说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "maxLength": 500 + } + ] + }, + { + "name": "versionName", + "in": "body", + "type": "string", + "required": false, + "description": "Windows应用的软件包版本号。 文件类型为exe软件包时必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "displayName", + "in": "body", + "type": "string", + "required": false, + "description": "注册表显示名称,用于唯一标识Windows用。 文件类型为exe软件包时必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "isPureDetection", + "in": "body", + "type": "integer", + "required": false, + "description": "是否申请绿色应用认证。 取值范围: 0:否 1:是", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910", + "enum": [ + "0", + "1" + ] + }, + { + "name": "sensitivePermissionIconUrl", + "in": "body", + "type": "string", + "required": false, + "description": "绿色认证审核材料的objectId,isPureDetection=1时为必填项。该值为将绿色认证审核材料打成zip包,然后先调用获取上传文件地址接口,然后调用上传文件接口上传审核材料,最后得到获取上传文件地址接口返回的objectId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + }, + { + "name": "isCommitSensitivePermissionTips", + "in": "body", + "type": "boolean", + "required": false, + "description": "是否确认符合相关要求,true表示符合。isPureDetection=1时为必填项,且只可以填true。要求包括: 非必要的使用场景禁止桌面、锁屏和其他应用弹出窗口骚扰用户行为。 非必要的使用场景禁止发送无法删除的常驻通知。 禁止影响用户体验的广告,如抬头、强制插屏、侧边等。 禁止引导用户开启开发者选项。 禁止引导用户开启USB调试模式。 禁止通过热补丁,引入恶意行为和不符合以上条款的行为。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section15344132481910" + } +] diff --git a/pkg/domain/reference/publishing/app-submit-with-file.rules.json b/pkg/domain/reference/publishing/app-submit-with-file.rules.json new file mode 100644 index 0000000..fba0b91 --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit-with-file.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/app-submit.json b/pkg/domain/reference/publishing/app-submit.json new file mode 100644 index 0000000..135c049 --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit.json @@ -0,0 +1,357 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section1945115411389", + "text": "请求示例\nPOST /api/publish/v2/app-submit?appId=10****57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json; \nAuthorization: Bearer *****" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section15251637114113", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-file-info-0000001111685202", + "title": "更新应用文件信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092", + "title": "通过下载方式提交发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section41670133", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section1945115411389", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section63342526", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section15251637114113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section125219373498", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section41670133", + "text": "此接口用于提交应用审核,调用本接口前必须保证应用信息已补充完整,应用软件包已经上传。接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section41670133", + "text": "软件包采用异步解析方式,请您在传包后等候2分钟再调用提交发布接口。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "text": "当releaseType为3时,请求Body中phasedReleaseStartTime,phasedReleaseEndTime,phasedReleaseDescription必填,其他情况不用填写。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "text": "Body中使用JSON格式携带发布信息,参数如下表所示。" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section125219373498", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-submit" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ], + [ + "releaseTime", + "O", + "String", + "指定发布的UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 说明 如果releaseTime未填写,应用审核通过后会立即上架。" + ], + [ + "remark", + "O", + "String", + "提审发布的备注信息,可以为空。如果填写,长度范围在10-300。" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网 3:分阶段 说明 应用发布方式为分阶段发布时,要求该应用存在一个已上架的版本。 默认值:1" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "state", + "O", + "String", + "此参数无需设置。" + ], + [ + "phasedReleaseStartTime", + "M", + "String(64)", + "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "phasedReleaseEndTime", + "M", + "String(64)", + "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "phasedReleasePercent", + "M", + "String(10)", + "分阶段发布百分比。 Android应用取值范围为0.00到100.00,必须精确到两位小数,不含百分号。 HarmonyOS应用取值为0.00到100.00,可以不带小数或只带一位小数,不含百分号。" + ], + [ + "phasedReleaseDescription", + "M", + "String(500)", + "分阶段发布说明。" + ], + [ + "isPureDetection", + "O", + "Integer", + "是否申请绿色应用认证。 取值范围: 0:否 1:是" + ], + [ + "sensitivePermissionIconUrl", + "O", + "String", + "绿色认证审核材料的objectId,isPureDetection=1时为必填项。该值为将绿色认证审核材料打成zip包,然后先调用获取上传文件地址接口,然后调用上传文件接口上传审核材料,最后得到获取上传文件地址接口返回的objectId。" + ], + [ + "isCommitSensitivePermissionTips", + "O", + "boolean", + "确认是否符合相关要求,true表示符合。isPureDetection=1时为必填项,且只可以填true。要求包括: 非必要的使用场景禁止桌面、锁屏和其他应用弹出窗口骚扰用户行为。 非必要的使用场景禁止发送无法删除的常驻通知。 禁止影响用户体验的广告,如抬头、强制插屏、侧边等。 禁止引导用户开启开发者选项。 禁止引导用户开启USB调试模式。 禁止通过热补丁,引入恶意行为和不符合以上条款的行为。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。具体返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section63342526" + } + ], + "title": "提交发布", + "updatedAt": "2025-08-25 13:48", + "checkedAt": "2026-10-07T02:52:26.711Z", + "family": "publishing", + "endpoint": "app-submit" +} diff --git a/pkg/domain/reference/publishing/app-submit.parameters.json b/pkg/domain/reference/publishing/app-submit.parameters.json new file mode 100644 index 0000000..8a5a47a --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit.parameters.json @@ -0,0 +1,118 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364" + }, + { + "name": "releaseTime", + "in": "query", + "type": "string", + "required": false, + "description": "指定发布的UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 说明 如果releaseTime未填写,应用审核通过后会立即上架。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364" + }, + { + "name": "remark", + "in": "query", + "type": "string", + "required": false, + "description": "提审发布的备注信息,可以为空。如果填写,长度范围在10-300。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364" + }, + { + "name": "releaseType", + "in": "query", + "type": "integer", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 说明 应用发布方式为分阶段发布时,要求该应用存在一个已上架的版本。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section292816392364", + "enum": [ + "1", + "3" + ] + }, + { + "name": "state", + "in": "body", + "type": "string", + "required": false, + "description": "此参数无需设置。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820" + }, + { + "name": "phasedReleaseStartTime", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 64 + }, + { + "name": "phasedReleaseEndTime", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 64 + }, + { + "name": "phasedReleasePercent", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布百分比。 Android应用取值范围为0.00到100.00,必须精确到两位小数,不含百分号。 HarmonyOS应用取值为0.00到100.00,可以不带小数或只带一位小数,不含百分号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 10 + }, + { + "name": "phasedReleaseDescription", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "maxLength": 500 + }, + { + "name": "isPureDetection", + "in": "body", + "type": "integer", + "required": false, + "description": "是否申请绿色应用认证。 取值范围: 0:否 1:是", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "enum": [ + "0", + "1" + ] + }, + { + "name": "sensitivePermissionIconUrl", + "in": "body", + "type": "string", + "required": false, + "description": "绿色认证审核材料的objectId,isPureDetection=1时为必填项。该值为将绿色认证审核材料打成zip包,然后先调用获取上传文件地址接口,然后调用上传文件接口上传审核材料,最后得到获取上传文件地址接口返回的objectId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820" + }, + { + "name": "isCommitSensitivePermissionTips", + "in": "body", + "type": "boolean", + "required": false, + "description": "确认是否符合相关要求,true表示符合。isPureDetection=1时为必填项,且只可以填true。要求包括: 非必要的使用场景禁止桌面、锁屏和其他应用弹出窗口骚扰用户行为。 非必要的使用场景禁止发送无法删除的常驻通知。 禁止影响用户体验的广告,如抬头、强制插屏、侧边等。 禁止引导用户开启开发者选项。 禁止引导用户开启USB调试模式。 禁止通过热补丁,引入恶意行为和不符合以上条款的行为。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820" + } +] diff --git a/pkg/domain/reference/publishing/app-submit.rules.json b/pkg/domain/reference/publishing/app-submit.rules.json new file mode 100644 index 0000000..c9b458f --- /dev/null +++ b/pkg/domain/reference/publishing/app-submit.rules.json @@ -0,0 +1,61 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + }, + { + "id": "phased-phasedReleaseStartTime", + "kind": "required_if", + "field": "body.phasedReleaseStartTime", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleaseStartTime is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + }, + { + "id": "phased-phasedReleaseEndTime", + "kind": "required_if", + "field": "body.phasedReleaseEndTime", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleaseEndTime is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + }, + { + "id": "phased-phasedReleasePercent", + "kind": "required_if", + "field": "body.phasedReleasePercent", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleasePercent is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + }, + { + "id": "phased-phasedReleaseDescription", + "kind": "required_if", + "field": "body.phasedReleaseDescription", + "when": { + "field": "query.releaseType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-0000001158245061#section11431111271820", + "message": "phasedReleaseDescription is required for phased releaseType=3.", + "suggestion": "Supply this documented phased-release field or choose the intended release type." + } +] diff --git a/pkg/domain/reference/publishing/app-version-list.constraints.json b/pkg/domain/reference/publishing/app-version-list.constraints.json new file mode 100644 index 0000000..6022e61 --- /dev/null +++ b/pkg/domain/reference/publishing/app-version-list.constraints.json @@ -0,0 +1,11 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.packageName": { + "maxLength": 128 + }, + "body.state": { + "maxLength": 64 + } +} diff --git a/pkg/domain/reference/publishing/app-version-list.json b/pkg/domain/reference/publishing/app-version-list.json new file mode 100644 index 0000000..9864b59 --- /dev/null +++ b/pkg/domain/reference/publishing/app-version-list.json @@ -0,0 +1,284 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section590591091819", + "text": "请求示例\nPOST /api/publish/v3/version/brief-info/list HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"packageName\":\"com.xxx.xxx\",\n \"state\":\"1\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section3931254151818", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"versionList\": [\n {\n \"versionId\": \"16***4335\",\n \"state\": 0,\n \"lastVersionId\": \"16***4335\",\n \"releaseType\": 1,\n \"releasePhase\": 0,\n \"updateTime\": 1675992294335,\n \"testType\": 3,\n \"packageList\": [\n {\n \"packageId\": \"16***4335\",\n \"versionName\": \"1.0.0\",\n \"versionCode\": 1000000,\n \"buildVersion\": \"100.100.100\"\n }\n ]\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454#ZH-CN_TOPIC_0000002236041454__zh-cn_topic_0000002093216050_zh-cn_topic_0000001057964443_p38168214", + "title": "releaseState" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefversioninfo-0000002271000657", + "title": "BriefVersionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "title": "查询软件包编译状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "title": "查询应用未处理的问题工单" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section154708823714", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section590591091819", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section1383010100386", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section3931254151818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section154708823714", + "text": "此接口用于获取HarmonyOS应用/元服务的所有版本类型(含商用版本和测试版本)的版本列表,帮助开发者了解版本发布状态。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section154708823714", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386", + "text": "请求Body中使用JSON格式携带查询应用所有版本类型的版本列表,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/version/brief-info/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "packageName", + "O", + "String(128)", + "应用包名。 说明 appId和packageName至少传一个。" + ], + [ + "state", + "O", + "String(64)", + "版本状态。 多个状态用逗号分隔。 说明 state字段的取值请参考AppInfo中的releaseState参数。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "versionList", + "M", + "List", + "版本信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section1383010100386" + } + ], + "title": "查询应用所有版本类型的版本列表", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:56:06.794Z", + "family": "publishing", + "endpoint": "app-version-list" +} diff --git a/pkg/domain/reference/publishing/app-version-list.rules.json b/pkg/domain/reference/publishing/app-version-list.rules.json new file mode 100644 index 0000000..6f5c837 --- /dev/null +++ b/pkg/domain/reference/publishing/app-version-list.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "app-identity", + "kind": "at_least_one", + "fields": [ + "header.appId", + "body.packageName" + ], + "message": "appId 与 packageName 至少传一个。", + "suggestion": "添加 --header appId=应用ID 或 --field packageName=应用包名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386" + } +] diff --git a/pkg/domain/reference/publishing/app-version-voc.constraints.json b/pkg/domain/reference/publishing/app-version-voc.constraints.json new file mode 100644 index 0000000..534c082 --- /dev/null +++ b/pkg/domain/reference/publishing/app-version-voc.constraints.json @@ -0,0 +1,17 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.vocId": { + "maxLength": 32 + }, + "body.vocDesc": { + "maxLength": 255 + }, + "body.pageNo": { + "minimum": 1 + }, + "body.pageSize": { + "maximum": 100 + } +} diff --git a/pkg/domain/reference/publishing/app-version-voc.json b/pkg/domain/reference/publishing/app-version-voc.json new file mode 100644 index 0000000..f785b84 --- /dev/null +++ b/pkg/domain/reference/publishing/app-version-voc.json @@ -0,0 +1,298 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section1945115411389", + "text": "请求示例\nPOST /api/publish/v1/app-voc/version-voc HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json; \nAuthorization: Bearer *****\nappId: 1******57\n{\n \"vocId\": \"18******24\",\n \"vocDesc\": \"vocDesc\",\n \"pageNo\": 1,\n \"pageSize\": 100\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section15251637114113", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"total\": 1,\n \"appVocs\": [\n {\n \"versionId\": \"10*****528\",\n \"packageId\": \"1573*******5952\",\n \"vocId\": \"18******24\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "title": "VersionVoc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254", + "title": "查询应用所有版本类型的版本列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577", + "title": "查询需要上传的资质文件信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section41670133", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section11431111271820", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section1945115411389", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section63342526", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section15251637114113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section41670133", + "text": "此接口用于查询HarmonyOS应用/元服务未处理的问题工单。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section41670133", + "text": "调用本接口前必须保证应用软件包已经上传。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section41670133", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、开发。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v1/app-voc/version-voc" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "vocId", + "O", + "String(32)", + "工单ID。" + ], + [ + "vocDesc", + "O", + "String(255)", + "工单描述。" + ], + [ + "pageNo", + "M", + "Integer(32)", + "当前页。 最小值:1" + ], + [ + "pageSize", + "M", + "Integer(32)", + "每页数量。 最大值:100" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section11431111271820" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "total", + "O", + "Integer(32)", + "未处理的问题工单总条数。" + ], + [ + "appVocs", + "O", + "List", + "未处理的问题工单详情。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986#section63342526" + } + ], + "title": "查询应用未处理的问题工单", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:19.563Z", + "family": "publishing", + "endpoint": "app-version-voc" +} diff --git a/pkg/domain/reference/publishing/appid-list.constraints.json b/pkg/domain/reference/publishing/appid-list.constraints.json new file mode 100644 index 0000000..145b98b --- /dev/null +++ b/pkg/domain/reference/publishing/appid-list.constraints.json @@ -0,0 +1,8 @@ +{ + "query.packageName": { + "maxLength": 4096 + }, + "query.packageTypes": { + "maxLength": 32 + } +} diff --git a/pkg/domain/reference/publishing/appid-list.json b/pkg/domain/reference/publishing/appid-list.json new file mode 100644 index 0000000..d018d08 --- /dev/null +++ b/pkg/domain/reference/publishing/appid-list.json @@ -0,0 +1,257 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section175272026758", + "text": "请求示例\nGET /api/publish/v2/appid-list?packageName=com.huawei.xxxx HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*******7168\nAuthorization: Bearer *******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"appids\": [\n {\n \"key\": \"PhotoPlaza\",\n \"value\": \"10****057\"\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-pair-0000002271000645", + "title": "Pair" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-create-appid-0000002526543939", + "title": "创建APP ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743", + "title": "查询团队账号下的成员角色列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section19247123515514", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section8711909", + "text": "此接口用于根据HarmonyOS应用/元服务的应用包名查询对应的应用ID,支持一次查询多个应用包名。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section8711909", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/appid-list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "packageName", + "M", + "String(4096)", + "需要查询的应用包名。 多个包名以逗号分隔,最多支持50个。" + ], + [ + "packageTypes", + "O", + "String(32)", + "通过软件包类型过滤应用,只查询指定软件包类型的应用。 取值范围: 7:APP(HarmonyOS应用/元服务)" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section19247123515514" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "appids", + "O", + "List", + "应用包名对应的AppId对象的数组。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617#section49198053" + } + ], + "title": "查询应用包名对应的appid", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:11:13.650Z" +} diff --git a/pkg/domain/reference/publishing/gms.json b/pkg/domain/reference/publishing/gms.json new file mode 100644 index 0000000..44ad0ca --- /dev/null +++ b/pkg/domain/reference/publishing/gms.json @@ -0,0 +1,271 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section8512731433", + "text": "请求示例\nPUT /api/publish/v2/properties/gms?appId=1******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"needGms\":0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section86481530181410", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-notify-release-0000001158245063", + "title": "回调结果通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-update-releasetime-0000001158365053", + "title": "更新版本上架时间" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section165302018915", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section19652137562", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section8512731433", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section86481530181410", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section1011672075312", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section992664711544", + "text": "此接口用于向AGC上报应用是否依赖GMS。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section19652137562", + "text": "请求Body中使用JSON格式携带应用是否依赖GMS属性的信息,参数如下表所示。" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section1011672075312", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/properties/gms" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section165302018915" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "needGms", + "M", + "Integer", + "应用是否依赖GMS。 取值范围: 0:不依赖 1:依赖" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section19652137562" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section163825114565" + } + ], + "title": "设置应用GMS依赖属性", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:29.328Z", + "family": "publishing", + "endpoint": "gms" +} diff --git a/pkg/domain/reference/publishing/gms.parameters.json b/pkg/domain/reference/publishing/gms.parameters.json new file mode 100644 index 0000000..502496a --- /dev/null +++ b/pkg/domain/reference/publishing/gms.parameters.json @@ -0,0 +1,30 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section165302018915" + }, + { + "name": "needGms", + "in": "body", + "type": "integer", + "required": true, + "description": "应用是否依赖GMS。 取值范围: 0:不依赖 1:依赖", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section19652137562", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference/publishing/gms.rules.json b/pkg/domain/reference/publishing/gms.rules.json new file mode 100644 index 0000000..714e340 --- /dev/null +++ b/pkg/domain/reference/publishing/gms.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gms-0000001111845094#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/language-info-delete.constraints.json b/pkg/domain/reference/publishing/language-info-delete.constraints.json new file mode 100644 index 0000000..ece1610 --- /dev/null +++ b/pkg/domain/reference/publishing/language-info-delete.constraints.json @@ -0,0 +1,7 @@ +{ + "query.releaseType": { + "enum": [ + "1" + ] + } +} diff --git a/pkg/domain/reference/publishing/language-info-delete.json b/pkg/domain/reference/publishing/language-info-delete.json new file mode 100644 index 0000000..c1b009d --- /dev/null +++ b/pkg/domain/reference/publishing/language-info-delete.json @@ -0,0 +1,259 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section1648981411619", + "text": "请求示例\nDELETE /api/publish/v2/app-language-info?appId=10******57& lang=zh-CN HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer *******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section18940041674", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569", + "title": "更新应用语言信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-file-info-update-0000002236041430", + "title": "更新应用文件信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section14695859", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section42972064", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section23242264517", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section1648981411619", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section51204258", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section18940041674", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section13642421565", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section14695859", + "text": "此接口用于删除指定HarmonyOS应用/元服务不需要的语言描述信息,默认语言不支持删除。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section14695859", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-language-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "需要删除语言描述信息的应用ID。" + ], + [ + "lang", + "M", + "String", + "需要删除的语言。 说明 取值参见语言类型。" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网 默认值:1" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section23242264517" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621#section51204258" + } + ], + "title": "删除应用语言信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:29.656Z", + "family": "publishing", + "endpoint": "language-info-delete" +} diff --git a/pkg/domain/reference/publishing/language-info-update-v3.constraints.json b/pkg/domain/reference/publishing/language-info-update-v3.constraints.json new file mode 100644 index 0000000..6bb1633 --- /dev/null +++ b/pkg/domain/reference/publishing/language-info-update-v3.constraints.json @@ -0,0 +1,28 @@ +{ + "query.releaseType": { + "enum": [ + "1" + ] + }, + "query.releasePhase": { + "enum": [ + "0", + "3" + ] + }, + "body.lang": { + "maxLength": 8 + }, + "body.appName": { + "maxLength": 64 + }, + "body.appDesc": { + "maxLength": 8000 + }, + "body.briefInfo": { + "maxLength": 80 + }, + "body.newFeatures": { + "maxLength": 500 + } +} diff --git a/pkg/domain/reference/publishing/language-info-update-v3.json b/pkg/domain/reference/publishing/language-info-update-v3.json new file mode 100644 index 0000000..09758c3 --- /dev/null +++ b/pkg/domain/reference/publishing/language-info-update-v3.json @@ -0,0 +1,316 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section174799228118", + "text": "请求示例\nPUT /api/publish/v3/app-language-info?appId=10******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******7168\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"lang\": \"zh-CN\",\n \"appName\": \"PhotoPlaza\",\n \"appDesc\": \"*****\",\n \"briefInfo\": \"*****\",\n \"newFeatures\": \"*****\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section102323371127", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-update-0000002236201246", + "title": "更新应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-delete-0000002271000621", + "title": "删除应用语言信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section54750228", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section50251566", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section41341319578", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section174799228118", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section49610918", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section102323371127", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section20101181616514", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section54750228", + "text": "此接口用于更新指定的HarmonyOS应用/元服务的语言描述信息,如果当前没有语言描述信息则新增。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section54750228", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "text": "请求Body中使用JSON格式携带更新的语言描述信息,参数如下表所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611", + "text": "appDesc、briefInfo和newFeatures三个参数的取值不能相同。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/app-language-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "需要更新语言描述信息的应用ID。" + ], + [ + "releaseType", + "O", + "Integer(32)", + "应用发布方式。 取值范围: 1:全网 默认值:1" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网 3:分阶段 默认值:0" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section41341319578" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(8)", + "语言种类。 说明 取值参见语言类型。" + ], + [ + "appName", + "O", + "String(64)", + "对应语言的应用名称。 新增一个语言种类时,此字段必选。" + ], + [ + "appDesc", + "O", + "String(8000)", + "对应语言的应用描述信息。" + ], + [ + "briefInfo", + "O", + "String(80)", + "对应语言的一句话简介。" + ], + [ + "newFeatures", + "O", + "String(500)", + "对应语言的新版本简介。 说明 升级版本时,此参数必填。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section13576204051611" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-language-info-update-0000002271160569#section49610918" + } + ], + "title": "更新应用语言信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:27.457Z", + "family": "publishing", + "endpoint": "language-info-update-v3" +} diff --git a/pkg/domain/reference/publishing/language-info-update.json b/pkg/domain/reference/publishing/language-info-update.json new file mode 100644 index 0000000..ebc7a0e --- /dev/null +++ b/pkg/domain/reference/publishing/language-info-update.json @@ -0,0 +1,309 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section174799228118", + "text": "请求示例\nPUT /api/publish/v2/app-language-info?appId=10******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******7168\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"lang\": \"zh-CN\",\n \"appName\": \"PhotoPlaza\",\n \"appDesc\": \"*****\",\n \"briefInfo\": \"*****\",\n \"newFeatures\": \"*****\"\n \n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section102323371127", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-reference-langtype-0000001158245079", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-info-update-0000001111685198", + "title": "更新应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-delete-0000001111845088", + "title": "删除语言描述信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section54750228", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section50251566", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section41341319578", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section174799228118", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section49610918", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section102323371127", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section17654745124511", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section54750228", + "text": "此接口用于更新指定应用的语言描述信息,如果当前没有语言描述信息则新增。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "text": "请求Body中使用JSON格式携带更新的语言描述信息,参数如下表所示。" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section17654745124511", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/app-language-info" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "需要更新语言描述信息的应用ID。" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section41341319578" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(64)", + "语言种类,取值参见语言类型。" + ], + [ + "appName", + "O", + "String(64)", + "对应语言的应用名称。新增一个语言种类时,此字段必选。" + ], + [ + "appDesc", + "O", + "String(8000)", + "对应语言的应用描述信息。" + ], + [ + "briefInfo", + "O", + "String(80)", + "对应语言的一句话简介。" + ], + [ + "newFeatures", + "O", + "String(500)", + "对应语言的新版本简介。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section49610918" + } + ], + "title": "更新语言描述信息", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:52.329Z", + "family": "publishing", + "endpoint": "language-info-update" +} diff --git a/pkg/domain/reference/publishing/language-info-update.parameters.json b/pkg/domain/reference/publishing/language-info-update.parameters.json new file mode 100644 index 0000000..89bd4b1 --- /dev/null +++ b/pkg/domain/reference/publishing/language-info-update.parameters.json @@ -0,0 +1,75 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "需要更新语言描述信息的应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section41341319578" + }, + { + "name": "releaseType", + "in": "query", + "type": "integer", + "required": false, + "description": "应用发布方式。 取值范围: 1:全网 3:分阶段 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section41341319578", + "enum": [ + "1", + "3" + ] + }, + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言种类,取值参见语言类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 64 + }, + { + "name": "appName", + "in": "body", + "type": "string", + "required": false, + "description": "对应语言的应用名称。新增一个语言种类时,此字段必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 64 + }, + { + "name": "appDesc", + "in": "body", + "type": "string", + "required": false, + "description": "对应语言的应用描述信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 8000 + }, + { + "name": "briefInfo", + "in": "body", + "type": "string", + "required": false, + "description": "对应语言的一句话简介。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 80 + }, + { + "name": "newFeatures", + "in": "body", + "type": "string", + "required": false, + "description": "对应语言的新版本简介。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section13576204051611", + "maxLength": 500 + } +] diff --git a/pkg/domain/reference/publishing/language-info-update.rules.json b/pkg/domain/reference/publishing/language-info-update.rules.json new file mode 100644 index 0000000..23cabee --- /dev/null +++ b/pkg/domain/reference/publishing/language-info-update.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-language-info-update-0000001158245057#section48771100566", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/members-role-list.constraints.json b/pkg/domain/reference/publishing/members-role-list.constraints.json new file mode 100644 index 0000000..3e89f2d --- /dev/null +++ b/pkg/domain/reference/publishing/members-role-list.constraints.json @@ -0,0 +1,17 @@ +{ + "query.fromPage": { + "minimum": 1 + }, + "query.pageSize": { + "minimum": 1, + "maximum": 50 + }, + "query.languageCode": { + "maxLength": 20, + "enum": [ + "zh_cn", + "en_us", + "ru_ru" + ] + } +} diff --git a/pkg/domain/reference/publishing/members-role-list.json b/pkg/domain/reference/publishing/members-role-list.json new file mode 100644 index 0000000..58365d0 --- /dev/null +++ b/pkg/domain/reference/publishing/members-role-list.json @@ -0,0 +1,275 @@ +{ + "examples": [ + { + "section": "请求样例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section423141017508", + "text": "请求样例\nGET /api/publish/v3/members-role-list?fromPage=1&pageSize=10&languageCode=zh_cn HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section585524622518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"members\": [\n {\n \"uid\": \"30***********37\",\n \"huaweiAccountName\": \"x*******.com\",\n \"memberNickName\": \"string\",\n \"memberState\": 3,\n \"roles\": [\n {\n \"name\": [\n {\n \"lang\": \"zh_cn\",\n \"value\": \"APP管理员\"\n }\n ],\n \"createTime\": \"2026-07-21 11:55:28\",\n \"updateTime\": \"2026-07-21 11:55:28\"\n }\n ]\n }\n ],\n \"developerInfo\": {\n \"hwAccount\": \"18*******75\",\n \"teamId\": \"40**********87\",\n \"realName\": \"string\",\n \"realNameEn\": \"string\"\n },\n \"totalCount\": 1\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-memberrolelist-0000002679449001", + "title": "MemberRoleList" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-developerinfo-0000002649369326", + "title": "DeveloperInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appid-list-0000002271000617", + "title": "查询应用包名对应的appid" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-appinfo-query-0000002236041422", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section37920632", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section420734618165", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section423141017508", + "title": "请求样例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section74011072310", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section585524622518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section37920632", + "text": "此接口用于查询团队账号下的成员角色列表和团队主账号的开发者信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section37920632", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营、开发、客服、财务。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/members-role-list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fromPage", + "M", + "Integer", + "起始页。 最小值:1,表示从第1页开始查询。" + ], + [ + "pageSize", + "M", + "Integer", + "每页查询的条数。 取值范围:[1,50]" + ], + [ + "languageCode", + "M", + "String(20)", + "语言码。 取值范围: zh_cn:中文 en_us:英文 ru_ru:俄语" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section420734618165" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "members", + "O", + "List", + "团队成员的角色列表信息。" + ], + [ + "developerInfo", + "O", + "DeveloperInfo", + "团队主账号的开发者信息。" + ], + [ + "totalCount", + "O", + "Integer", + "返回的总条数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-teamid-member-list-0000002679253743#section74011072310" + } + ], + "title": "查询团队账号下的成员角色列表", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T05:11:33.888Z" +} diff --git a/pkg/domain/reference/publishing/obbfile-package-list.json b/pkg/domain/reference/publishing/obbfile-package-list.json new file mode 100644 index 0000000..8970a9a --- /dev/null +++ b/pkg/domain/reference/publishing/obbfile-package-list.json @@ -0,0 +1,405 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#ZH-CN_TOPIC_0000001111685210__zh-cn_topic_0000001059070160_p592719917156", + "title": "PackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#ZH-CN_TOPIC_0000001111685210__zh-cn_topic_0000001059070160_p20608193610292", + "title": "ObbInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#ZH-CN_TOPIC_0000001111685210__zh-cn_topic_0000001059070160_p20608193610292", + "title": "ObbInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065", + "title": "通过下载方式提交软件包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section138422239113", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section38431523014", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section992664711544", + "text": "此接口用于查询应用当前关联的软件包列表信息。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section138422239113", + "text": "PackageInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section138422239113", + "text": "ObbInfo" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/package-list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ], + [ + "fromRecCount", + "O", + "Integer", + "查询起始记录号。 默认值:1" + ], + [ + "maxReqCount", + "O", + "Integer", + "请求查询的软件包数。 取值范围:最大为100 默认值:10" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "retCount", + "M", + "Integer", + "返回的软件包数量。" + ], + [ + "totalCount", + "M", + "Integer", + "软件包总数量。" + ], + [ + "pkgList", + "M", + "List", + "软件包列表信息。" + ], + [ + "packagePath", + "O", + "String", + "APK上传后的下载URL(有效期为5分钟),是一个完整的地址。" + ], + [ + "abisType", + "O", + "Integer", + "CPU架构类型。 取值范围: 1:32位(armeabi-v7a|armeabi|x86|mips) 2:64位(armeabi-v8a|x86_64|mips64) 3:同时支持32位和64位 默认值:3" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section138422239113" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "pkgVersion", + "M", + "String", + "软件包唯一标识。" + ], + [ + "fileName", + "M", + "String", + "应用软件包文件名称。" + ], + [ + "versionCode", + "M", + "Integer", + "版本号,对应软件包中的versionCode。" + ], + [ + "versionName", + "O", + "String", + "版本描述,对应软件包中的versionName。" + ], + [ + "packageSize", + "M", + "Integer", + "软件包实体大小,从软件包中解析获得。" + ], + [ + "uploadTime", + "M", + "Integer", + "软件包上传时间。" + ], + [ + "shaCode", + "O", + "String", + "软件包SHA256摘要。" + ], + [ + "packageType", + "M", + "Integer", + "软件包类型。当前仅支持1,表示APK软件包。" + ], + [ + "mainObb", + "O", + "ObbInfo", + "APK软件包关联的主OBB文件。" + ], + [ + "patchObb", + "O", + "ObbInfo", + "APK软件包关联的补丁OBB文件。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section138422239113" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "obbId", + "M", + "String", + "OBB文件ID。" + ], + [ + "obbType", + "M", + "Integer", + "OBB文件类型。 取值范围: 1:主扩展文件 2:补丁扩展文件" + ], + [ + "fileName", + "M", + "String", + "文件名称,OBB文件上传后服务器会对OBB文件按以下规则重新命名: main|patch.apkVersion.packageName.obb main表示主扩展文件,patch表示补丁扩展文件。apkVersion为APK包的版本号,packageName为APK包名。例如“main.314159.com.example.app.obb”。" + ], + [ + "sha256", + "O", + "String", + "OBB文件的SHA256摘要。" + ], + [ + "fileSize", + "M", + "Integer", + "OBB文件大小。" + ], + [ + "uploadTime", + "M", + "String", + "OBB文件上传时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section138422239113" + } + ], + "title": "查询软件包列表", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:53.792Z", + "family": "publishing", + "endpoint": "obbfile-package-list" +} diff --git a/pkg/domain/reference/publishing/obbfile-package-list.parameters.json b/pkg/domain/reference/publishing/obbfile-package-list.parameters.json new file mode 100644 index 0000000..552df7d --- /dev/null +++ b/pkg/domain/reference/publishing/obbfile-package-list.parameters.json @@ -0,0 +1,34 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237" + }, + { + "name": "fromRecCount", + "in": "query", + "type": "integer", + "required": false, + "description": "查询起始记录号。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237" + }, + { + "name": "maxReqCount", + "in": "query", + "type": "integer", + "required": false, + "description": "请求查询的软件包数。 取值范围:最大为100 默认值:10", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section1087614283237" + } +] diff --git a/pkg/domain/reference/publishing/obbfile-package-list.rules.json b/pkg/domain/reference/publishing/obbfile-package-list.rules.json new file mode 100644 index 0000000..c60ca1b --- /dev/null +++ b/pkg/domain/reference/publishing/obbfile-package-list.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/on-shelf-cancel.constraints.json b/pkg/domain/reference/publishing/on-shelf-cancel.constraints.json new file mode 100644 index 0000000..03ddfd5 --- /dev/null +++ b/pkg/domain/reference/publishing/on-shelf-cancel.constraints.json @@ -0,0 +1,5 @@ +{ + "header.appId": { + "maxLength": 32 + } +} diff --git a/pkg/domain/reference/publishing/on-shelf-cancel.json b/pkg/domain/reference/publishing/on-shelf-cancel.json new file mode 100644 index 0000000..a3b0b28 --- /dev/null +++ b/pkg/domain/reference/publishing/on-shelf-cancel.json @@ -0,0 +1,277 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section174799228118", + "text": "请求示例\nPUT /api/publish/v3/version/on-shelf/cancel HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******7168\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"versionId\": \"******\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section102323371127", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454#ZH-CN_TOPIC_0000002236041454__zh-cn_topic_0000002093216050_zh-cn_topic_0000001057964443_p38168214", + "title": "releaseState应用状态说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585", + "title": "提交发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450", + "title": "下架应用" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section42105151714", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section656012300173", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section50251566", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section13576204051611", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section174799228118", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section49610918", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section102323371127", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section199941337172514", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section42105151714", + "text": "此接口用于HarmonyOS应用/元服务的撤销审核,当应用发布方式为“全网”时,只有处于“审核中”、“预审中”、“升级审核中”、“待上架/预约上架”、“申请下架”状态的应用可以撤销审核;当应用发布方式为“HarmonyOS测试发布方式(API>=10)”时,只有处于“正在审核”状态的应用可以撤销审核。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section42105151714", + "text": "可通过查询应用信息接口的appInfo参数获取应用状态,具体请参见releaseState应用状态说明。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section42105151714", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section13576204051611", + "text": "请求Body中使用JSON格式携带撤销审核信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/version/on-shelf/cancel" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section656012300173" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String", + "版本ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section13576204051611" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-on-shelf-cancel-0000002271000637#section49610918" + } + ], + "title": "撤销审核", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:58:00.948Z", + "family": "publishing", + "endpoint": "on-shelf-cancel" +} diff --git a/pkg/domain/reference/publishing/package-compile-status-v3.constraints.json b/pkg/domain/reference/publishing/package-compile-status-v3.constraints.json new file mode 100644 index 0000000..399387a --- /dev/null +++ b/pkg/domain/reference/publishing/package-compile-status-v3.constraints.json @@ -0,0 +1,8 @@ +{ + "query.appId": { + "maxLength": 32 + }, + "query.pkgIds": { + "maxLength": 500 + } +} diff --git a/pkg/domain/reference/publishing/package-compile-status-v3.json b/pkg/domain/reference/publishing/package-compile-status-v3.json new file mode 100644 index 0000000..ca61116 --- /dev/null +++ b/pkg/domain/reference/publishing/package-compile-status-v3.json @@ -0,0 +1,263 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section1067322214331", + "text": "请求示例\nGET /api/publish/v3/package/compile/status?appId=10*****7&pkgIds=10004151 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section9801143143518", + "text": "响应示例\n{\n \"ret\": { \n \"code\": 0,\n \"msg\": \"success\"\n },\n \"pkgStateList\": [\n {\n \"pkgId\": \"154984****07039539\",\n \"successStatus\": 0\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250#section19172900", + "title": "更新应用软件包信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packagestates-0000002271160601", + "title": "PackageStates" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469", + "title": "查询应用软件包信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254", + "title": "查询应用所有版本类型的版本列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section165302018915", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section9481933161311", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section992664711544", + "text": "此接口用于查询HarmonyOS应用/元服务的软件包的编译状态。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v3/package/compile/status" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "应用ID。" + ], + [ + "pkgIds", + "M", + "String(500)", + "待查询的软件包ID。 多个ID之间用英文逗号分隔。 可从更新应用软件包信息接口返回的packageId参数中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section165302018915" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "pkgStateList", + "M", + "List", + "软件包列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434#section163825114565" + } + ], + "title": "查询软件包编译状态", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:03.411Z", + "family": "publishing", + "endpoint": "package-compile-status-v3" +} diff --git a/pkg/domain/reference/publishing/phased-release-update.constraints.json b/pkg/domain/reference/publishing/phased-release-update.constraints.json new file mode 100644 index 0000000..1954c2c --- /dev/null +++ b/pkg/domain/reference/publishing/phased-release-update.constraints.json @@ -0,0 +1,34 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.versionId": { + "maxLength": 32 + }, + "body.releasePhase": { + "enum": [ + "3", + "4" + ] + }, + "body.state": { + "maxLength": 16, + "enum": [ + "SUSPEND", + "RELEASE" + ] + }, + "body.description": { + "maxLength": 500 + }, + "body.phaseDay": { + "enum": [ + "2", + "3", + "4", + "5", + "6", + "7" + ] + } +} diff --git a/pkg/domain/reference/publishing/phased-release-update.json b/pkg/domain/reference/publishing/phased-release-update.json new file mode 100644 index 0000000..c5c00b5 --- /dev/null +++ b/pkg/domain/reference/publishing/phased-release-update.json @@ -0,0 +1,296 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section8865931192418", + "text": "请求示例\nPUT /api/publish/v2/version/phased-release HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****168\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 10*****57\n{\n \"versionId\": \"10*****528\",\n \"releasePhase\": 3,\n \"state\": \"RELEASE\",\n \"description\": \"description\",\n \"phaseDay\": 2\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section986256122516", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254", + "title": "查询应用所有版本类型的版本列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefversioninfo-0000002271000657#ZH-CN_TOPIC_0000002271000657__zh-cn_topic_0000002083443972_p898319283710", + "title": "versionId" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573", + "title": "更新版本上架时间" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-package-info-0000002328848469", + "title": "查询应用软件包信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section21226547", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section8865931192418", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section16482284", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section986256122516", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section21226547", + "text": "此接口用于将分阶段发布修改为全网发布,或者更新分阶段发布的设置。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section21226547", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201", + "text": "请求Body中使用JSON格式携带分阶段发布信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/version/phased-release" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "版本ID。 可从查询应用所有版本类型的版本列表接口返回的versionId参数中获取。" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 3:分阶段。 4:分阶段转全网。" + ], + [ + "state", + "O", + "String(16)", + "分阶段发布的状态。 取值范围: SUSPEND:暂停。 RELEASE:恢复为发布中。" + ], + [ + "description", + "O", + "String(500)", + "分阶段发布说明。" + ], + [ + "phaseDay", + "O", + "Integer(32)", + "更新分阶段天数。 取值范围2、3、4、5、6、7,对应分阶段发布比例加速到2%、5%、10%、20%、50%、100%。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section1520919574201" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625#section16482284" + } + ], + "title": "更新分阶段发布", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:50.500Z", + "family": "publishing", + "endpoint": "phased-release-update" +} diff --git a/pkg/domain/reference/publishing/phased-release.json b/pkg/domain/reference/publishing/phased-release.json new file mode 100644 index 0000000..2612280 --- /dev/null +++ b/pkg/domain/reference/publishing/phased-release.json @@ -0,0 +1,305 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section8865931192418", + "text": "请求示例\nPUT /api/publish/v2/phased-release?appId=10*****57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****168\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"state\": \"RELEASE\",\n \"phasedReleaseStartTime\":\"2015-01-01T01:01:01+0800\",\n \"phasedReleaseEndTime\":\"2015-01-01T01:01:01+0800\",\n \"phasedReleasePercent\":\"50.00\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section986256122516", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092", + "title": "通过下载方式提交发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-notify-release-0000001158245063", + "title": "回调结果通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section21226547", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section71521339132219", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section8865931192418", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section16482284", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section986256122516", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section15143105712518", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section21226547", + "text": "此接口用于将分阶段发布修改为全网发布,或者更新分阶段发布的设置。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "text": "请求Body中使用JSON格式携带分阶段发布信息,参数如下表所示。" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section15143105712518", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/phased-release" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ], + [ + "releaseType", + "O", + "Integer", + "需要修改的发布方式。支持将分阶段发布修改为全网发布。 取值范围: 1:全网。 说明 如果选择全网发布,Body请传空对象{}。 3:分阶段。 默认值:3" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section71521339132219" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "state", + "O", + "String", + "分阶段发布的状态。 取值范围: SUSPEND:暂停。 RELEASE:恢复为发布中。" + ], + [ + "phasedReleaseStartTime", + "O", + "String(64)", + "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。已上架的分阶段发布应用,不允许修改开始时间。" + ], + [ + "phasedReleaseEndTime", + "O", + "String(64)", + "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。" + ], + [ + "phasedReleasePercent", + "O", + "String(10)", + "分阶段发布百分比。取值为大于0.00且小于100.00,必须精确到两位小数,不含百分号。" + ], + [ + "phasedReleaseDescription", + "O", + "String(500)", + "分阶段发布说明。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section16482284" + } + ], + "title": "更新分阶段发布", + "updatedAt": "2025-08-25 13:48", + "checkedAt": "2026-10-07T02:52:55.198Z", + "family": "publishing", + "endpoint": "phased-release" +} diff --git a/pkg/domain/reference/publishing/phased-release.parameters.json b/pkg/domain/reference/publishing/phased-release.parameters.json new file mode 100644 index 0000000..2683350 --- /dev/null +++ b/pkg/domain/reference/publishing/phased-release.parameters.json @@ -0,0 +1,73 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section71521339132219" + }, + { + "name": "releaseType", + "in": "query", + "type": "integer", + "required": false, + "description": "需要修改的发布方式。支持将分阶段发布修改为全网发布。 取值范围: 1:全网。 说明 如果选择全网发布,Body请传空对象{}。 3:分阶段。 默认值:3", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section71521339132219", + "enum": [ + "1" + ] + }, + { + "name": "state", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布的状态。 取值范围: SUSPEND:暂停。 RELEASE:恢复为发布中。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201" + }, + { + "name": "phasedReleaseStartTime", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布生效开始时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。已上架的分阶段发布应用,不允许修改开始时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 64 + }, + { + "name": "phasedReleaseEndTime", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布生效结束时间,UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 64 + }, + { + "name": "phasedReleasePercent", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布百分比。取值为大于0.00且小于100.00,必须精确到两位小数,不含百分号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 10 + }, + { + "name": "phasedReleaseDescription", + "in": "body", + "type": "string", + "required": false, + "description": "分阶段发布说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section1520919574201", + "maxLength": 500 + } +] diff --git a/pkg/domain/reference/publishing/phased-release.rules.json b/pkg/domain/reference/publishing/phased-release.rules.json new file mode 100644 index 0000000..8ce7190 --- /dev/null +++ b/pkg/domain/reference/publishing/phased-release.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-phased-release-0000001111685204#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/privacy-agreement-list.constraints.json b/pkg/domain/reference/publishing/privacy-agreement-list.constraints.json new file mode 100644 index 0000000..17f5a5d --- /dev/null +++ b/pkg/domain/reference/publishing/privacy-agreement-list.constraints.json @@ -0,0 +1,28 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.agreementIdList": { + "minItems": 1, + "maxItems": 1000 + }, + "body.name": { + "maxLength": 100 + }, + "body.status": { + "enum": [ + "1", + "2", + "3" + ] + }, + "body.type": { + "enum": [ + "1" + ] + }, + "body.maxReqCount": { + "minimum": 1, + "maximum": 100 + } +} diff --git a/pkg/domain/reference/publishing/privacy-agreement-list.json b/pkg/domain/reference/publishing/privacy-agreement-list.json new file mode 100644 index 0000000..baf139f --- /dev/null +++ b/pkg/domain/reference/publishing/privacy-agreement-list.json @@ -0,0 +1,311 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section590591091819", + "text": "请求示例\nPOST /api/publish/v2/agreement/list HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"agreementIdList\": [\n \"\"\n ],\n \"name\": \"应用的隐私政策协议示例\",\n \"status\": 1,\n \"type\": 1,\n \"fromRecCount\": 1,\n \"maxReqCount\": 30\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section3931254151818", + "text": "响应示例\nHarmonyOS应用\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success.\"\n },\n \"totalCount\": 1,\n \"agreements\": [\n {\n \"id\": \"14******92\",\n \"templateId\": \"10******36\",\n \"templateType\": 2,\n \"type\": 1,\n \"agreementInfos\": [\n {\n \"lang\": \"zh\",\n \"baseInfo\": {\n \"name\": \"应用的隐私政策协议示例\",\n \"appName\": \"应用名称\",\n \"companyName\": \"公司名称\",\n \"briefDesc\": \"产品说明\",\n \"effectiveTime\": 1719216501000\n },\n \"personalInfo\": {\n \"fullServiceMode\": {\n \"selectPath\": \"我的-设置\",\n \"personalCollectType\": \"1\",\n \"basicServiceType\": \"设置\",\n \"extraServiceType\": \"支付\"\n }\n },\n \"extInfo\": {\n \"contactInfo\": {\n \"phoneNum\": [\n \"159****7256\"\n ]\n },\n \"storageInfo\": {\n \"storagePeriod\": \"-1\",\n \"country\": \"中国境内\",\n \"isCrossBorder\": false\n },\n \"childPrivacyUrl\": \"\",\n \"versionChangeDescs\": [],\n \"abstracts\": \"\",\n \"managePersonalInfo\": {\n \"infoAccess\": {},\n \"infoModify\": {},\n \"infoDelete\": {},\n \"infoCancel\": {},\n \"serviceStop\": {}\n },\n \"customInfo\": {\n \"customInfos\": []\n },\n \"extFieldCustomInfo\": {\n \"childPrivacyTitle\": \"\",\n \"childPrivacyCustomInfoDesc\": \"\"\n }\n }\n }\n ],\n \"versionCode\": 1,\n \"status\": 1,\n \"defaultLang\": \"zh\",\n \"createTime\": 1719216560000,\n \"updateTime\": 1746506747000\n }\n ]\n}\n元服务\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success.\"\n },\n \"totalCount\": 1,\n \"agreements\": [\n {\n \"id\": \"1653566465859127296\",\n \"templateId\": \"100589575050625036\",\n \"templateType\": 1,\n \"type\": 1,\n \"agreementInfos\": [\n {\n \"lang\": \"zh\",\n \"baseInfo\": {\n \"name\": \"元服务的隐私政策协议示例\",\n \"appName\": \"应用名称\",\n \"companyName\": \"公司名称\",\n \"briefDesc\": \"产品说明\",\n \"effectiveTime\": 1743392449000\n },\n \"personalInfo\": {\n \"requiredInfo\": {\n \"sceneItems\": [\n {\n \"dataItems\": [\n {\n \"itemId\": \"D0***07\",\n \"itemDesc\": \"地址\",\n \"sensitiveData\": 0\n }\n ],\n \"sceneId\": \"1001\",\n \"sceneReason\": \"实现应用功能\",\n \"collectModeId\": \"1201\",\n \"collectMode\": \"在后台运行时\",\n \"legalBasisId\": \"1101\",\n \"legalBasis\": \"在获取您的同意后\"\n }\n ]\n },\n \"adsInfo\": {\n \"sceneItems\": [\n {\n \"dataItems\": [\n {\n \"itemId\": \"D001007\",\n \"itemDesc\": \"地址\",\n \"sensitiveData\": 0\n }\n ]\n }\n ],\n \"pushContent\": \"活动和中奖\",\n \"closeSetting\": \"设置-广告营销\"\n }\n },\n \"extInfo\": {\n \"contactInfo\": {\n \"phoneNum\": [\n \"15850587336\"\n ]\n },\n \"storageInfo\": {\n \"storagePeriod\": \"-1\",\n \"country\": \"中国境内\",\n \"isCrossBorder\": false\n },\n \"childPrivacyUrl\": \"\",\n \"versionChangeDescs\": [],\n \"abstracts\": \"\",\n \"managePersonalInfo\": {\n \"infoAccess\": {},\n \"infoModify\": {},\n \"infoDelete\": {},\n \"infoCancel\": {},\n \"serviceStop\": {}\n },\n \"customInfo\": {\n \"customInfos\": []\n },\n \"extFieldCustomInfo\": {\n \"childPrivacyTitle\": \"\",\n \"childPrivacyCustomInfoDesc\": \"\"\n }\n }\n }\n ],\n \"versionCode\": 1,\n \"status\": 1,\n \"defaultLang\": \"zh\",\n \"createTime\": 1743392484000,\n \"updateTime\": 1746506972000\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-privacy-0000002295005286", + "title": "Agreement" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633", + "title": "提交隐私政策协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169", + "title": "更新隐私政策协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section154708823714", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section590591091819", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section1383010100386", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section3931254151818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section18901175117553", + "title": "HarmonyOS应用" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section7414620115612", + "title": "元服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section154708823714", + "text": "此接口用于查询HarmonyOS应用/元服务的隐私政策协议信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section154708823714", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/agreement/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "agreementIdList", + "O", + "List", + "隐私政策协议ID。 数组长度为1~1000。" + ], + [ + "name", + "M", + "String(100)", + "隐私政策协议名称。 使用模糊查询方式。" + ], + [ + "status", + "O", + "Integer(32)", + "隐私政策协议状态。 取值范围: 1:草稿 2:已完成 3:已删除 不传值:默认查未删除的记录" + ], + [ + "type", + "O", + "Integer(32)", + "协议类型。 取值范围: 1:隐私政策协议" + ], + [ + "fromRecCount", + "O", + "Integer(32)", + "起始页数。 默认值:1" + ], + [ + "maxReqCount", + "O", + "Integer", + "每页返回条数。 取值范围:[1,100] 默认值:30" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "totalCount", + "O", + "Integer", + "隐私政策协议总数量。" + ], + [ + "agreements", + "O", + "List", + "隐私政策协议信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925#section1383010100386" + } + ], + "title": "查询隐私政策协议列表", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:10:26.407Z" +} diff --git a/pkg/domain/reference/publishing/privacy-agreement-submit.constraints.json b/pkg/domain/reference/publishing/privacy-agreement-submit.constraints.json new file mode 100644 index 0000000..ac6135f --- /dev/null +++ b/pkg/domain/reference/publishing/privacy-agreement-submit.constraints.json @@ -0,0 +1,14 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.id": { + "maxLength": 32 + }, + "body.requireConfirm": { + "enum": [ + "1", + "0" + ] + } +} diff --git a/pkg/domain/reference/publishing/privacy-agreement-submit.json b/pkg/domain/reference/publishing/privacy-agreement-submit.json new file mode 100644 index 0000000..92b96d3 --- /dev/null +++ b/pkg/domain/reference/publishing/privacy-agreement-submit.json @@ -0,0 +1,265 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section11786182613149", + "text": "请求示例\nPUT /api/publish/v2/agreement/submit HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 4141******68\nContent-Type: application/json\nAuthorization: Bearer *******\nappId: 1******57\n{\n \"id\": \"45******56\",\n \"requireConfirm\": 0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section1234123113169", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626", + "title": "更新用户协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925", + "title": "查询隐私政策协议列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section41694086", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section1131102811712", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section11786182613149", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section19172900", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section1234123113169", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section41694086", + "text": "此接口用于提交HarmonyOS应用/元服务的隐私政策协议。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section41694086", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/agreement/submit" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "M", + "String(32)", + "隐私政策协议ID。" + ], + [ + "requireConfirm", + "O", + "Integer(32)", + "是否弹窗确认。 取值范围: 1:是 0:否" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section1131102811712" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633#section19172900" + } + ], + "title": "提交隐私政策协议", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:20.479Z", + "family": "publishing", + "endpoint": "privacy-agreement-submit" +} diff --git a/pkg/domain/reference/publishing/privacy-agreement-update.constraints.json b/pkg/domain/reference/publishing/privacy-agreement-update.constraints.json new file mode 100644 index 0000000..2c59c59 --- /dev/null +++ b/pkg/domain/reference/publishing/privacy-agreement-update.constraints.json @@ -0,0 +1,14 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.id": { + "maxLength": 32 + }, + "body.defaultLang": { + "maxLength": 20 + }, + "body.agreementInfos": { + "maxItems": 100 + } +} diff --git a/pkg/domain/reference/publishing/privacy-agreement-update.json b/pkg/domain/reference/publishing/privacy-agreement-update.json new file mode 100644 index 0000000..0612f5c --- /dev/null +++ b/pkg/domain/reference/publishing/privacy-agreement-update.json @@ -0,0 +1,292 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section1945115411389", + "text": "请求示例\nHarmonyOS应用\nPUT /api/publish/v2/agreement HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json; \nAuthorization: Bearer *****\nappId: 1******57\n{\n \"id\": \"14******92\",\n \"defaultLang\": \"zh\",\n \"agreementInfos\": [{\n \"lang\": \"zh\",\n \"baseInfo\": {\n \"name\": \"应用的隐私政策协议示例\",\n \"appName\": \"应用名称\",\n \"companyName\": \"公司名称\",\n \"briefDesc\": \"产品说明\",\n \"effectiveTime\": 1719216501000\n },\n \"personalInfo\": {\n \"fullServiceMode\": {\n \"selectPath\": \"我的-设置\",\n \"personalCollectType\": \"1\",\n \"basicServiceType\": \"设置\",\n \"extraServiceType\": \"支付\"\n }\n },\n \"extInfo\": {\n \"contactInfo\": {\n \"phoneNum\": [\"159****7256\"]\n },\n \"storageInfo\": {\n \"storagePeriod\": \"-1\",\n \"country\": \"中国境内\",\n \"isCrossBorder\": false\n },\n \"childPrivacyUrl\": \"\",\n \"versionChangeDescs\": [],\n \"abstracts\": \"\",\n \"managePersonalInfo\": {\n \"infoAccess\": {},\n \"infoModify\": {},\n \"infoDelete\": {},\n \"infoCancel\": {},\n \"serviceStop\": {},\n \"selectedKeys\": []\n },\n \"customInfo\": {\n \"customInfos\": []\n },\n \"extFieldCustomInfo\": {\n \"childPrivacyTitle\": \"\",\n \"childPrivacyCustomInfoDesc\": \"\"\n }\n },\n \"thirdSdkInfo\": {\n \"sdkInfos\": []\n },\n \"thirdSharedInfos\": []\n }] \n}\n元服务\nPUT /api/publish/v2/agreement HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json; \nAuthorization: Bearer *****\nappId: 1******57\n{\n \"id\": \"16******96\",\n \"defaultLang\": \"zh\",\n \"agreementInfos\": [{\n \"lang\": \"zh\",\n \"baseInfo\": {\n \"name\": \"元服务的隐私政策协议示例\",\n \"appName\": \"应用名称\",\n \"companyName\": \"公司名称\",\n \"briefDesc\": \"产品说明\",\n \"effectiveTime\": 1743392449000\n },\n \"personalInfo\": {\n \"requiredInfo\": {\n \"sceneItems\": [{\n \"dataItems\": [{\n \"itemId\": \"D0***07\",\n \"itemDesc\": \"地址\",\n \"sensitiveData\": 0\n }],\n \"sceneId\": \"1001\",\n \"sceneReason\": \"实现应用功能\",\n \"collectModeId\": \"1201\",\n \"collectMode\": \"在后台运行时\",\n \"legalBasisId\": \"1101\",\n \"legalBasis\": \"在获取您的同意后\",\n \"remark\": \"修改\"\n }]\n },\n \"adsInfo\": {\n \"sceneItems\": [{\n \"dataItems\": [{\n \"itemId\": \"D001007\",\n \"itemDesc\": \"地址\",\n \"sensitiveData\": 0\n }]\n }],\n \"pushContent\": \"活动和中奖\",\n \"closeSetting\": \"设置-广告营销\"\n }\n },\n \"extInfo\": {\n \"contactInfo\": {\n \"phoneNum\": [\"15850587336\"]\n },\n \"storageInfo\": {\n \"storagePeriod\": \"-1\",\n \"country\": \"中国境内\",\n \"isCrossBorder\": false\n },\n \"childPrivacyUrl\": \"\",\n \"versionChangeDescs\": [],\n \"abstracts\": \"\",\n \"managePersonalInfo\": {\n \"infoAccess\": {},\n \"infoModify\": {},\n \"infoDelete\": {},\n \"infoCancel\": {},\n \"serviceStop\": {}\n },\n \"customInfo\": {\n \"customInfos\": []\n },\n \"extFieldCustomInfo\": {\n \"childPrivacyTitle\": \"\",\n \"childPrivacyCustomInfoDesc\": \"\"\n }\n },\n \"thirdSdkInfo\": {\n \"sdkInfos\": []\n },\n \"thirdSharedInfos\": []\n }]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section15251637114113", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success.\"\n },\n \"id\": \"16******96\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "title": "AgreementInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-privacy-agreement-0000002328924925", + "title": "查询隐私政策协议列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-age-rating-0000002236201262", + "title": "申请年龄分级" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section41670133", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section11431111271820", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section1945115411389", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section185041243153114", + "title": "HarmonyOS应用" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section9831165033113", + "title": "元服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section63342526", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section15251637114113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section41670133", + "text": "此接口用于更新HarmonyOS应用/元服务的隐私政策协议。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section41670133", + "text": "若隐私政策协议被在架版本关联,编辑后需要提交华为运营审核,待协议审核通过后,更新的内容方可生效。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section41670133", + "text": "若隐私政策协议被状态为“审核中”的应用关联,将不支持编辑。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/agreement" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "M", + "String(32)", + "隐私政策协议ID。" + ], + [ + "defaultLang", + "O", + "String(20)", + "隐私政策协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + ], + [ + "agreementInfos", + "O", + "List", + "隐私政策协议列表。 数组长度不超过100。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section11431111271820" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "id", + "O", + "String", + "隐私政策协议ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-privacy-agreement-0000002328805169#section63342526" + } + ], + "title": "更新隐私政策协议", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:06:42.704Z" +} diff --git a/pkg/domain/reference/publishing/qualification-review-cancel.constraints.json b/pkg/domain/reference/publishing/qualification-review-cancel.constraints.json new file mode 100644 index 0000000..d15fc1f --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-cancel.constraints.json @@ -0,0 +1,8 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.taskId": { + "maxLength": 32 + } +} diff --git a/pkg/domain/reference/publishing/qualification-review-cancel.json b/pkg/domain/reference/publishing/qualification-review-cancel.json new file mode 100644 index 0000000..9cd723c --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-cancel.json @@ -0,0 +1,259 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section1067322214331", + "text": "请求示例\nPUT /api/publish/v2/qualification-review-task/cancel HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"taskId\": \"1******8\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", + "title": "修改资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788", + "title": "删除资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section992664711544", + "text": "此接口用于撤销元服务的资质审核任务。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/qualification-review-task/cancel" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "taskId", + "M", + "String(32)", + "资质审核任务ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258#section163825114565" + } + ], + "title": "撤销资质审核任务", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:47.305Z", + "family": "publishing", + "endpoint": "qualification-review-cancel" +} diff --git a/pkg/domain/reference/publishing/qualification-review-create.constraints.json b/pkg/domain/reference/publishing/qualification-review-create.constraints.json new file mode 100644 index 0000000..18b62e0 --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-create.constraints.json @@ -0,0 +1,8 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.tagQualInfos": { + "maxItems": 5 + } +} diff --git a/pkg/domain/reference/publishing/qualification-review-create.json b/pkg/domain/reference/publishing/qualification-review-create.json new file mode 100644 index 0000000..c18ed59 --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-create.json @@ -0,0 +1,268 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section1067322214331", + "text": "请求示例\nPOST /api/publish/v2/qualification-review-task HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"tagQualInfos\": [\n {\n \"tagId\": \"30000322\",\n \"qualificationInfos\": [\n {\n \"qualificationCode\": \"10023\",\n \"qualificationFileInfos\": [\n {\n \"objectId\": \"*******\",\n \"fileName\": \"f******e\",\n \"fileSize\": 10,\n \"sha256\": \"0********7\"\n }\n ],\n \"validityType\": 0,\n \"startTime\": \"2024-05-10\",\n \"expireTime\": \"2025-05-10\"\n }\n ]\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "title": "TagQualInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577", + "title": "查询需要上传的资质文件信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438", + "title": "查询资质审核任务详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section992664711544", + "text": "此接口用于提交元服务的资质审核任务。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section992664711544", + "text": "应用设备类型仅选择智能手表或运动手表时,不支持提交资质审核任务。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/qualification-review-task" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "tagQualInfos", + "M", + "List", + "标签和标签对应的资质信息列表。 数组长度不超过5。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629#section163825114565" + } + ], + "title": "提交资质审核任务", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:28.028Z", + "family": "publishing", + "endpoint": "qualification-review-create" +} diff --git a/pkg/domain/reference/publishing/qualification-review-delete.constraints.json b/pkg/domain/reference/publishing/qualification-review-delete.constraints.json new file mode 100644 index 0000000..de7a2ba --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-delete.constraints.json @@ -0,0 +1,8 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.tagIds": { + "maxItems": 5 + } +} diff --git a/pkg/domain/reference/publishing/qualification-review-delete.json b/pkg/domain/reference/publishing/qualification-review-delete.json new file mode 100644 index 0000000..47225dd --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-delete.json @@ -0,0 +1,272 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section1067322214331", + "text": "请求示例\nDELETE /api/publish/v2/qualification-review-task HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"tagIds\": [\n \"1******8\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", + "title": "提交资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689#section06007445916", + "title": "元服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258", + "title": "撤销资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581", + "title": "新建用户协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section992664711544", + "text": "此接口用于删除元服务的资质审核任务。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section992664711544", + "text": "如果元服务资质审核已通过,但在提交上架时因资质问题被驳回,需要先调用该接口移除旧的资质材料,然后重新提交资质审核任务。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/qualification-review-task" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "tagIds", + "M", + "List", + "需要删除的资质审核标签ID列表,逗号分隔。 数组长度不超过5。 说明 具体取值请参见元服务的“标签ID”列。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788#section163825114565" + } + ], + "title": "删除资质审核任务", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:03.034Z", + "family": "publishing", + "endpoint": "qualification-review-delete" +} diff --git a/pkg/domain/reference/publishing/qualification-review-query.constraints.json b/pkg/domain/reference/publishing/qualification-review-query.constraints.json new file mode 100644 index 0000000..48336ae --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-query.constraints.json @@ -0,0 +1,8 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "query.tagIds": { + "maxLength": 256 + } +} diff --git a/pkg/domain/reference/publishing/qualification-review-query.json b/pkg/domain/reference/publishing/qualification-review-query.json new file mode 100644 index 0000000..edee2f6 --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-query.json @@ -0,0 +1,269 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section1067322214331", + "text": "请求示例\nGET /api/publish/v2/qualification-review-task?tagIds=30000322 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section9801143143518", + "text": "响应示例\n{\n \"qualReviewTaskInfos\": [\n {\n \"appId\": \"10******57\",\n \"tagId\": \"30000322\",\n \"taskId\": \"1******8\",\n \"isMainTag\": 0,\n \"state\": 0,\n \"qualificationInfos\": [\n {\n \"qualificationCode\": \"10023\",\n \"qualificationFileInfos\": [\n {\n \"objectId\": \"*******\",\n \"fileName\": \"f******e\",\n \"fileSize\": 10,\n \"sha256\": \"0********7\"\n }\n ],\n \"validityType\": 0,\n \"startTime\": \"2024-05-10\",\n \"expireTime\": \"2025-05-10\"\n }\n ],\n \"lastAuditResult\": \"l*********t\",\n \"createTime\": 1844593505000,\n \"updateTime\": 1844593505000\n }\n ],\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665", + "title": "QualReviewTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", + "title": "提交资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", + "title": "修改资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section165302018915", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section992664711544", + "text": "此接口用于查询元服务的资质审核任务详情。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/qualification-review-task" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "tagIds", + "M", + "String(256)", + "审核任务包含的标签ID列表,逗号分隔。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section165302018915" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "qualReviewTaskInfos", + "O", + "List", + "资质审核任务信息列表。" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438#section163825114565" + } + ], + "title": "查询资质审核任务详情", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:44.080Z", + "family": "publishing", + "endpoint": "qualification-review-query" +} diff --git a/pkg/domain/reference/publishing/qualification-review-update.constraints.json b/pkg/domain/reference/publishing/qualification-review-update.constraints.json new file mode 100644 index 0000000..18b62e0 --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-update.constraints.json @@ -0,0 +1,8 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.tagQualInfos": { + "maxItems": 5 + } +} diff --git a/pkg/domain/reference/publishing/qualification-review-update.json b/pkg/domain/reference/publishing/qualification-review-update.json new file mode 100644 index 0000000..4e24fab --- /dev/null +++ b/pkg/domain/reference/publishing/qualification-review-update.json @@ -0,0 +1,263 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section1067322214331", + "text": "请求示例\nPUT /api/publish/v2/qualification-review-task HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"tagQualInfos\": [\n {\n \"tagId\": \"30000322\",\n \"taskId\": \"1****3\",\n \"qualificationInfos\": [\n {\n \"qualificationCode\": \"10023\",\n \"qualificationFileInfos\": [\n {\n \"objectId\": \"*******\",\n \"fileName\": \"f******e\",\n \"fileSize\": 10,\n \"sha256\": \"0********7\"\n }\n ],\n \"validityType\": 0,\n \"startTime\": \"2024-05-10\",\n \"expireTime\": \"2025-05-10\"\n }\n ]\n }\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "title": "TagQualInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-get-qualification-review-0000002236041438", + "title": "查询资质审核任务详情" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-cancel-qualification-review-0000002236201258", + "title": "撤销资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section992664711544", + "text": "此接口用于修改元服务的资质审核任务。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/qualification-review-task" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "tagQualInfos", + "M", + "List", + "标签和标签对应的资质信息列表。 数组长度不超过5。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746#section163825114565" + } + ], + "title": "修改资质审核任务", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:45.618Z", + "family": "publishing", + "endpoint": "qualification-review-update" +} diff --git a/pkg/domain/reference/publishing/query-aabfile.json b/pkg/domain/reference/publishing/query-aabfile.json new file mode 100644 index 0000000..0f0226e --- /dev/null +++ b/pkg/domain/reference/publishing/query-aabfile.json @@ -0,0 +1,313 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section1067322214331", + "text": "请求示例\nGET /api/publish/v2/package/compile/status?appId=10*****7&pkgIds=10004151 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section9801143143518", + "text": "响应示例\n{\n \"ret\": { \n \"code\": 0,\n \"msg\": \"success\"\n },\n \"pkgStateList\": [\n {\n \"pkgId\": \"****\",\n \"aabCompileStatus\": 0,\n \"failReason\": 6,\n \"successStatus\": 0\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishing-api-0000002351880118", + "title": "Publishing API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-0000001150409957", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-package-list-0000001111685210#ZH-CN_TOPIC_0000001111685210__zh-cn_topic_0000001059070160_p15136112112151", + "title": "pkgVersion" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-publishingapi-errorcode-0000001163523297", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#ZH-CN_TOPIC_0000001111685206__p0229956142012", + "title": "PackageStates" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-dynamicability-introduction-0000001057944549", + "title": "Dynamic Ability SDK" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-update-releasetime-0000001158365053", + "title": "更新版本上架时间" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-add-packageurl-0000001158245065", + "title": "通过下载方式提交软件包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section165302018915", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section47549119574", + "title": "Postman调试" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section992664711544", + "text": "此接口用于查询软件包的编译状态。接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165", + "text": "API客户端方式和OAuth客户端方式的区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section163825114565", + "text": "PackageStates说明" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section47549119574", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/package/compile/status" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ], + [ + "pkgIds", + "M", + "String", + "待查询的软件包id,多个id之间用逗号分隔。 对应查询软件包列表接口返回的pkgVersion参数。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section165302018915" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "String(100)", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。返回码请参见错误码。" + ], + [ + "pkgStateList", + "M", + "PackageStates", + "软件包列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section163825114565" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "pkgId", + "M", + "String", + "软件包id。" + ], + [ + "aabCompileStatus", + "O", + "Integer", + "此配置项即将废弃,新接入应用请使用successStatus获取结果。 编译状态。 取值范围: 0:未发送 1:编译中 2:编译完成 3:编译失败" + ], + [ + "failReason", + "O", + "Integer", + "此配置项即将废弃,新接入应用请使用successStatus获取结果。 Android AAB软件包编译失败时返回的错误码。 取值范围: 6:使用了动态下载功能,未正确集成华为Dynamic Ability SDK。 7:Module配置不正确,universal apk无法正常运行。 8:使用了Asset Pack。 9:AAB包下载失败。 10:AAB包下载失败,AAB包为空。 11:AAB包格式有问题,无法解压。 12:AAB包使用bundletool解析失败。 13-18:AAB包编译失败。 19:AAB包超过上限150MB。" + ], + [ + "successStatus", + "M", + "Integer(32)", + "软件包状态汇总结果。 取值范围: 0:正常 1:解析中 2:失败,表示软件包不可用" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section163825114565" + } + ], + "title": "查询软件包编译状态", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:52:56.407Z", + "family": "publishing", + "endpoint": "query-aabfile" +} diff --git a/pkg/domain/reference/publishing/query-aabfile.parameters.json b/pkg/domain/reference/publishing/query-aabfile.parameters.json new file mode 100644 index 0000000..334c0e2 --- /dev/null +++ b/pkg/domain/reference/publishing/query-aabfile.parameters.json @@ -0,0 +1,26 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID,可通过获取团队列表接口获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section165302018915" + }, + { + "name": "pkgIds", + "in": "query", + "type": "string", + "required": true, + "description": "待查询的软件包id,多个id之间用逗号分隔。 对应查询软件包列表接口返回的pkgVersion参数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section165302018915" + } +] diff --git a/pkg/domain/reference/publishing/query-aabfile.rules.json b/pkg/domain/reference/publishing/query-aabfile.rules.json new file mode 100644 index 0000000..f3f5fa8 --- /dev/null +++ b/pkg/domain/reference/publishing/query-aabfile.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-query-aabfile-0000001111685206#section236517415165", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/publishing/tag-qual-dependent.json b/pkg/domain/reference/publishing/tag-qual-dependent.json new file mode 100644 index 0000000..1b747bb --- /dev/null +++ b/pkg/domain/reference/publishing/tag-qual-dependent.json @@ -0,0 +1,226 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section1067322214331", + "text": "请求示例\nGET /api/publish/v2/tag-qual-dependent HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section9801143143518", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"tagQuals\": [\n {\n \"tagId\": 30000322,\n \"dependentQuals\": [\n {\n \"qualCodes\": \"10023\",\n \"required\": 1,\n \"sort\": 1,\n \"qualLangInfos\": [\n {\n \"language\": \"zh_CN\",\n \"description\": \"ICP备案或《增值电信业务经营许可证》(二选一)\"\n }\n ]\n }\n ]\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqual-0000002236201282", + "title": "TagQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "title": "查询应用未处理的问题工单" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-qualification-review-0000002271000629", + "title": "提交资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section1067322214331", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section9801143143518", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section992664711544", + "text": "此接口用于查询元服务需要上传的所有资质文件信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section992664711544", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/tag-qual-dependent" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section119494174419" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "tagQuals", + "O", + "List", + "资质文件信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-tag-qual-dependent-0000002271160577#section163825114565" + } + ], + "title": "查询需要上传的资质文件信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:24.391Z", + "family": "publishing", + "endpoint": "tag-qual-dependent" +} diff --git a/pkg/domain/reference/publishing/update-releasetime.constraints.json b/pkg/domain/reference/publishing/update-releasetime.constraints.json new file mode 100644 index 0000000..0a8bc64 --- /dev/null +++ b/pkg/domain/reference/publishing/update-releasetime.constraints.json @@ -0,0 +1,13 @@ +{ + "body.changeType": { + "enum": [ + "2", + "3" + ] + }, + "body.releaseType": { + "enum": [ + "1" + ] + } +} diff --git a/pkg/domain/reference/publishing/update-releasetime.json b/pkg/domain/reference/publishing/update-releasetime.json new file mode 100644 index 0000000..31f6713 --- /dev/null +++ b/pkg/domain/reference/publishing/update-releasetime.json @@ -0,0 +1,283 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section590591091819", + "text": "请求示例\nPUT /api/publish/v2/on-shelf-time?appId=1******57 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"changeType\":3,\n \"releaseTime\":\"2015-01-01T01:01:01+0800\",\n \"releaseType\":1\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section3931254151818", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-submit-0000002271160585#ZH-CN_TOPIC_0000002271160585__li150910519461", + "title": "releasePhase" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-package-info-update-0000002236201250", + "title": "更新应用软件包信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-phased-release-0000002271000625", + "title": "更新分阶段发布" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section154708823714", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section165302018915", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section590591091819", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section1383010100386", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section3931254151818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section154708823714", + "text": "此接口用于设置版本的上架时间。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section154708823714", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section2357705386", + "text": "请求Body中使用JSON格式携带更新版本上架时间内容,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/on-shelf-time" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section165302018915" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "changeType", + "M", + "Integer", + "修改类型。 取值范围: 2:指定时间上架改为审核通过立即上架 3:变更定时上架时间" + ], + [ + "releaseTime", + "M", + "String", + "指定的版本上架时间。 UTC时间格式:yyyy-MM-ddTHH:mm:ssZZ,例如“2015-01-01T01:01:01+0800”。 changeType为3时有效。" + ], + [ + "releaseType", + "M", + "Integer", + "发布方式。 取值范围: 1:全网 目前支持全网及releasePhase为3的分阶段发布。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-release-time-0000002271160573#section1383010100386" + } + ], + "title": "更新版本上架时间", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:55:48.314Z", + "family": "publishing", + "endpoint": "update-releasetime" +} diff --git a/pkg/domain/reference/publishing/user-agreement-create.constraints.json b/pkg/domain/reference/publishing/user-agreement-create.constraints.json new file mode 100644 index 0000000..be2fd48 --- /dev/null +++ b/pkg/domain/reference/publishing/user-agreement-create.constraints.json @@ -0,0 +1,16 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.type": { + "enum": [ + "2" + ] + }, + "body.defaultLang": { + "maxLength": 20 + }, + "body.agreementInfos": { + "maxItems": 100 + } +} diff --git a/pkg/domain/reference/publishing/user-agreement-create.json b/pkg/domain/reference/publishing/user-agreement-create.json new file mode 100644 index 0000000..fc41dcd --- /dev/null +++ b/pkg/domain/reference/publishing/user-agreement-create.json @@ -0,0 +1,281 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section1945115411389", + "text": "请求示例\nPOST /api/publish/v2/agreement HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json; \nAuthorization: Bearer *****\nappId: 1******57\n{\n \"type\": 2,\n \"channel\": 1,\n \"defaultLang\": \"zh\",\n \"agreementInfos\": [\n {\n \"lang\": \"zh\",\n \"baseInfo\": {\n \"name\": \"新增\",\n \"agreementTitle\": \"新增中文\",\n \"userAgreementUrl\": \"https://*****/****/****\"\n }\n }, \n {\n \"lang\": \"en\",\n \"baseInfo\": {\n \"name\": \"新增\",\n \"agreementTitle\": \"新增英文\",\n \"userAgreementUrl\": \"https://*****/****/****\"\n }\n }, \n {\n \"lang\": \"zh-Hant-HK\",\n \"baseInfo\": {\n \"name\": \"新增\",\n \"agreementTitle\": \"香港\",\n \"userAgreementUrl\": \"https://*****/****/****\"\n }\n } \n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section15251637114113", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"id\": \"45******56\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "title": "AgreementInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delete-qualification-review-0000002526538788", + "title": "删除资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442", + "title": "查询用户协议列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section41670133", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section11431111271820", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section1945115411389", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section63342526", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section15251637114113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section41670133", + "text": "此接口用于新建HarmonyOS应用/元服务的用户协议。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section41670133", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/agreement" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "type", + "M", + "Integer(32)", + "协议类型。 取值范围: 2:用户协议" + ], + [ + "defaultLang", + "O", + "String(20)", + "用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + ], + [ + "agreementInfos", + "O", + "AgreementInfo", + "用户协议列表。 数组长度不超过100。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section11431111271820" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "id", + "O", + "String", + "用户协议ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section63342526" + } + ], + "title": "新建用户协议", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:04.732Z", + "family": "publishing", + "endpoint": "user-agreement-create" +} diff --git a/pkg/domain/reference/publishing/user-agreement-list.constraints.json b/pkg/domain/reference/publishing/user-agreement-list.constraints.json new file mode 100644 index 0000000..4da9c2f --- /dev/null +++ b/pkg/domain/reference/publishing/user-agreement-list.constraints.json @@ -0,0 +1,27 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.agreementIdList": { + "minItems": 1, + "maxItems": 1000 + }, + "body.name": { + "maxLength": 100 + }, + "body.status": { + "enum": [ + "2", + "3" + ] + }, + "body.type": { + "enum": [ + "2" + ] + }, + "body.maxReqCount": { + "minimum": 1, + "maximum": 100 + } +} diff --git a/pkg/domain/reference/publishing/user-agreement-list.json b/pkg/domain/reference/publishing/user-agreement-list.json new file mode 100644 index 0000000..b5c4806 --- /dev/null +++ b/pkg/domain/reference/publishing/user-agreement-list.json @@ -0,0 +1,305 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section590591091819", + "text": "请求示例\nPOST /api/publish/v2/agreement/list HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\nappId: 1******57\n{\n \"agreementIdList\": [\n \"\"\n ],\n \"name\": \"\",\n \"status\": 2,\n \"type\": 2,\n \"fromRecCount\": 1,\n \"maxReqCount\": 30\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section3931254151818", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"totalCount\": 1,\n \"agreements\": [\n {\n \"id\": \"15********08\",\n \"type\": 2,\n \"agreementInfos\": [\n {\n \"lang\": \"zh\",\n \"baseInfo\": {\n \"name\": \"N*******9\",\n \"agreementTitle\": \"**********\",\n \"userAgreementUrl\": \"http://**********\"\n }\n }\n ],\n \"versionCode\": 1,\n \"status\": 2,\n \"defaultLang\": \"zh\",\n \"createTime\": 1733555215000,\n \"updateTime\": 1733555215000\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-user-0000002271160613", + "title": "Agreement" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581", + "title": "新建用户协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626", + "title": "更新用户协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section154708823714", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section590591091819", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section1383010100386", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section3931254151818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section154708823714", + "text": "此接口用于查询HarmonyOS应用/元服务的用户协议信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section154708823714", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/agreement/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "agreementIdList", + "O", + "List", + "用户协议ID。 数组长度为1~1000。" + ], + [ + "name", + "M", + "String(100)", + "用户协议名称。 使用模糊查询方式。" + ], + [ + "status", + "O", + "Integer(32)", + "用户协议状态。 取值范围: 2:已完成 3:已删除" + ], + [ + "type", + "O", + "Integer(32)", + "协议类型。 取值范围: 2:用户协议" + ], + [ + "fromRecCount", + "O", + "Integer(32)", + "查询起始位置。 默认值:1" + ], + [ + "maxReqCount", + "O", + "Integer", + "最大请求查询数。 取值范围:[1,100] 默认值:30" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section2357705386" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "totalCount", + "O", + "Integer", + "用户协议总数量。" + ], + [ + "agreements", + "O", + "Agreement", + "用户协议信息列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442#section1383010100386" + } + ], + "title": "查询用户协议列表", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:06.324Z", + "family": "publishing", + "endpoint": "user-agreement-list" +} diff --git a/pkg/domain/reference/publishing/user-agreement-update.constraints.json b/pkg/domain/reference/publishing/user-agreement-update.constraints.json new file mode 100644 index 0000000..2c59c59 --- /dev/null +++ b/pkg/domain/reference/publishing/user-agreement-update.constraints.json @@ -0,0 +1,14 @@ +{ + "header.appId": { + "maxLength": 32 + }, + "body.id": { + "maxLength": 32 + }, + "body.defaultLang": { + "maxLength": 20 + }, + "body.agreementInfos": { + "maxItems": 100 + } +} diff --git a/pkg/domain/reference/publishing/user-agreement-update.json b/pkg/domain/reference/publishing/user-agreement-update.json new file mode 100644 index 0000000..f48a33c --- /dev/null +++ b/pkg/domain/reference/publishing/user-agreement-update.json @@ -0,0 +1,281 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section1945115411389", + "text": "请求示例\nPUT /api/publish/v2/agreement HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 414*******68\nContent-Type: application/json; \nAuthorization: Bearer *****\nappId: 1******57\n{\n \"id\": \"15********08\",\n \"defaultLang\": \"zh\",\n \"agreementInfos\": [\n {\n \"lang\": \"zh\",\n \"baseInfo\": {\n \"name\": \"新增\",\n \"agreementTitle\": \"新增中文\",\n \"userAgreementUrl\": \"https://*****/****/****\"\n }\n }, \n {\n \"lang\": \"en\",\n \"baseInfo\": {\n \"name\": \"新增\",\n \"agreementTitle\": \"新增英文\",\n \"userAgreementUrl\": \"https://*****/****/****\"\n }\n }, \n {\n \"lang\": \"zh-Hant-HK\",\n \"baseInfo\": {\n \"name\": \"新增\",\n \"agreementTitle\": \"香港\",\n \"userAgreementUrl\": \"https://*****/****/****\"\n }\n } \n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section15251637114113", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success.\"\n },\n \"id\": \"15********08\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "title": "AgreementInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-user-agreement-0000002236041442", + "title": "查询用户协议列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-privacy-agreement-0000002271000633", + "title": "提交隐私政策协议" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section41670133", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section11431111271820", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section1945115411389", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section63342526", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section15251637114113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section41670133", + "text": "此接口用于更新HarmonyOS应用/元服务的用户协议信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section41670133", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/agreement" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section6932219103913" + }, + { + "authenticationBranch": "Service Account方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165" + }, + { + "authenticationBranch": "API客户端方式:", + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "M", + "String(32)", + "用户协议ID。" + ], + [ + "defaultLang", + "O", + "String(20)", + "用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + ], + [ + "agreementInfos", + "O", + "List", + "用户协议列表。 数组长度不超过100。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section11431111271820" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "id", + "O", + "String", + "用户协议ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-update-user-agreement-0000002294845626#section63342526" + } + ], + "title": "更新用户协议", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:18.109Z", + "family": "publishing", + "endpoint": "user-agreement-update" +} diff --git a/pkg/domain/reference/reports/activityawardexport.json b/pkg/domain/reference/reports/activityawardexport.json new file mode 100644 index 0000000..5ad94c1 --- /dev/null +++ b/pkg/domain/reference/reports/activityawardexport.json @@ -0,0 +1,422 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#ZH-CN_TOPIC_0000001158245071__p975514204216", + "title": "给指定用户群发奖的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212", + "title": "获取预约的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102", + "title": "获取新增和留存的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section20546835", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section1938712427321", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section53186971", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section20546835", + "text": "获取指定给用户群发奖的报表数据的CSV文件地址。接口调用者的角色:账号持有者、管理员、App管理员、运营、财务。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section1938712427321", + "text": "本接口仅支持在中国大陆地区发布的应用。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section1938712427321", + "text": "为了防止注入风险,给指定用户群发奖的报表内容中的“活动名称”如果存在特殊字符(“+”或“-”或“@”或“=”),则会对该“活动名称”做转义处理。转义处理的规则是在待转义字符串前加tab键,然后将整个字符串用双引号括起来。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section53186971", + "text": "给指定用户群发奖的报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/activityAwardExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "filterCondition", + "O", + "List", + "过滤器,目前只支持“activityId”,表示基于活动过滤。如果不传此参数默认无过滤器。 URL示例:&filterCondition=activityId" + ], + [ + "filterConditionValue", + "O", + "List", + "过滤器对应的值,例如过滤器是“activityId”,此参数的取值为活动ID。目前只支持输入1个活动ID,不支持输入多个活动ID。 活动ID可在AppGallery Connect网站应用开发页面的“运营 > 活动运营 > 活动管理”页面查看。 URL示例:&filterConditionValue=939130" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV文件的路径。 报表文件中字段语言由language参数指定。以报表字段英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见给指定用户群发奖的报表数据说明。" + ], + [ + "packName", + "M", + "String", + "应用包名。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section53186971" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "日期", + "Time", + "Время", + "数据统计按时间进行分组。" + ], + [ + "活动ID", + "ID", + "ID", + "用户召回活动ID。" + ], + [ + "活动名称", + "Name", + "Имя", + "用户召回活动名称。" + ], + [ + "活动开始时间", + "Start time", + "Время начала", + "用户召回活动开始时间。" + ], + [ + "活动奖品到达总用户数", + "Total users receiving prizes", + "Всего пользователей, получивших призы", + "收到奖品的总用户人数。" + ], + [ + "登录用户数", + "Signed-in users", + "Пользователей, вошедших в систему", + "从活动开始时间到当前日期,活动奖品到达后在当前应用中有登录行为的用户数。" + ], + [ + "登录用户占比", + "Rate of signed-in users", + "Процент пользователей, вошедших в систему", + "从活动开始时间到当前日期,活动奖品到达后在当前应用中有登录行为的用户数占总用户数的比例。" + ], + [ + "付费用户数", + "Paying users", + "Платящие пользователи", + "从活动开始时间到当前日期,活动奖品到达后在当前应用中有付费行为的用户数。" + ], + [ + "付费用户占比", + "Rate of paying users", + "Процент платящих пользователей", + "从活动开始时间到当前日期,活动奖品到达后在当前应用中有付费行为的用户数占总用户数的比例。" + ], + [ + "付费现金流水(元)", + "Cash payment (CNY)", + "Платеж (CNY)", + "从活动开始时间到当前日期,在当前应用中产生的付费现金流水。" + ], + [ + "付费总流水(元)", + "Total payment (CNY)", + "Сумма платежей (CNY)", + "从活动开始时间到当前日期,在当前应用中产生的付费总流水。" + ], + [ + "优惠券使用用户数", + "Users using coupons", + "Пользователи, использовавшие купоны", + "从活动开始时间到当前日期,使用优惠券的用户人数。" + ], + [ + "优惠券支付产生的现金流水(元)", + "Cash payment using coupon (CNY)", + "Оплата при помощи купона (CNY)", + "从活动开始时间到当前日期,在当前应用中使用优惠券支付产生的现金流水。" + ], + [ + "优惠券支付产生的总流水(元)", + "Total payment using coupon (CNY)", + "Сумма оплаты при помощи купона (CNY)", + "从活动开始时间到当前日期,在当前应用中使用优惠券支付产生的现金总流水。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section53186971" + } + ], + "title": "获取给指定用户群发奖的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:55:48.944Z", + "family": "reports", + "endpoint": "activityawardexport" +} diff --git a/pkg/domain/reference/reports/activityawardexport.parameters.json b/pkg/domain/reference/reports/activityawardexport.parameters.json new file mode 100644 index 0000000..7df837a --- /dev/null +++ b/pkg/domain/reference/reports/activityawardexport.parameters.json @@ -0,0 +1,57 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206" + }, + { + "name": "filterCondition", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器,目前只支持“activityId”,表示基于活动过滤。如果不传此参数默认无过滤器。 URL示例:&filterCondition=activityId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "itemsType": "string" + }, + { + "name": "filterConditionValue", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器对应的值,例如过滤器是“activityId”,此参数的取值为活动ID。目前只支持输入1个活动ID,不支持输入多个活动ID。 活动ID可在AppGallery Connect网站应用开发页面的“运营 > 活动运营 > 活动管理”页面查看。 URL示例:&filterConditionValue=939130", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "itemsType": "string" + } +] diff --git a/pkg/domain/reference/reports/activityawardexport.rules.json b/pkg/domain/reference/reports/activityawardexport.rules.json new file mode 100644 index 0000000..4e45ecb --- /dev/null +++ b/pkg/domain/reference/reports/activityawardexport.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } +] diff --git a/pkg/domain/reference/reports/addadkpexport.json b/pkg/domain/reference/reports/addadkpexport.json new file mode 100644 index 0000000..d292c3d --- /dev/null +++ b/pkg/domain/reference/reports/addadkpexport.json @@ -0,0 +1,369 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#ZH-CN_TOPIC_0000001111845102__p410319181351", + "title": "新增和留存的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071", + "title": "获取给指定用户群发奖的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061", + "title": "获取应用内付费的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section44107759", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section61425515", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section24077145", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section44107759", + "text": "获取新增和留存的报表数据的CSV或者Excel文件地址。接口调用者的角色:账号持有者、管理员、App管理员、运营。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section61425515", + "text": "本接口只支持中国大陆地区发布的应用。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section24077145", + "text": "新增和留存的报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/addAdKpExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "userTag", + "O", + "Integer", + "基于账号还是设备查询。 取值范围: 0: 账号 1: 设备 默认值:1" + ], + [ + "exportType", + "O", + "String", + "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或Excel文件的路径。 报表文件中字段语言由language参数指定,首个字段为groupBy参数中指定的数据统计分组类型。以报表字段英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见新增和留存的报表数据说明。" + ], + [ + "packName", + "M", + "String", + "应用包名。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section24077145" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "日期", + "Time", + "Время", + "数据统计按时间进行分组。" + ], + [ + "活跃用户数", + "Active devices", + "Активные пользователи", + "时间间隔范围内登录过的账号数。" + ], + [ + "新增用户数", + "New devices", + "Новые пользователи", + "时间间隔范围内新注册账号数。" + ], + [ + "活跃用户次日留存率", + "Day 2 new device retention rate", + "Процент удержания новых пользователей (день 2)", + "统计日新增用户次日保持活跃的比率。" + ], + [ + "活跃用户三日留存率", + "Day 3 new device retention rate", + "Процент удержания новых пользователей (день 3)", + "统计日新增用户三日保持活跃的比率。" + ], + [ + "活跃用户七日留存率", + "Day 7 new device retention rate", + "Процент удержания новых пользователей (день 7)", + "统计日新增用户七日保持活跃的比率。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section24077145" + } + ], + "title": "获取新增和留存的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:17.878Z", + "family": "reports", + "endpoint": "addadkpexport" +} diff --git a/pkg/domain/reference/reports/addadkpexport.parameters.json b/pkg/domain/reference/reports/addadkpexport.parameters.json new file mode 100644 index 0000000..a357b94 --- /dev/null +++ b/pkg/domain/reference/reports/addadkpexport.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206" + }, + { + "name": "userTag", + "in": "query", + "type": "integer", + "required": false, + "description": "基于账号还是设备查询。 取值范围: 0: 账号 1: 设备 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "enum": [ + "0", + "1" + ] + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/addadkpexport.rules.json b/pkg/domain/reference/reports/addadkpexport.rules.json new file mode 100644 index 0000000..9f6955c --- /dev/null +++ b/pkg/domain/reference/reports/addadkpexport.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } +] diff --git a/pkg/domain/reference/reports/appdownloadexport.json b/pkg/domain/reference/reports/appdownloadexport.json new file mode 100644 index 0000000..a0743e3 --- /dev/null +++ b/pkg/domain/reference/reports/appdownloadexport.json @@ -0,0 +1,418 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#ZH-CN_TOPIC_0000001158365059__p11623192525520", + "title": "下载安装报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212", + "title": "获取预约的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section19922493", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section50519608", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section19922493", + "text": "获取下载安装的报表数据的CSV或者Excel文件地址。接口调用者的角色:账号持有者、管理员、App管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section50519608", + "text": "下载安装报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/appDownloadExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "filterCondition", + "O", + "List", + "过滤器。 取值范围: countryId:按国家过滤。 businessType:按业务类型过滤。 appVersion:按应用版本过滤。 如果不传,默认无过滤器。 支持countryId、businessType和appVersion同时使用,URL示例:&filterCondition=countryId&filterCondition=businessType&filterCondition=appVersion" + ], + [ + "filterConditionValue", + "O", + "List", + "过滤器对应的值。 如果过滤器为countryId,此参数的取值为国家码的字符串数组,例如“CN, AL, AD, AT”。具体国家码列表参考国家码。传入“all”表示查询全球。传入“others”表示仅查询“US,CU,IR,SD,SY”(美国,古巴,伊朗,苏丹,叙利亚),获取的数据作为一个整体展示,例如“CN,AL,others”。“all”和“others”不区分大小写。 如果过滤器为businessType,此参数的取值为业务类型,取值范围为: ALL:所有业务 AppGallery:华为应用市场 AppTouch:AppTouch业务 取值区分大小写。 如果过滤器为appVersion,此参数的取值为应用版本,多个版本以英文逗号分隔,如:“1.0.0,2.0.0”。“all”表示查询所有应用版本,“all”不区分大小写。 如果传入多个过滤器,使用多个filterConditionValue表示,顺序必须与filterCondition中过滤器的顺序一致。URL示例:&filterConditionValue=CN&filterConditionValue=AppGallery。" + ], + [ + "groupBy", + "O", + "String", + "数据统计的分组信息,支持按如下依据分组。 取值范围: date:按日期分组 countryId:按国家分组 businessType:按业务类型分组 appVersion:按应用版本分组 默认值:date" + ], + [ + "exportType", + "O", + "String", + "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或Excel文件的路径。 报表文件中字段语言由language参数指定,首个字段为groupBy参数中指定的数据统计分组类型。以报表字段为英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见下载安装报表数据说明。" + ], + [ + "packName", + "M", + "String", + "应用包名。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section50519608" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "日期", + "Time", + "Время", + "数据统计按时间进行分组。 注意 只有当请求参数groupBy传入date时才会返回此字段。" + ], + [ + "国家/地区", + "Country/Region", + "Страна/регион", + "数据统计按国家或地区进行分组。 注意 只有当请求参数groupBy传入countryId时才会返回此字段。" + ], + [ + "业务类型", + "Channel", + "Канал", + "数据统计按业务类型进行分组。 注意 只有当请求参数groupBy传入businessType时才会返回此字段。" + ], + [ + "应用版本", + "App version", + "Версия приложения", + "数据统计按应用版本进行分组。 注意 只有当请求参数groupBy传入appVersion时才会返回此字段。" + ], + [ + "曝光", + "Impressions", + "Впечатления", + "应用在AppGallery推荐、排行榜、搜索等资源位被展示次数。" + ], + [ + "详情页查看", + "App details page views", + "Просмотры страницы сведений приложения", + "详情页被浏览的次数。" + ], + [ + "总下载成功", + "Total downloads", + "Общее количество загрузок", + "更新下载成功+新下载成功。" + ], + [ + "更新下载成功", + "Update downloads", + "Загрузки обновлений", + "用户通过华为应用市场更新应用版本产生的下载成功量。" + ], + [ + "新下载成功", + "New downloads", + "Новые загрузки", + "用户通过华为应用市场新增应用版本产生的下载成功量。" + ], + [ + "卸载数", + "Uninstalls", + "Удаления", + "应用安装后的卸载量。" + ], + [ + "曝光点击率", + "CTR", + "CTR", + "(详情页查看次数+快捷下载成功次数) / 曝光次数。" + ], + [ + "详情页转化率", + "CVR of app details page", + "CVR страницы сведений приложения", + "详情页带来的新下载成功量/详情页查看量。" + ], + [ + "安装成功率", + "Installs to downloads ratio", + "Отношение количества установок к загрузкам", + "应用下载成功后安装成功的比率。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section50519608" + } + ], + "title": "获取下载安装的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:18.806Z", + "family": "reports", + "endpoint": "appdownloadexport" +} diff --git a/pkg/domain/reference/reports/appdownloadexport.parameters.json b/pkg/domain/reference/reports/appdownloadexport.parameters.json new file mode 100644 index 0000000..784337e --- /dev/null +++ b/pkg/domain/reference/reports/appdownloadexport.parameters.json @@ -0,0 +1,77 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206" + }, + { + "name": "filterCondition", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器。 取值范围: countryId:按国家过滤。 businessType:按业务类型过滤。 appVersion:按应用版本过滤。 如果不传,默认无过滤器。 支持countryId、businessType和appVersion同时使用,URL示例:&filterCondition=countryId&filterCondition=businessType&filterCondition=appVersion", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "itemsType": "string" + }, + { + "name": "filterConditionValue", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器对应的值。 如果过滤器为countryId,此参数的取值为国家码的字符串数组,例如“CN, AL, AD, AT”。具体国家码列表参考国家码。传入“all”表示查询全球。传入“others”表示仅查询“US,CU,IR,SD,SY”(美国,古巴,伊朗,苏丹,叙利亚),获取的数据作为一个整体展示,例如“CN,AL,others”。“all”和“others”不区分大小写。 如果过滤器为businessType,此参数的取值为业务类型,取值范围为: ALL:所有业务 AppGallery:华为应用市场 AppTouch:AppTouch业务 取值区分大小写。 如果过滤器为appVersion,此参数的取值为应用版本,多个版本以英文逗号分隔,如:“1.0.0,2.0.0”。“all”表示查询所有应用版本,“all”不区分大小写。 如果传入多个过滤器,使用多个filterConditionValue表示,顺序必须与filterCondition中过滤器的顺序一致。URL示例:&filterConditionValue=CN&filterConditionValue=AppGallery。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "itemsType": "string" + }, + { + "name": "groupBy", + "in": "query", + "type": "string", + "required": false, + "description": "数据统计的分组信息,支持按如下依据分组。 取值范围: date:按日期分组 countryId:按国家分组 businessType:按业务类型分组 appVersion:按应用版本分组 默认值:date", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206" + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/appdownloadexport.rules.json b/pkg/domain/reference/reports/appdownloadexport.rules.json new file mode 100644 index 0000000..a6f5917 --- /dev/null +++ b/pkg/domain/reference/reports/appdownloadexport.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } +] diff --git a/pkg/domain/reference/reports/appdownloadfailexport.json b/pkg/domain/reference/reports/appdownloadfailexport.json new file mode 100644 index 0000000..cbefda9 --- /dev/null +++ b/pkg/domain/reference/reports/appdownloadfailexport.json @@ -0,0 +1,386 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#ZH-CN_TOPIC_0000001158365063__p1685145815179", + "title": "安装失败的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section49483413", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section26149930", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section49483413", + "text": "获取安装失败数据的报表CSV或EXCEL文件。接口调用者的角色:账号持有者、管理员、App管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section26149930", + "text": "安装失败的报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/appDownloadFailExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + ], + [ + "filterCondition", + "O", + "List", + "过滤器,目前只支持机型“deviceName”、下载类型“downloadType”、应用版本“appVersion”和国家/地区“countryId”过滤。四个参数可以组合。如果不传此参数默认无过滤器。URL示例:&filterCondition=deviceName&filterCondition=downloadType&filterCondition=countryId" + ], + [ + "filterConditionValue", + "O", + "List", + "过滤器对应的值。 downloadType对应的取值:1(新下载)、2(更新下载)。 deviceName为设备型号的名称,取值例如: “Mate30Pro-5G版”、“P40-lite”、“P30-Pro”、“P40-lite-5G”、“nova7-SE”、“nova7_SE_5G乐活版”、“nova6-5G版”、“nova6-SE”。 countryId对应的值:“CN,AL,AD,AT” appVersion对应的值:\"1.0.0,2.0.0\" URL示例:&filterConditionValue=mate20&filterConditionValue=1&filterConditionValue=CN" + ], + [ + "groupBy", + "O", + "List", + "数据统计的分组信息。支持按照日期(date) 、机型(deviceName)、下载类型(downloadType)、应用版本(appVersion)或国家/地区(countryId)进行分组。如果不传默认按照日期分组。" + ], + [ + "exportType", + "O", + "String", + "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或EXCEL文件的路径。 报表文件中字段语言由language参数指定,首个字段为groupBy参数中指定的数据统计分组类型。以报表字段英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见安装失败的报表数据说明。" + ], + [ + "packName", + "M", + "String", + "应用包名。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section26149930" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "日期", + "date", + "Время", + "数据统计按时间进行分组。 注意 只有当请求参数groupBy传入date时才会返回此字段。" + ], + [ + "机型", + "deviceName", + "Модель", + "数据统计按机型进行分组。 注意 只有当请求参数groupBy传入deviceName时才会返回此字段。" + ], + [ + "下载类型", + "downloadType", + "Тип загрузки", + "数据统计按下载类型进行分组。 注意 只有当请求参数groupBy传入downloadType时才会返回此字段。" + ], + [ + "应用版本", + "appVersion", + "Версия приложения", + "数据统计按应用版本进行分组。 注意 只有当请求参数groupBy传入appVersion时才会返回此字段。" + ], + [ + "国家/地区", + "countryId", + "Страна/регион", + "数据统计按国家/地区进行分组。 注意 只有当请求参数groupBy传入countryId时才会返回此字段。" + ], + [ + "错误代码", + "Result code", + "Код результата", + "安装失败返回的错误码,详细参考Android官方源代码 (INSTALL_FAILED_*部分)源代码查看链接。" + ], + [ + "错误原因", + "Cause", + "Причина", + "安装失败的错误原因。" + ], + [ + "安装失败设备数", + "Devices with app installation failures", + "Устройства со сбоями установок", + "时间间隔范围内的安装失败设备数。" + ], + [ + "安装失败设备数占比", + "Proportion of devices with installation failures", + "Соотношение устройств со сбоями установки", + "时间间隔范围内的安装失败设备数占比。" + ], + [ + "安装失败次数", + "Installation failures", + "Сбои установки", + "时间间隔范围内的安装失败次数。" + ], + [ + "安装失败次数占比", + "Proportion of installation failures", + "Соотношение сбоев установок", + "时间间隔范围内的安装失败次数占比。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section26149930" + } + ], + "title": "获取安装失败数据的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:19.769Z", + "family": "reports", + "endpoint": "appdownloadfailexport" +} diff --git a/pkg/domain/reference/reports/appdownloadfailexport.parameters.json b/pkg/domain/reference/reports/appdownloadfailexport.parameters.json new file mode 100644 index 0000000..16d922b --- /dev/null +++ b/pkg/domain/reference/reports/appdownloadfailexport.parameters.json @@ -0,0 +1,78 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508" + }, + { + "name": "filterCondition", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器,目前只支持机型“deviceName”、下载类型“downloadType”、应用版本“appVersion”和国家/地区“countryId”过滤。四个参数可以组合。如果不传此参数默认无过滤器。URL示例:&filterCondition=deviceName&filterCondition=downloadType&filterCondition=countryId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "itemsType": "string" + }, + { + "name": "filterConditionValue", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器对应的值。 downloadType对应的取值:1(新下载)、2(更新下载)。 deviceName为设备型号的名称,取值例如: “Mate30Pro-5G版”、“P40-lite”、“P30-Pro”、“P40-lite-5G”、“nova7-SE”、“nova7_SE_5G乐活版”、“nova6-5G版”、“nova6-SE”。 countryId对应的值:“CN,AL,AD,AT” appVersion对应的值:\"1.0.0,2.0.0\" URL示例:&filterConditionValue=mate20&filterConditionValue=1&filterConditionValue=CN", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "itemsType": "string" + }, + { + "name": "groupBy", + "in": "query", + "type": "array", + "required": false, + "description": "数据统计的分组信息。支持按照日期(date) 、机型(deviceName)、下载类型(downloadType)、应用版本(appVersion)或国家/地区(countryId)进行分组。如果不传默认按照日期分组。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "itemsType": "string" + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/appdownloadfailexport.rules.json b/pkg/domain/reference/reports/appdownloadfailexport.rules.json new file mode 100644 index 0000000..7cad5cf --- /dev/null +++ b/pkg/domain/reference/reports/appdownloadfailexport.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063#section423141017508", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } +] diff --git a/pkg/domain/reference/reports/couponexport.json b/pkg/domain/reference/reports/couponexport.json new file mode 100644 index 0000000..0233dcb --- /dev/null +++ b/pkg/domain/reference/reports/couponexport.json @@ -0,0 +1,392 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#ZH-CN_TOPIC_0000001111845104__p23515435153", + "title": "优惠券活动的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073", + "title": "获取付费下载明细的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063", + "title": "获取安装失败数据的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section56076920", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section34930232", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section481707", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section56076920", + "text": "获取优惠券活动的报表CSV或EXCEL文件。接口调用者的角色:账号持有者、管理员、App管理员、运营、财务。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section34930232", + "text": "本接口仅支持中国大陆地区发布的应用。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section34930232", + "text": "为了防止注入风险,优惠券活动的报表内容中的“活动名称”如果存在特殊字符(“+”或“-”或“@”或“=”),则会对该“活动名称”做转义处理。转义处理的规则是在待转义字符串前加tab键,然后将整个字符串用双引号括起来。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section481707", + "text": "优惠券活动的报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/activityCouponExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。" + ], + [ + "filterCondition", + "O", + "List", + "过滤器,目前只支持“activityId”,表示基于活动过滤。如果不传此参数默认无过滤器。 URL示例:&filterCondition=activityId" + ], + [ + "filterConditionValue", + "O", + "List", + "过滤器对应的值,例如过滤器是“activityId”,此参数的取值为活动ID。目前只支持输入1个活动ID,不支持输入多个活动ID。 活动ID可在AppGallery Connect网站应用开发页面的“运营 > 活动运营 > 活动管理”页面查看。 URL示例:&filterConditionValue=123456" + ], + [ + "exportType", + "O", + "String", + "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV文件的路径。 报表文件中字段语言由language参数指定。以报表字段英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见优惠券活动的报表数据说明。" + ], + [ + "packName", + "M", + "String", + "应用包名。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section481707" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "活动ID", + "ID", + "ID", + "优惠券活动ID。" + ], + [ + "活动名称", + "Name", + "Имя", + "优惠券活动名称。" + ], + [ + "活动时间", + "Time", + "Время", + "优惠券活动开展有效时间。" + ], + [ + "发放日期", + "Allocated", + "Распределено", + "活动优惠券奖品的发放日期。" + ], + [ + "发放金额(元)", + "Allocated amount (CNY)", + "Распределенная сумма (CNY)", + "所查询活动的总发放金额。" + ], + [ + "消费金额(元)", + "Consumed amount (CNY)", + "Потраченная сумма (CNY)", + "所查询活动的总消费金额。" + ], + [ + "过期金额(元)", + "Expired amount (CNY)", + "Просроченная сумма (CNY)", + "所查询活动的总过期金额。" + ], + [ + "剩余金额(元)", + "Remaining amount (CNY)", + "Оставшаяся сумма (CNY)", + "所查询活动的总剩余金额。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section481707" + } + ], + "title": "获取优惠券活动的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:20.937Z", + "family": "reports", + "endpoint": "couponexport" +} diff --git a/pkg/domain/reference/reports/couponexport.parameters.json b/pkg/domain/reference/reports/couponexport.parameters.json new file mode 100644 index 0000000..13dc60f --- /dev/null +++ b/pkg/domain/reference/reports/couponexport.parameters.json @@ -0,0 +1,69 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206" + }, + { + "name": "filterCondition", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器,目前只支持“activityId”,表示基于活动过滤。如果不传此参数默认无过滤器。 URL示例:&filterCondition=activityId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "itemsType": "string" + }, + { + "name": "filterConditionValue", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器对应的值,例如过滤器是“activityId”,此参数的取值为活动ID。目前只支持输入1个活动ID,不支持输入多个活动ID。 活动ID可在AppGallery Connect网站应用开发页面的“运营 > 活动运营 > 活动管理”页面查看。 URL示例:&filterConditionValue=123456", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "itemsType": "string" + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/couponexport.rules.json b/pkg/domain/reference/reports/couponexport.rules.json new file mode 100644 index 0000000..a6a07e6 --- /dev/null +++ b/pkg/domain/reference/reports/couponexport.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } +] diff --git a/pkg/domain/reference/reports/fa-distribute-analysis-export.json b/pkg/domain/reference/reports/fa-distribute-analysis-export.json new file mode 100644 index 0000000..c24989b --- /dev/null +++ b/pkg/domain/reference/reports/fa-distribute-analysis-export.json @@ -0,0 +1,310 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#ZH-CN_TOPIC_0000001690307352__zh-cn_topic_0000001707913661_p25111717122119", + "title": "下载元服务分发分析的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadfailexport-0000001158365063", + "title": "获取安装失败数据的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949", + "title": "获取元服务新增留存的报表文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section19922493", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section50519608", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section19922493", + "text": "获取元服务分发分析的报表数据的CSV或者Excel文件地址。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section19922493", + "text": "如果接口调用者是普通开发者,则接口调用者的角色:账号持有者、国内管理员、App管理员、国内运营、国内财务。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section236517415165", + "text": "本接口支持使用API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section50519608", + "text": "下载元服务分发分析的报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/fa/distributeAnalysisExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID。 获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息。 格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "teamId", + "M", + "String(64)", + "主账号用户ID,即teamId。用于越权校验。" + ], + [ + "appId", + "M", + "String(64)", + "应用ID。 获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息。 传入获取用户授权码中获取的Access Token。" + ], + [ + "teamId", + "M", + "String(64)", + "主账号用户ID,即teamId。用于越权校验。" + ], + [ + "appId", + "M", + "String(64)", + "应用ID。 获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "O", + "String(10)", + "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + ], + [ + "exportType", + "O", + "String", + "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或Excel文件的路径。 报表文件中字段语言由language参数指定。报表字段当前仅支持中文,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见下载元服务分发分析的报表数据说明。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串。 格式为{\"code\":retcode, \"msg\": \"description\"},其中retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section50519608" + }, + { + "location": "", + "rows": [ + [ + "字段名", + "字段含义" + ], + [ + "时间", + "数据统计日期。" + ], + [ + "点击次数", + "用户主动点击元服务卡片行为的次数。" + ], + [ + "点击设备数", + "用户主动点击元服务卡片行为的设备数。" + ], + [ + "加桌次数", + "用户主动添加元服务卡片到桌面行为的次数。" + ], + [ + "加桌设备数", + "用户主动添加元服务卡片到桌面行为的设备数。" + ], + [ + "移除桌面次数", + "用户主动从桌面移除元服务卡片行为的次数。" + ], + [ + "移除桌面设备数", + "用户主动从桌面移除元服务卡片行为的设备数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section50519608" + } + ], + "title": "获取元服务分发分析的报表文件", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:22.007Z", + "family": "reports", + "endpoint": "fa-distribute-analysis-export" +} diff --git a/pkg/domain/reference/reports/fa-distribute-analysis-export.parameters.json b/pkg/domain/reference/reports/fa-distribute-analysis-export.parameters.json new file mode 100644 index 0000000..a0b46fa --- /dev/null +++ b/pkg/domain/reference/reports/fa-distribute-analysis-export.parameters.json @@ -0,0 +1,44 @@ +[ + { + "name": "language", + "in": "query", + "type": "string", + "required": false, + "description": "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "maxLength": 10, + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911" + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/fa-distribute-analysis-export.rules.json b/pkg/domain/reference/reports/fa-distribute-analysis-export.rules.json new file mode 100644 index 0000000..bd017b1 --- /dev/null +++ b/pkg/domain/reference/reports/fa-distribute-analysis-export.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352#section27982911", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } +] diff --git a/pkg/domain/reference/reports/fa-user-analysis-export.json b/pkg/domain/reference/reports/fa-user-analysis-export.json new file mode 100644 index 0000000..6f7b53d --- /dev/null +++ b/pkg/domain/reference/reports/fa-user-analysis-export.json @@ -0,0 +1,332 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#ZH-CN_TOPIC_0000001738465949__zh-cn_topic_0000001707833313_p25111717122119", + "title": "下载元服务新增留存的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-distribute_analysis_export-0000001690307352", + "title": "获取元服务分发分析的报表文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092", + "title": "获取元服务卡片分析的报表文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section19922493", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section50519608", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section19922493", + "text": "获取元服务新增留存的报表数据的CSV或者Excel文件地址。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section19922493", + "text": "如果接口调用者是普通开发者,则接口调用者的角色:账号持有者、国内管理员、App管理员、国内运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section236517415165", + "text": "本接口支持使用API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section50519608", + "text": "下载元服务新增留存的报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/fa/userAnalysisExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID。 获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息。 格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "teamId", + "M", + "String(64)", + "主账号用户ID,即teamId。用于越权校验。" + ], + [ + "appId", + "M", + "String(64)", + "应用ID。 获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息。 传入获取用户授权码中获取的Access Token。" + ], + [ + "teamId", + "M", + "String(64)", + "主账号用户ID,即teamId。用于越权校验。" + ], + [ + "appId", + "M", + "String(64)", + "应用ID。 获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "O", + "String(10)", + "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + ], + [ + "userTag", + "M", + "Integer", + "统计维度类型。 取值范围: 0:按照账号维度 1:按照设备维度 默认值:0" + ], + [ + "exportType", + "O", + "String", + "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或Excel文件的路径。 报表文件中字段语言由language参数指定。报表字段当前仅支持中文,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见下载元服务新增留存的报表数据说明。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串。 格式为{\"code\":retcode, \"msg\": \"description\"},其中retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section50519608" + }, + { + "location": "", + "rows": [ + [ + "字段名", + "字段含义" + ], + [ + "时间", + "数据统计日期。" + ], + [ + "新增用户数", + "首次访问服务的去重用户数。" + ], + [ + "活跃用户数", + "访问服务的去重用户数。" + ], + [ + "新增用户次日留存率", + "统计日新增用户次日保持活跃的比率。" + ], + [ + "新增用户三日留存率", + "统计日新增用户三日保持活跃的比率。" + ], + [ + "新增用户七日留存率", + "统计日新增用户七日保持活跃的比率。" + ], + [ + "新增设备数", + "首次访问服务的去重设备数。" + ], + [ + "活跃设备数", + "访问服务的去重设备数。" + ], + [ + "新增设备次日留存率", + "统计日新增设备次日保持活跃的比率。" + ], + [ + "新增设备三日留存率", + "统计日新增设备三日保持活跃的比率。" + ], + [ + "新增设备七日留存率", + "统计日新增设备七日保持活跃的比率。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section50519608" + } + ], + "title": "获取元服务新增留存的报表文件", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:23.264Z", + "family": "reports", + "endpoint": "fa-user-analysis-export" +} diff --git a/pkg/domain/reference/reports/fa-user-analysis-export.parameters.json b/pkg/domain/reference/reports/fa-user-analysis-export.parameters.json new file mode 100644 index 0000000..cda948c --- /dev/null +++ b/pkg/domain/reference/reports/fa-user-analysis-export.parameters.json @@ -0,0 +1,56 @@ +[ + { + "name": "language", + "in": "query", + "type": "string", + "required": false, + "description": "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "maxLength": 10, + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911" + }, + { + "name": "userTag", + "in": "query", + "type": "integer", + "required": true, + "description": "统计维度类型。 取值范围: 0:按照账号维度 1:按照设备维度 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "enum": [ + "0", + "1" + ] + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/fa-user-analysis-export.rules.json b/pkg/domain/reference/reports/fa-user-analysis-export.rules.json new file mode 100644 index 0000000..6f6f907 --- /dev/null +++ b/pkg/domain/reference/reports/fa-user-analysis-export.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949#section27982911", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } +] diff --git a/pkg/domain/reference/reports/fa-widget-analysis-export.json b/pkg/domain/reference/reports/fa-widget-analysis-export.json new file mode 100644 index 0000000..3487959 --- /dev/null +++ b/pkg/domain/reference/reports/fa-widget-analysis-export.json @@ -0,0 +1,319 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#ZH-CN_TOPIC_0000001690467092__zh-cn_topic_0000001659674016_p25111717122119", + "title": "下载元服务卡片分析的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-user_analysis_export-0000001738465949", + "title": "获取元服务新增留存的报表文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-errorcode-0000001165183667", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section19922493", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section50519608", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section19922493", + "text": "获取元服务卡片分析的报表数据的CSV或者Excel文件地址。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section19922493", + "text": "如果接口调用者是普通开发者,则接口调用者的角色:账号持有者、国内管理员、App管理员、国内运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section236517415165", + "text": "本接口支持使用API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section50519608", + "text": "下载元服务卡片分析的报表数据说明" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section50519608", + "text": "此报表数据会针对不同尺寸的卡片分别统计。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/fa/widgetAnalysisExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID。 获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息。 格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "teamId", + "M", + "String(64)", + "主账号用户ID,即teamId。用于越权校验。" + ], + [ + "appId", + "M", + "String(64)", + "应用ID。 获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息。 传入获取用户授权码中获取的Access Token。" + ], + [ + "teamId", + "M", + "String(64)", + "主账号用户ID,即teamId。用于越权校验。" + ], + [ + "appId", + "M", + "String(64)", + "应用ID。 获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "O", + "String(10)", + "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。" + ], + [ + "exportType", + "O", + "String", + "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或Excel文件的路径。 报表文件中字段语言由language参数指定。报表字段当前仅支持中文,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见下载元服务卡片分析的报表数据说明。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串。 格式为{\"code\":retcode, \"msg\": \"description\"},其中retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section50519608" + }, + { + "location": "", + "rows": [ + [ + "字段名", + "字段含义" + ], + [ + "点击次数", + "点击桌面卡片次数。" + ], + [ + "点击设备数", + "点击桌面卡片的设备数。" + ], + [ + "加桌设备数", + "用户主动添加元服务卡片到桌面行为的设备数。" + ], + [ + "加桌设备次日留存", + "加桌设备数次日保留在桌面的比率。" + ], + [ + "加桌设备三日留存", + "加桌设备数三日保留在桌面的比率。" + ], + [ + "加桌设备七日留存", + "加桌设备数七日保留在桌面的比率。" + ], + [ + "移除设备数", + "移除卡片的设备数。" + ], + [ + "留存设备数", + "卡片保留在桌面的设备数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section50519608" + } + ], + "title": "获取元服务卡片分析的报表文件", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:24.316Z", + "family": "reports", + "endpoint": "fa-widget-analysis-export" +} diff --git a/pkg/domain/reference/reports/fa-widget-analysis-export.parameters.json b/pkg/domain/reference/reports/fa-widget-analysis-export.parameters.json new file mode 100644 index 0000000..58562d6 --- /dev/null +++ b/pkg/domain/reference/reports/fa-widget-analysis-export.parameters.json @@ -0,0 +1,44 @@ +[ + { + "name": "language", + "in": "query", + "type": "string", + "required": false, + "description": "查询语言。 报表title会根据不同语言来展现。 只支持简体中文(zh-CN), 美式英文(en-US),俄文(ru-RU)。 默认简体中文。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "maxLength": 10, + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间。 UTC时间。 格式:YYYYMMDD startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911" + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型。 取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/fa-widget-analysis-export.rules.json b/pkg/domain/reference/reports/fa-widget-analysis-export.rules.json new file mode 100644 index 0000000..48126ff --- /dev/null +++ b/pkg/domain/reference/reports/fa-widget-analysis-export.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-fa-widget_analysis_export-0000001690467092#section27982911", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } +] diff --git a/pkg/domain/reference/reports/gamereservationexport.json b/pkg/domain/reference/reports/gamereservationexport.json new file mode 100644 index 0000000..8d9d69a --- /dev/null +++ b/pkg/domain/reference/reports/gamereservationexport.json @@ -0,0 +1,399 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#ZH-CN_TOPIC_0000001111685212__p166283135816", + "title": "预约报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-appdownloadexport-0000001158365059", + "title": "获取下载安装的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-activityawardexport-0000001158245071", + "title": "获取给指定用户群发奖的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section17324802", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section21705491", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section4723514", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section17324802", + "text": "获取预约报表数据的CSV或EXCEL文件地址。接口调用者的角色:账号持有者、管理员、App管理员、运营。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section21705491", + "text": "本接口仅支持在中国大陆地区发布的应用。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section4723514", + "text": "预约报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/gameReservationExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,目前只支持简体中文(zh-CN)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或EXCEL文件的路径。 报表文件中字段语言由language参数指定,首个字段为groupBy参数中指定的数据统计分组类型。以报表字段为英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见预约报表数据说明。" + ], + [ + "packName", + "M", + "String", + "应用包名。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section4723514" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "日期", + "Time", + "Время", + "数据统计按时间进行分组。" + ], + [ + "预约详情PV", + "Preorder details PV", + "Просмотры страницы предзаказа", + "预约详情浏览的次数。" + ], + [ + "预约详情浏览设备数", + "Preorder details Devices viewing preorder details page", + "Устройства, на которых была просмотрена страница предзаказа", + "进入预约详情浏览的设备数。" + ], + [ + "预约用户数", + "Preordering users", + "Пользователи, оформившие предзаказ", + "预约该应用的用户数,含快捷预约用户数和详情页预约用户数。" + ], + [ + "详情页预约转换率", + "Preorder conversion rate on details page", + "Показатель конверсий предзаказов на странице описания", + "详情页带来的预约用户数/ 预约详情UV。" + ], + [ + "已预约取消用户数", + "Users with preorders canceled", + "Пользователи, отменившие предзаказ", + "取消预约的用户数。" + ], + [ + "累计预约用户数", + "Total preordering users", + "Всего пользователей, оформивших предзаказ", + "截止当前累计预约该应用的用户数。" + ], + [ + "安装成功用户数", + "Users with successful installs", + "Пользователи с выполненными установками", + "应用上线后,已预约用户安装成功的用户。" + ], + [ + "安装转换率", + "Installation rate", + "Показатель установок", + "安装成功用户数/累积预约用户数。" + ], + [ + "新增注册数", + "New sign-ups", + "Новые регистрации", + "应用上线后,已预约用户新增注册用户数。" + ], + [ + "累计注册数", + "Total sign-ups", + "Всего регистраций", + "截止当前应用上线后,已预约用户新增注册用户数。" + ], + [ + "注册转换率", + "Sign-up rate", + "Показатель регистраций", + "累积注册数/累积预约用户数。" + ], + [ + "登录用户数", + "Signed-in users", + "Пользователей, вошедших в систему", + "应用上线后,已预约用户登录用户数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section4723514" + } + ], + "title": "获取预约的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:25.394Z", + "family": "reports", + "endpoint": "gamereservationexport" +} diff --git a/pkg/domain/reference/reports/gamereservationexport.parameters.json b/pkg/domain/reference/reports/gamereservationexport.parameters.json new file mode 100644 index 0000000..30dbb17 --- /dev/null +++ b/pkg/domain/reference/reports/gamereservationexport.parameters.json @@ -0,0 +1,37 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,目前只支持简体中文(zh-CN)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206", + "enum": [ + "zh-CN" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206" + } +] diff --git a/pkg/domain/reference/reports/gamereservationexport.rules.json b/pkg/domain/reference/reports/gamereservationexport.rules.json new file mode 100644 index 0000000..8dedc60 --- /dev/null +++ b/pkg/domain/reference/reports/gamereservationexport.rules.json @@ -0,0 +1,14 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-gamereservationexport-0000001111685212#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + } +] diff --git a/pkg/domain/reference/reports/iapexport.json b/pkg/domain/reference/reports/iapexport.json new file mode 100644 index 0000000..d136303 --- /dev/null +++ b/pkg/domain/reference/reports/iapexport.json @@ -0,0 +1,400 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#ZH-CN_TOPIC_0000001158365061__p12954147173", + "title": "应用内付费的报表数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addadkpexport-0000001111845102", + "title": "获取新增和留存的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214", + "title": "获取付费下载的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section28304321", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section14423508", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section28304321", + "text": "获取应用内付费的报表的CSV或者EXCEL文件地址。接口调用者的角色:账号持有者、管理员、App管理员、运营、财务。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section14423508", + "text": "应用内付费的报表数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/report/distribution-operation-quality/v1/IAPExport/{appId}" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "filterCondition", + "O", + "List", + "过滤器,取值范围: countryId:按国家过滤。 businessType:按业务类型过滤。 如果不传,默认无过滤器。 支持countryId和businessType同时使用,URL示例:&filterCondition=countryId&filterCondition=businessType" + ], + [ + "filterConditionValue", + "O", + "List", + "过滤器对应的值。 如果过滤器为countryId,此参数的取值为国家码的字符串数组,例如“CN, AL, AD, AT”。具体国家码列表参考国家码。传入“all”表示查询全球。传入“others”表示仅查询“US,CU,IR,SD,SY”(美国,古巴,伊朗,苏丹,叙利亚),获取的数据作为一个整体展示,例如“CN,AL,others”。“all”和“others”不区分大小写。 如果过滤器为businessType,此参数的取值为业务类型,取值范围为: ALL:所有业务 AppGallery:华为应用市场 AppTouch:AppTouch业务 取值区分大小写。 如果传入多个过滤器,使用多个filterConditionValue表示,顺序必须与filterCondition中过滤器的顺序一致。URL示例:&filterConditionValue=CN&filterConditionValue=AppGallery。" + ], + [ + "groupBy", + "O", + "String", + "数据统计的分组信息,支持按如下依据分组。 date:按日期分组。 countryId:按国家分组 businessType:按业务类型分组 默认值:date。" + ], + [ + "currency", + "M", + "String", + "货币单位编码,只支持3种货币单位,分别为:CNY(元)、EUR(欧元)、USD(美金)。 设置后,报表中非指定货币单位的货币值将按汇率转换为指定的货币值。例如:设置为USD,那么报表中以CNY、EUR等为单位的数据将按汇率转换为以USD为单位的数据呈现。" + ], + [ + "exportType", + "O", + "String", + "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV或者Excel文件的路径。 报表文件中字段语言由language参数指定,首个字段为groupBy参数中指定的数据统计分组类型。以报表字段英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见应用内付费的报表数据说明。" + ], + [ + "packName", + "M", + "String", + "应用包名。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section14423508" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "日期", + "Time", + "Время", + "数据统计按时间进行分组。 注意 只有当请求参数groupBy传入date时才会返回此字段。" + ], + [ + "国家/地区", + "Country/Region", + "Страна/регион", + "数据统计按国家或地区进行分组。 注意 只有当请求参数groupBy传入countryId时才会返回此字段。" + ], + [ + "业务类型", + "Channel", + "Канал", + "数据统计按业务类型进行分组。 注意 只有当请求参数groupBy传入BusinessType时才会返回此字段。" + ], + [ + "付费用户数", + "Paying users", + "Платящие пользователи", + "时间间隔范围内有付费的用户数。" + ], + [ + "付费金额(元)", + "Payment amount(CNY)", + "Сумма оплаты(CNY)", + "时间间隔范围内所有用户付费总额。" + ], + [ + "付费笔数", + "Payment times", + "Кол-во оплат", + "时间间隔范围所有用户付费次数总和。" + ], + [ + "新增付费用户数", + "New paying users", + "Новые платящие пользователи", + "首次付费的用户数。" + ], + [ + "付费渗透率", + "Paying user rate", + "Доля платящих пользователей", + "时间间隔范围内付费用户占活跃用户的比率。" + ], + [ + "ARPPU(元)", + "ARPPU(CNY)", + "ARPPU(CNY)", + "付费金额/付费用户数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section14423508" + } + ], + "title": "获取应用内付费的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:26.548Z", + "family": "reports", + "endpoint": "iapexport" +} diff --git a/pkg/domain/reference/reports/iapexport.parameters.json b/pkg/domain/reference/reports/iapexport.parameters.json new file mode 100644 index 0000000..247c494 --- /dev/null +++ b/pkg/domain/reference/reports/iapexport.parameters.json @@ -0,0 +1,90 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206" + }, + { + "name": "filterCondition", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器,取值范围: countryId:按国家过滤。 businessType:按业务类型过滤。 如果不传,默认无过滤器。 支持countryId和businessType同时使用,URL示例:&filterCondition=countryId&filterCondition=businessType", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "itemsType": "string" + }, + { + "name": "filterConditionValue", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器对应的值。 如果过滤器为countryId,此参数的取值为国家码的字符串数组,例如“CN, AL, AD, AT”。具体国家码列表参考国家码。传入“all”表示查询全球。传入“others”表示仅查询“US,CU,IR,SD,SY”(美国,古巴,伊朗,苏丹,叙利亚),获取的数据作为一个整体展示,例如“CN,AL,others”。“all”和“others”不区分大小写。 如果过滤器为businessType,此参数的取值为业务类型,取值范围为: ALL:所有业务 AppGallery:华为应用市场 AppTouch:AppTouch业务 取值区分大小写。 如果传入多个过滤器,使用多个filterConditionValue表示,顺序必须与filterCondition中过滤器的顺序一致。URL示例:&filterConditionValue=CN&filterConditionValue=AppGallery。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "itemsType": "string" + }, + { + "name": "groupBy", + "in": "query", + "type": "string", + "required": false, + "description": "数据统计的分组信息,支持按如下依据分组。 date:按日期分组。 countryId:按国家分组 businessType:按业务类型分组 默认值:date。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206" + }, + { + "name": "currency", + "in": "query", + "type": "string", + "required": true, + "description": "货币单位编码,只支持3种货币单位,分别为:CNY(元)、EUR(欧元)、USD(美金)。 设置后,报表中非指定货币单位的货币值将按汇率转换为指定的货币值。例如:设置为USD,那么报表中以CNY、EUR等为单位的数据将按汇率转换为以USD为单位的数据呈现。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "enum": [ + "CNY", + "EUR", + "USD" + ] + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/iapexport.rules.json b/pkg/domain/reference/reports/iapexport.rules.json new file mode 100644 index 0000000..246b3d0 --- /dev/null +++ b/pkg/domain/reference/reports/iapexport.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } +] diff --git a/pkg/domain/reference/reports/orderanalysisexport.json b/pkg/domain/reference/reports/orderanalysisexport.json new file mode 100644 index 0000000..47606df --- /dev/null +++ b/pkg/domain/reference/reports/orderanalysisexport.json @@ -0,0 +1,366 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#ZH-CN_TOPIC_0000001111685214__p0938153012910", + "title": "付费下载的报表数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-iapexport-0000001158365061", + "title": "获取应用内付费的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073", + "title": "获取付费下载明细的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section1573613131517", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section763145162414", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section1573613131517", + "text": "获取付费下载报表的CSV或者EXCEL文件。接口调用者的角色:账号持有者、管理员、App管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section763145162414", + "text": "付费下载的报表数据" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/report/distribution-operation-quality/v1/orderAnalysisExport/{appId} 中国站点的domain:connect-api.cloud.huawei.com 欧洲站点的domain:connect-api-dre.cloud.huawei.com 亚太站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "startTime", + "M", + "String", + "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过365天。" + ], + [ + "endTime", + "M", + "String", + "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过365天。" + ], + [ + "filterCondition", + "O", + "List", + "过滤器,目前只支持“countryId”,表示基于国家过滤,支持多国家查询。如果不传此参数默认查询所有国家。 URL示例:&filterCondition=countryId" + ], + [ + "filterConditionValue", + "O", + "List", + "过滤器对应的值,例如过滤器是“countryId”,此参数的取值为国家码的字符串数组,例如CN。具体国家码列表请参见国家码。 URL示例:&filterConditionValue=CN" + ], + [ + "exportType", + "O", + "String", + "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV文件的路径。 报表文件中字段语言由language参数指定。以报表字段英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见付费下载的报表数据。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section763145162414" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "购买时间", + "Purchased(UTC)", + "Куплено(UTC)", + "按当前电脑系统时区时间展示的付费应用购买时间。" + ], + [ + "应用名", + "App name", + "Имя приложения", + "用户购买付费应用的应用名称。" + ], + [ + "金额", + "Purchase price", + "Цена покупки", + "用户购买付费应用的金额。" + ], + [ + "币种", + "Currency", + "Валюта", + "用户购买付费应用的币种。" + ], + [ + "国家/地区", + "Country/Region", + "Страна/регион", + "用户购买付费应用的国家/地区。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section763145162414" + } + ], + "title": "获取付费下载的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:27.783Z", + "family": "reports", + "endpoint": "orderanalysisexport" +} diff --git a/pkg/domain/reference/reports/orderanalysisexport.parameters.json b/pkg/domain/reference/reports/orderanalysisexport.parameters.json new file mode 100644 index 0000000..d09a7f0 --- /dev/null +++ b/pkg/domain/reference/reports/orderanalysisexport.parameters.json @@ -0,0 +1,69 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过365天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。 startTime和endTime之间不超过365天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206" + }, + { + "name": "filterCondition", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器,目前只支持“countryId”,表示基于国家过滤,支持多国家查询。如果不传此参数默认查询所有国家。 URL示例:&filterCondition=countryId", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "itemsType": "string" + }, + { + "name": "filterConditionValue", + "in": "query", + "type": "array", + "required": false, + "description": "过滤器对应的值,例如过滤器是“countryId”,此参数的取值为国家码的字符串数组,例如CN。具体国家码列表请参见国家码。 URL示例:&filterConditionValue=CN", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "itemsType": "string" + }, + { + "name": "exportType", + "in": "query", + "type": "string", + "required": false, + "description": "导出文件类型,取值范围: CSV:导出CSV文件格式 EXCEL:导出Excel文件格式 默认值:CSV。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "enum": [ + "CSV", + "EXCEL" + ] + } +] diff --git a/pkg/domain/reference/reports/orderanalysisexport.rules.json b/pkg/domain/reference/reports/orderanalysisexport.rules.json new file mode 100644 index 0000000..086140f --- /dev/null +++ b/pkg/domain/reference/reports/orderanalysisexport.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 365, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 365 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } +] diff --git a/pkg/domain/reference/reports/orderdetailexport.json b/pkg/domain/reference/reports/orderdetailexport.json new file mode 100644 index 0000000..66e2ea3 --- /dev/null +++ b/pkg/domain/reference/reports/orderdetailexport.json @@ -0,0 +1,405 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-0000001111685194", + "title": "Reports API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reportsapi-android-0000002356786268", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-reference-countrycode-0000001111845110", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#ZH-CN_TOPIC_0000001158245073__p15836185319134", + "title": "付费下载的报表明细数据说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderanalysisexport-0000001111685214", + "title": "获取付费下载的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-couponexport-0000001111845104", + "title": "获取优惠券活动的报表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section57464533", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section14101103116458", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section62398251", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section1250171775311", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section7205124", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section57464533", + "text": "获取付费下载明细的报表CSV文件。接口调用者的角色:账号持有者、管理员、App管理员、运营。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section14101103116458", + "text": "为了防止注入风险,付费下载的报表内容中的“应用名”如果存在特殊字符(“+”或“-”或“@”或“=”),则会对该“应用名”做转义处理。转义处理的规则是在待转义字符串前加tab键,然后将整个字符串用双引号括起来。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section7205124", + "text": "付费下载的报表明细数据说明" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://{domain}/api/report/distribution-operation-quality/v1/orderDetailExport/{appId} 中国站点的domain:connect-api.cloud.huawei.com 欧洲站点的domain:connect-api-dre.cloud.huawei.com 亚太站点的domain:connect-api-dra.cloud.huawei.com 俄罗斯站点的domain:connect-api-drru.cloud.huawei.com 注意 调用获取Token接口时使用的域名必须与本接口域名保持一致,例如本接口使用“connect-api-dre.cloud.huawei.com”,则调用获取Token接口必须使用“https://connect-api-dre.cloud.huawei.com/api/oauth2/v1/token”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section236517415165" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID,获取方法参考查询应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section1250171775311" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String(query)", + "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。" + ], + [ + "queryType", + "M", + "Integer(query)", + "查询日期类型。 0:按照购买时间查询 1:按照退款时间查询" + ], + [ + "startTime", + "M", + "String(query)", + "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "endTime", + "M", + "String(query)", + "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。" + ], + [ + "filterCondition", + "M", + "List(query)", + "过滤器,目前支持countryId、orderID、orderStatus三种,可以进行组合,其中countryId必须包含。过滤器为countryId时,不支持多个国家,每次查询只支持一个国家。 URL示例:&filterCondition=countryId&filterCondition=orderID" + ], + [ + "filterConditionValue", + "M", + "List(query)", + "过滤器对应的值。 过滤器是“countryId”,此参数的取值为国家码的字符串数组,数组中每次只支持查询一个值,例如CN。具体国家码列表参考国家码。 过滤器是“orderID”,此参数的取值为订单ID,例如44rRFFrereere3343。 过滤器是“orderStatus”,此参数的取值可以为:0(已付)、 1(已退)、2(付款失败)、3(退款失败)、5(退款中)。 如果filterCondition传入多个过滤器,filterConditionValue的顺序必须对应。URL示例:filterConditionValue=CN&filterConditionValue=44rRFFrereere3343" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileURL", + "M", + "String", + "导出CSV文件的路径。 报表文件中字段语言由language参数指定。以报表字段英文为例,您可以点击文件样例.zip下载样例文件。 文件中包含的字段说明请参见付费下载的报表明细数据说明。" + ], + [ + "ret", + "M", + "String", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section7205124" + }, + { + "location": "", + "rows": [ + [ + "字段名(中文)", + "字段名(英文)", + "字段名(俄语)", + "字段含义" + ], + [ + "序号", + "No.", + "№", + "用户购买付费应用的购买序号。" + ], + [ + "购买时间", + "Purchased(UTC)", + "Куплено(UTC)", + "按当前电脑系统时区时间展示的付费应用购买时间。" + ], + [ + "应用名", + "App name", + "Имя приложения", + "用户购买付费应用的应用名称。" + ], + [ + "订单ID", + "Order ID", + "ID заказа", + "用户购买付费应用的订单ID。" + ], + [ + "订单状态", + "Order status", + "Статус заказа", + "包含已付、已退、付款失败、退款失败、未支付、退款中。" + ], + [ + "退款时间", + "Refunded", + "Возврат средств", + "按当前系统时区时间展示的付费应用退款时间。" + ], + [ + "支付方式", + "Payment method", + "Способ оплаты", + "用户购买付费应用的方式。" + ], + [ + "购买价格", + "Purchase price", + "Цена покупки", + "用户购买付费应用的价格。" + ], + [ + "币种", + "Currency", + "Валюта", + "用户购买付费应用的币种。" + ], + [ + "国家/地区", + "Country/Region", + "Страна/регион", + "用户购买付费应用的国家/地区。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section7205124" + } + ], + "title": "获取付费下载明细的报表", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:56:29.001Z", + "family": "reports", + "endpoint": "orderdetailexport" +} diff --git a/pkg/domain/reference/reports/orderdetailexport.parameters.json b/pkg/domain/reference/reports/orderdetailexport.parameters.json new file mode 100644 index 0000000..8cf17e2 --- /dev/null +++ b/pkg/domain/reference/reports/orderdetailexport.parameters.json @@ -0,0 +1,69 @@ +[ + { + "name": "appId", + "in": "path", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section1250171775311" + }, + { + "name": "language", + "in": "query", + "type": "string", + "required": true, + "description": "查询语言,报表title会根据不同语言来展现,只支持简体中文(zh-CN),美式英文(en-US),俄文(ru-RU)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "enum": [ + "zh-CN", + "en-US", + "ru-RU" + ] + }, + { + "name": "queryType", + "in": "query", + "type": "integer", + "required": true, + "description": "查询日期类型。 0:按照购买时间查询 1:按照退款时间查询", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "enum": [ + "0", + "1" + ] + }, + { + "name": "startTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询开始时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206" + }, + { + "name": "endTime", + "in": "query", + "type": "string", + "required": true, + "description": "查询结束时间,UTC时间,格式为YYYYMMDD。startTime和endTime之间不超过180天。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206" + }, + { + "name": "filterCondition", + "in": "query", + "type": "array", + "required": true, + "description": "过滤器,目前支持countryId、orderID、orderStatus三种,可以进行组合,其中countryId必须包含。过滤器为countryId时,不支持多个国家,每次查询只支持一个国家。 URL示例:&filterCondition=countryId&filterCondition=orderID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "itemsType": "string" + }, + { + "name": "filterConditionValue", + "in": "query", + "type": "array", + "required": true, + "description": "过滤器对应的值。 过滤器是“countryId”,此参数的取值为国家码的字符串数组,数组中每次只支持查询一个值,例如CN。具体国家码列表参考国家码。 过滤器是“orderID”,此参数的取值为订单ID,例如44rRFFrereere3343。 过滤器是“orderStatus”,此参数的取值可以为:0(已付)、 1(已退)、2(付款失败)、3(退款失败)、5(退款中)。 如果filterCondition传入多个过滤器,filterConditionValue的顺序必须对应。URL示例:filterConditionValue=CN&filterConditionValue=44rRFFrereere3343", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "itemsType": "string" + } +] diff --git a/pkg/domain/reference/reports/orderdetailexport.rules.json b/pkg/domain/reference/reports/orderdetailexport.rules.json new file mode 100644 index 0000000..29998a0 --- /dev/null +++ b/pkg/domain/reference/reports/orderdetailexport.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "report-date-window", + "kind": "date_window", + "fields": [ + "query.startTime", + "query.endTime" + ], + "maxDays": 180, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "message": "Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.", + "suggestion": "Use YYYYMMDD dates with endTime at or after startTime and no more than 180 days apart." + }, + { + "id": "ordered-filter-pairs", + "kind": "equal_length", + "fields": [ + "query.filterCondition", + "query.filterConditionValue" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-orderdetailexport-0000001158245073#section886219295206", + "message": "Each filterCondition must have a filterConditionValue at the same position.", + "suggestion": "Repeat both query keys once per filter, preserving matching order." + } +] diff --git a/pkg/domain/reference/resources/respackapi-addversion.json b/pkg/domain/reference/resources/respackapi-addversion.json new file mode 100644 index 0000000..a15fd64 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-addversion.json @@ -0,0 +1,363 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section175272026758", + "text": "请求示例\nPOST games-background-assets-service/v1/open/dev/1******7/package-versions HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"resourceVersion\": {\n \"packageName\": \"com.abc.test\",\n \"appId\": \"12345678\",\n \"version\": 99, \n \"startTime\": 1752595200000,\n \"endTime\": 1752699999999, \n }\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"data\": {\n \"versionId\": 0\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#ZH-CN_TOPIC_0000002328396224__li44600132913", + "title": "GWOpAddPackageVersionReq" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#ZH-CN_TOPIC_0000002328396224__li473116351793", + "title": "GWOpPackageVersion" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#ZH-CN_TOPIC_0000002328396224__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#ZH-CN_TOPIC_0000002328396224__li136119818127", + "title": "GWOpPackageVersionRspData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376", + "title": "资源包文件上传申请" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section6704618182019", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section8711909", + "text": "创建“使用华为CDN”方式的资源包预下载任务。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "text": "GWOpAddPackageVersionReq 参数名称 必选(M)/可选(O) 类型 参数说明 resourceVersion O GWOpPackageVersion 资源包版本信息。 GWOpPackageVersion 参数名称 必选(M)/可选(O) 类型 参数说明 packageName O String 游戏包名。最大长度255个字符。 appId M String 游戏APP ID,获取方法参考查询应用信息。 version M Int 资源包版本号。要求是不超过9位的整数,且必须大于已创建任务的版本号。 startTime M Long 资源包预下载日期的开始时间。 endTime M Long 资源包预下载日期的结束时间。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "text": "GWOpPackageVersion 参数名称 必选(M)/可选(O) 类型 参数说明 packageName O String 游戏包名。最大长度255个字符。 appId M String 游戏APP ID,获取方法参考查询应用信息。 version M Int 资源包版本号。要求是不超过9位的整数,且必须大于已创建任务的版本号。 startTime M Long 资源包预下载日期的开始时间。 endTime M Long 资源包预下载日期的结束时间。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section49198053", + "text": "GWOpPackageVersionRspData 参数名称 必选(M)/可选(O) 类型 参数说明 versionId O Long 资源包版本ID。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "requestId", + "M", + "String", + "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section119494174419" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section6704618182019" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "addPackageVersionReq", + "M", + "GWOpAddPackageVersionReq", + "新增资源包版本请求体。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "resourceVersion", + "O", + "GWOpPackageVersion", + "资源包版本信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "packageName", + "O", + "String", + "游戏包名。最大长度255个字符。" + ], + [ + "appId", + "M", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "version", + "M", + "Int", + "资源包版本号。要求是不超过9位的整数,且必须大于已创建任务的版本号。" + ], + [ + "startTime", + "M", + "Long", + "资源包预下载日期的开始时间。" + ], + [ + "endTime", + "M", + "Long", + "资源包预下载日期的结束时间。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "data", + "O", + "GWOpPackageVersionRspData", + "响应数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "O", + "Long", + "资源包版本ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section49198053" + } + ], + "title": "新增资源包版本", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:04.166Z", + "family": "resources", + "endpoint": "respackapi-addversion" +} diff --git a/pkg/domain/reference/resources/respackapi-addversion.parameters.json b/pkg/domain/reference/resources/respackapi-addversion.parameters.json new file mode 100644 index 0000000..2104e1a --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-addversion.parameters.json @@ -0,0 +1,71 @@ +[ + { + "name": "requestId", + "in": "header", + "type": "string", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section119494174419", + "maxLength": 128 + }, + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section6704618182019" + }, + { + "name": "resourceVersion", + "in": "body", + "type": "object", + "required": false, + "description": "资源包版本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "properties": [ + { + "name": "packageName", + "in": "body", + "type": "string", + "required": false, + "description": "游戏包名。最大长度255个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "maxLength": 255 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234" + }, + { + "name": "version", + "in": "body", + "type": "integer", + "required": true, + "description": "资源包版本号。要求是不超过9位的整数,且必须大于已创建任务的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234", + "maximum": 999999999 + }, + { + "name": "startTime", + "in": "body", + "type": "integer", + "required": true, + "description": "资源包预下载日期的开始时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234" + }, + { + "name": "endTime", + "in": "body", + "type": "integer", + "required": true, + "description": "资源包预下载日期的结束时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224#section985411610234" + } + ] + } +] diff --git a/pkg/domain/reference/resources/respackapi-deletefile.json b/pkg/domain/reference/resources/respackapi-deletefile.json new file mode 100644 index 0000000..5eb9445 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-deletefile.json @@ -0,0 +1,264 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section175272026758", + "text": "请求示例\nDELETE /api/games-background-assets-service/v1/open-gw/dev/12***3344/package-files/?appId=69***47 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******\nrequestId: *****" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372", + "title": "修改资源包版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#ZH-CN_TOPIC_0000002328396228__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637", + "title": "发布资源包版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745", + "title": "查询资源包版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section6704618182019", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section985411610234", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section8711909", + "text": "删除资源包任务文件,要求该资源包任务为下线状态。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section8711909", + "text": "若资源包任务为“预上线”或“已发布”状态,开发者可以调用修改资源包版本接口(isDraft传为1),将任务状态变更为“草稿”态。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-files" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "requestId", + "M", + "String", + "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section119494174419" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section6704618182019" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "fileIds", + "O", + "String", + "资源包文件ID列表,使用英文逗号分隔。取值范围:[1,500]。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section985411610234" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section49198053" + } + ], + "title": "删除资源包文件", + "updatedAt": "2025-11-20 11:58", + "checkedAt": "2026-10-07T03:00:05.599Z", + "family": "resources", + "endpoint": "respackapi-deletefile" +} diff --git a/pkg/domain/reference/resources/respackapi-deletefile.parameters.json b/pkg/domain/reference/resources/respackapi-deletefile.parameters.json new file mode 100644 index 0000000..16a036a --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-deletefile.parameters.json @@ -0,0 +1,35 @@ +[ + { + "name": "requestId", + "in": "header", + "type": "string", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section119494174419", + "maxLength": 128 + }, + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section6704618182019" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section985411610234" + }, + { + "name": "fileIds", + "in": "query", + "type": "string", + "required": false, + "description": "资源包文件ID列表,使用英文逗号分隔。取值范围:[1,500]。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228#section985411610234" + } +] diff --git a/pkg/domain/reference/resources/respackapi-getversion.json b/pkg/domain/reference/resources/respackapi-getversion.json new file mode 100644 index 0000000..c07b795 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-getversion.json @@ -0,0 +1,449 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section175272026758", + "text": "请求示例\nGET games-background-assets-service/v1/open/dev/1******7/package-versions?appId=6******67&page=1&limit=10 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"data\": {\n \"appId\": \"12345678\",\n \"maxVersion\": 4,\n \"latestVersion\": 2,\n \"latestBetaVersion\": 0,\n \"latestManifestFileDownLoadUrl\": \"https://jospkg-drcn.dbankcdn.cn/pub_1/GameCenter_resourcePackage_900_9/ba/v3/fLhoDjbqhnmoA2HWCvmJcw/41995a97d25b412346a55af5f4eb784b.xml#signature=01d0efcff921234f18567134ecc9d0796b4ad698be1234a0e88d05e19133b383\",\n \"latestBetaManifestFileDownLoadUrl\": \"https://jospkg-drcn.dbankcdn.cn/pub_1/GameCenter_resourcePackage_900_9/ba/v3/fLhoDjbqhnmoA2HWCvmJcw/41995a97d25b412346a55af5f4eb784b.xml#signature=01d0efcff921234f18567134ecc9d0796b4ad698be1234a0e88d05e19133b383\",\n \"resourceVersions\": [\n {\n \"versionId\": \"122\",\n \"packageName\": \"com.abc.test\",\n \"appId\": \"12345678\",\n \"appName\": \"资源包\",\n \"devId\": \"10086000036108307\",\n \"version\": 1,\n \"vStatus\": 0,\n \"fStatus\": 3,\n \"fileTotalCount\": 1,\n \"fileTotalSize\": 300,\n \"downloadType\": 2,\n \"startTime\": 1752595200000,\n \"endTime\": 1752699999999,\n \"createTime\": 1748239592000,\n \"updateTime\": 1748243842000,\n \"source\": 2 \n }\n ],\n \"totalCount\": 0\n }\n }" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#ZH-CN_TOPIC_0000002362274745__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#ZH-CN_TOPIC_0000002362274745__li44142206420", + "title": "GWOpGetPackageVersionsRspData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#ZH-CN_TOPIC_0000002362274745__li8861101113818", + "title": "GWOpPackageVersionBrief" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228", + "title": "删除资源包文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749", + "title": "查询资源包文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section31071327141517", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section119494174419", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section8711909", + "text": "查询指定游戏下所有资源包版本的详细信息。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053", + "text": "GWOpGetPackageVersionsRspData 参数名称 必选(M)/可选(O) 类型 参数说明 appId O String 游戏APP ID。 maxVersion O Int 当前已经存在的最大版本号。 latestVersion O Int 最新已发布的资源包版本号。 latestBetaVersion O Int 预上线(灰度测试)的资源包版本号。 latestManifestFileDownLoadUrl O String manifest文件的下载链接。 该manifest文件包含资源文件下载列表,且符合如下条件: 资源包下载任务的创建方式:API接口创建、AppGallery Connect页面创建。 下载类型:extension系统托管下载、extension协同下载。 CDN:使用华为CDN。 资源包下载任务状态:已发布。 latestBetaManifestFileDownLoadUrl O String manifest文件的下载链接。 该manifest文件包含资源文件下载列表,且符合如下条件: 资源包下载任务的创建方式:API接口创建、AppGallery Connect页面创建。 下载类型:extension系统托管下载、extension协同下载。 CDN:使用华为CDN。 资源包下载任务状态:预上线(灰度测试)。 resourceVersions O List 资源包版本信息。 totalCount O Int 总数。 GWOpPackageVersionBrief 参数名称 必选(M)/可选(O) 类型 参数说明 versionId O String 资源包版本ID。 packageName O String 资源包文件包名。 appId O String 游戏APP ID。 appName O String 游戏名称。 devId O String 开发者ID。 version O Int 版本号。 vStatus O Int 版本状态: 0:未上线 1:预上线(灰度测试) 2:已发布 3:已暂停 4:已终止 fStatus O Int 流程状态: 0:草稿 1:审核中 2:审核通过 3:审核驳回 4:已撤销 fileTotalCount O Int 文件总数量。 fileTotalSize O Int 文件总大小(MB)。 downloadType O Int 下载类型: 1:system 2:extension系统托管下载 3:extension协同下载 startTime O Long 开始下载时间。 endTime O Long 结束下载时间。 createTime O Long 创建时间。 updateTime O Long 修改时间。 source O String 创建来源: 1:在AGC控制台创建。 2:使用接口方式创建。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053", + "text": "GWOpPackageVersionBrief 参数名称 必选(M)/可选(O) 类型 参数说明 versionId O String 资源包版本ID。 packageName O String 资源包文件包名。 appId O String 游戏APP ID。 appName O String 游戏名称。 devId O String 开发者ID。 version O Int 版本号。 vStatus O Int 版本状态: 0:未上线 1:预上线(灰度测试) 2:已发布 3:已暂停 4:已终止 fStatus O Int 流程状态: 0:草稿 1:审核中 2:审核通过 3:审核驳回 4:已撤销 fileTotalCount O Int 文件总数量。 fileTotalSize O Int 文件总大小(MB)。 downloadType O Int 下载类型: 1:system 2:extension系统托管下载 3:extension协同下载 startTime O Long 开始下载时间。 endTime O Long 结束下载时间。 createTime O Long 创建时间。 updateTime O Long 修改时间。 source O String 创建来源: 1:在AGC控制台创建。 2:使用接口方式创建。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section31071327141517" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "page", + "O", + "Int", + "请求页码,默认值:1。" + ], + [ + "limit", + "O", + "Int", + "列表查询单页数量。取值范围[1,100]。 默认值:20。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "data", + "M", + "GWOpGetPackageVersionsRspData", + "资源包版本数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "O", + "String", + "游戏APP ID。" + ], + [ + "maxVersion", + "O", + "Int", + "当前已经存在的最大版本号。" + ], + [ + "latestVersion", + "O", + "Int", + "最新已发布的资源包版本号。" + ], + [ + "latestBetaVersion", + "O", + "Int", + "预上线(灰度测试)的资源包版本号。" + ], + [ + "latestManifestFileDownLoadUrl", + "O", + "String", + "manifest文件的下载链接。 该manifest文件包含资源文件下载列表,且符合如下条件: 资源包下载任务的创建方式:API接口创建、AppGallery Connect页面创建。 下载类型:extension系统托管下载、extension协同下载。 CDN:使用华为CDN。 资源包下载任务状态:已发布。" + ], + [ + "latestBetaManifestFileDownLoadUrl", + "O", + "String", + "manifest文件的下载链接。 该manifest文件包含资源文件下载列表,且符合如下条件: 资源包下载任务的创建方式:API接口创建、AppGallery Connect页面创建。 下载类型:extension系统托管下载、extension协同下载。 CDN:使用华为CDN。 资源包下载任务状态:预上线(灰度测试)。" + ], + [ + "resourceVersions", + "O", + "List", + "资源包版本信息。" + ], + [ + "totalCount", + "O", + "Int", + "总数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "O", + "String", + "资源包版本ID。" + ], + [ + "packageName", + "O", + "String", + "资源包文件包名。" + ], + [ + "appId", + "O", + "String", + "游戏APP ID。" + ], + [ + "appName", + "O", + "String", + "游戏名称。" + ], + [ + "devId", + "O", + "String", + "开发者ID。" + ], + [ + "version", + "O", + "Int", + "版本号。" + ], + [ + "vStatus", + "O", + "Int", + "版本状态: 0:未上线 1:预上线(灰度测试) 2:已发布 3:已暂停 4:已终止" + ], + [ + "fStatus", + "O", + "Int", + "流程状态: 0:草稿 1:审核中 2:审核通过 3:审核驳回 4:已撤销" + ], + [ + "fileTotalCount", + "O", + "Int", + "文件总数量。" + ], + [ + "fileTotalSize", + "O", + "Int", + "文件总大小(MB)。" + ], + [ + "downloadType", + "O", + "Int", + "下载类型: 1:system 2:extension系统托管下载 3:extension协同下载" + ], + [ + "startTime", + "O", + "Long", + "开始下载时间。" + ], + [ + "endTime", + "O", + "Long", + "结束下载时间。" + ], + [ + "createTime", + "O", + "Long", + "创建时间。" + ], + [ + "updateTime", + "O", + "Long", + "修改时间。" + ], + [ + "source", + "O", + "String", + "创建来源: 1:在AGC控制台创建。 2:使用接口方式创建。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section49198053" + } + ], + "title": "查询资源包版本", + "updatedAt": "2026-04-27 14:44", + "checkedAt": "2026-10-07T03:00:07.010Z", + "family": "resources", + "endpoint": "respackapi-getversion" +} diff --git a/pkg/domain/reference/resources/respackapi-getversion.parameters.json b/pkg/domain/reference/resources/respackapi-getversion.parameters.json new file mode 100644 index 0000000..67f2ee4 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-getversion.parameters.json @@ -0,0 +1,36 @@ +[ + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section119494174419" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234" + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求页码,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "列表查询单页数量。取值范围[1,100]。 默认值:20。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745#section985411610234", + "minimum": 1, + "maximum": 100 + } +] diff --git a/pkg/domain/reference/resources/respackapi-modifyversion.json b/pkg/domain/reference/resources/respackapi-modifyversion.json new file mode 100644 index 0000000..bd16701 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-modifyversion.json @@ -0,0 +1,346 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section175272026758", + "text": "请求示例\nPUT games-background-assets-service/v1/open/dev/1******7/package-versions HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"isDraft\": 0,\n \"resourceVersion\": {\n \"versionId\": 0,\n \"packageName\": \"com.abc.test\",\n \"appId\": \"12345678\",\n \"version\": 999999999,\n \"startTime\": 1752595200000,\n \"endTime\": 1752699999999,\n }\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#ZH-CN_TOPIC_0000002328236372__li167456115133", + "title": "GWOpModifyPackageVersionReq" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#ZH-CN_TOPIC_0000002328236372__li384415309133", + "title": "GWOpPackageVersionEntity" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#ZH-CN_TOPIC_0000002328236372__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641", + "title": "资源包文件上传确认" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637", + "title": "发布资源包版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section16852614454", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section6704618182019", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section8711909", + "text": "若isDraft传参为0,提交资源包预下载任务。提交后,资源包任务为“预下载”状态。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section8711909", + "text": "若isDraft传参为1,修改资源包下载任务信息。修改后,资源包任务为“草稿”状态。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "text": "GWOpModifyPackageVersionReq 参数名称 必选(M)/可选(O) 类型 参数说明 isDraft M Int(32) 是否草稿: 0:提交。提交之后进入预发布状态。 1:草稿。草稿状态支持重新编辑。 resourceVersion O GWOpPackageVersionEntity 修改的资源包版本信息。 GWOpPackageVersionEntity 参数名称 必选(M)/可选(O) 类型 参数说明 versionId M Long 资源包版本ID。 packageName O String 游戏包名。最大长度255个字符。 appId M String 游戏APP ID,获取方法参考查询应用信息。 version O Int 版本号。 startTime O Long 开始下载时间。 endTime O Long 结束下载时间。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "text": "GWOpPackageVersionEntity 参数名称 必选(M)/可选(O) 类型 参数说明 versionId M Long 资源包版本ID。 packageName O String 游戏包名。最大长度255个字符。 appId M String 游戏APP ID,获取方法参考查询应用信息。 version O Int 版本号。 startTime O Long 开始下载时间。 endTime O Long 结束下载时间。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-versions" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "requestId", + "M", + "String", + "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section16852614454" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section6704618182019" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "modifyPackageVersionReq", + "M", + "GWOpModifyPackageVersionReq", + "修改资源包版本请求体。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "isDraft", + "M", + "Int(32)", + "是否草稿: 0:提交。提交之后进入预发布状态。 1:草稿。草稿状态支持重新编辑。" + ], + [ + "resourceVersion", + "O", + "GWOpPackageVersionEntity", + "修改的资源包版本信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "Long", + "资源包版本ID。" + ], + [ + "packageName", + "O", + "String", + "游戏包名。最大长度255个字符。" + ], + [ + "appId", + "M", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "version", + "O", + "Int", + "版本号。" + ], + [ + "startTime", + "O", + "Long", + "开始下载时间。" + ], + [ + "endTime", + "O", + "Long", + "结束下载时间。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section49198053" + } + ], + "title": "修改资源包版本", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:24.360Z", + "family": "resources", + "endpoint": "respackapi-modifyversion" +} diff --git a/pkg/domain/reference/resources/respackapi-modifyversion.parameters.json b/pkg/domain/reference/resources/respackapi-modifyversion.parameters.json new file mode 100644 index 0000000..421ca0d --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-modifyversion.parameters.json @@ -0,0 +1,90 @@ +[ + { + "name": "requestId", + "in": "header", + "type": "string", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section16852614454", + "maxLength": 128 + }, + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section6704618182019" + }, + { + "name": "isDraft", + "in": "body", + "type": "integer", + "required": true, + "description": "是否草稿: 0:提交。提交之后进入预发布状态。 1:草稿。草稿状态支持重新编辑。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "enum": [ + "0", + "1" + ] + }, + { + "name": "resourceVersion", + "in": "body", + "type": "object", + "required": false, + "description": "修改的资源包版本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "properties": [ + { + "name": "versionId", + "in": "body", + "type": "integer", + "required": true, + "description": "资源包版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + }, + { + "name": "packageName", + "in": "body", + "type": "string", + "required": false, + "description": "游戏包名。最大长度255个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234", + "maxLength": 255 + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + }, + { + "name": "version", + "in": "body", + "type": "integer", + "required": false, + "description": "版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + }, + { + "name": "startTime", + "in": "body", + "type": "integer", + "required": false, + "description": "开始下载时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + }, + { + "name": "endTime", + "in": "body", + "type": "integer", + "required": false, + "description": "结束下载时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372#section985411610234" + } + ] + } +] diff --git a/pkg/domain/reference/resources/respackapi-queryfile.json b/pkg/domain/reference/resources/respackapi-queryfile.json new file mode 100644 index 0000000..337a21f --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-queryfile.json @@ -0,0 +1,375 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section175272026758", + "text": "请求示例\nGET /api/games-background-assets-service/v1/open-gw/dev/12***3344/package-files/?appId=69***47 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"data\": {\n \"resourceFiles\": [\n {\n \"fileId\": \"17***736\",\n \"fileName\": \"Demo\",\n \"versionId\": \"string\",\n \"fileLength\": 0,\n \"status\": 0,\n \"downLoadUrl\": \"string\",\n \"createTime\": 1752841870000,\n \"updateTime\": 1752912491000\n }\n ],\n \"totalCount\": 1\n }\n }" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#ZH-CN_TOPIC_0000002362274749__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#ZH-CN_TOPIC_0000002362274749__li4691840161518", + "title": "GWOpGetPackageFilesRspData" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#ZH-CN_TOPIC_0000002362274749__li1491672513168", + "title": "GWOpPackageFile" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-getversion-0000002362274745", + "title": "查询资源包版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section6704618182019", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section8711909", + "text": "查询资源包文件。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053", + "text": "GWOpGetPackageFilesRspData 参数名称 必选(M)/可选(O) 类型 参数说明 resourceFiles O List< GWOpPackageFile> 文件列表。 totalCount O Int 文件总数。 GWOpPackageFile 参数名称 必选(M)/可选(O) 类型 参数说明 fileId O String 文件ID。 fileName O String 文件名称。 versionId O String 资源包版本ID。 fileLength O Long 升级包文件大小(字节数)。 status O Int 文件状态: 0:上传中(已申请) 1:已生效(已发布) 2:上传失败 3:扫描中 4:扫描失败 downLoadUrl O String 文件下载地址。 createTime O Long 创建时间。 updateTime O Long 修改时间。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053", + "text": "GWOpPackageFile 参数名称 必选(M)/可选(O) 类型 参数说明 fileId O String 文件ID。 fileName O String 文件名称。 versionId O String 资源包版本ID。 fileLength O Long 升级包文件大小(字节数)。 status O Int 文件状态: 0:上传中(已申请) 1:已生效(已发布) 2:上传失败 3:扫描中 4:扫描失败 downLoadUrl O String 文件下载地址。 createTime O Long 创建时间。 updateTime O Long 修改时间。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTP GET" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-files" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section119494174419" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section6704618182019" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "versionId", + "O", + "Long", + "资源包版本ID。 说明 versionId参数和fileIds参数,选择一个传入。" + ], + [ + "fileIds", + "O", + "String", + "资源包文件ID列表,使用英文逗号分隔。取值范围:[1,500]。 说明 versionId参数和fileIds参数,选择一个传入。" + ], + [ + "page", + "O", + "Int", + "请求页码,默认值:1。" + ], + [ + "limit", + "O", + "Int", + "列表查询单页数量。取值范围:[1,100]。 默认值:20" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "data", + "M", + "GWOpGetPackageFilesRspData", + "查询资源包文件返回体。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "resourceFiles", + "O", + "List< GWOpPackageFile>", + "文件列表。" + ], + [ + "totalCount", + "O", + "Int", + "文件总数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileId", + "O", + "String", + "文件ID。" + ], + [ + "fileName", + "O", + "String", + "文件名称。" + ], + [ + "versionId", + "O", + "String", + "资源包版本ID。" + ], + [ + "fileLength", + "O", + "Long", + "升级包文件大小(字节数)。" + ], + [ + "status", + "O", + "Int", + "文件状态: 0:上传中(已申请) 1:已生效(已发布) 2:上传失败 3:扫描中 4:扫描失败" + ], + [ + "downLoadUrl", + "O", + "String", + "文件下载地址。" + ], + [ + "createTime", + "O", + "Long", + "创建时间。" + ], + [ + "updateTime", + "O", + "Long", + "修改时间。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section49198053" + } + ], + "title": "查询资源包文件", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T05:20:04.356Z" +} diff --git a/pkg/domain/reference/resources/respackapi-queryfile.parameters.json b/pkg/domain/reference/resources/respackapi-queryfile.parameters.json new file mode 100644 index 0000000..ec87247 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-queryfile.parameters.json @@ -0,0 +1,52 @@ +[ + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section6704618182019" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234" + }, + { + "name": "versionId", + "in": "query", + "type": "integer", + "required": false, + "description": "资源包版本ID。 说明 versionId参数和fileIds参数,选择一个传入。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234" + }, + { + "name": "fileIds", + "in": "query", + "type": "string", + "required": false, + "description": "资源包文件ID列表,使用英文逗号分隔。取值范围:[1,500]。 说明 versionId参数和fileIds参数,选择一个传入。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234" + }, + { + "name": "page", + "in": "query", + "type": "integer", + "required": false, + "description": "请求页码,默认值:1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234" + }, + { + "name": "limit", + "in": "query", + "type": "integer", + "required": false, + "description": "列表查询单页数量。取值范围:[1,100]。 默认值:20", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "minimum": 1, + "maximum": 100 + } +] diff --git a/pkg/domain/reference/resources/respackapi-queryfile.rules.json b/pkg/domain/reference/resources/respackapi-queryfile.rules.json new file mode 100644 index 0000000..daee960 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-queryfile.rules.json @@ -0,0 +1,34 @@ +[ + { + "id": "resource-file-id-count", + "kind": "csv_count", + "field": "query.fileIds", + "minItems": 1, + "maxItems": 500, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "message": "fileIds requires 1 to 500 nonempty comma-separated file IDs.", + "suggestion": "Supply at most 500 file IDs separated by commas without empty entries, or select a versionId." + }, + { + "id": "resource-file-identity", + "kind": "at_least_one", + "fields": [ + "query.versionId", + "query.fileIds" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "message": "Supply versionId or fileIds to select resource files.", + "suggestion": "Provide the resource version ID or a comma-separated file ID list." + }, + { + "id": "resource-file-identity-exclusive", + "kind": "at_most_one", + "fields": [ + "query.versionId", + "query.fileIds" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-queryfile-0000002362274749#section985411610234", + "message": "Select either versionId or fileIds, as documented.", + "suggestion": "Keep one resource-file selector and remove the other." + } +] diff --git a/pkg/domain/reference/resources/respackapi-releaseversion.json b/pkg/domain/reference/resources/respackapi-releaseversion.json new file mode 100644 index 0000000..d33c99d --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-releaseversion.json @@ -0,0 +1,255 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section175272026758", + "text": "请求示例\nPOST games-background-assets-service/v1/open/dev/1******7/package-versions/publish?appId=6******67&versionId=1 HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#ZH-CN_TOPIC_0000002362394637__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-modifyversion-0000002328236372", + "title": "修改资源包版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-deletefile-0000002328396228", + "title": "删除资源包文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section6704618182019", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section15718114214818", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section8711909", + "text": "发布资源包下载任务。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTP POST" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-version/publish" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "requestId", + "M", + "String", + "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section119494174419" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section6704618182019" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "versionId", + "M", + "Long", + "资源包版本ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section15718114214818" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section49198053" + } + ], + "title": "发布资源包版本", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:00:27.040Z", + "family": "resources", + "endpoint": "respackapi-releaseversion" +} diff --git a/pkg/domain/reference/resources/respackapi-releaseversion.parameters.json b/pkg/domain/reference/resources/respackapi-releaseversion.parameters.json new file mode 100644 index 0000000..c6e283c --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-releaseversion.parameters.json @@ -0,0 +1,35 @@ +[ + { + "name": "requestId", + "in": "header", + "type": "string", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section119494174419", + "maxLength": 128 + }, + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section6704618182019" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section15718114214818" + }, + { + "name": "versionId", + "in": "query", + "type": "integer", + "required": true, + "description": "资源包版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-releaseversion-0000002362394637#section15718114214818" + } +] diff --git a/pkg/domain/reference/resources/respackapi-uploadapplyfor.json b/pkg/domain/reference/resources/respackapi-uploadapplyfor.json new file mode 100644 index 0000000..c6b40fb --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-uploadapplyfor.json @@ -0,0 +1,516 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section175272026758", + "text": "请求示例\nPOST /api/games-background-assets-service/v1/open-gw/dev/12***3344/package-file/apply HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******\nrequestId: *****\n{\n \"appId\": \"12345678\",\n \"versionId\": 99,\n \"fileName\": \"Demo\",\n \"fileSHA256\": \"06***d762\",\n \"fileLength\": 100,\n \"fileType\": 127,\n \"filePartApplyInfo\": [\n {\n \"partNo\": \"23\",\n \"fileSHA256\": \"06***d762\",\n \"fileLength\": 100\n }\n ]\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"data\": {\n \"fileId\": \"1734842730388976000\",\n \"uploadTime\": 0,\n \"filePartUploadInfos\": [\n {\n \"partNo\": \"20\",\n \"partObjectId\": \"string\",\n \"uploadInfo\": {\n \"uploadMethod\": \"POST\",\n \"uploadUrl\": \"https://contentcenter-test-bj4-001.obs.dualstack.cn-north-4.mycloud.cn/GameCenter_resourcePackage_900_9/6f/v3/xxxx.mp4\",\n \"uploadHeaders\": [\n {\n \"key\": \"Content-Type\",\n \"value\": \"video/mp4\"\n }\n ]\n }\n }\n ]\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-res-pkg-preload-0000002362394629", + "title": "资源包预下载" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#ZH-CN_TOPIC_0000002328236376__li19444185912162", + "title": "GWOpUploadFileApplyReq" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#ZH-CN_TOPIC_0000002328236376__li74031824101717", + "title": "GWFilePartApplyInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#ZH-CN_TOPIC_0000002328236376__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#ZH-CN_TOPIC_0000002328236376__li121095061719", + "title": "GWPackageUploadApplyInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#ZH-CN_TOPIC_0000002328236376__li13859181319182", + "title": "GWFilePartUploadInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#ZH-CN_TOPIC_0000002328236376__li10194439181816", + "title": "GWPackageUploadInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#ZH-CN_TOPIC_0000002328236376__li193391676196", + "title": "GWUploadHeader" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-addversion-0000002328396224", + "title": "新增资源包版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641", + "title": "资源包文件上传确认" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section6704618182019", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section8711909", + "text": "获取上传地址和必要参数,根据申请返回的信息完成文件上传。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section8711909", + "text": "若待上传的资源包文件超过5GB,需要分段上传文件。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "text": "GWOpUploadFileApplyReq 参数名称 必选(M)/可选(O) 类型 参数说明 appId M String 游戏APP ID,获取方法参考查询应用信息。 versionId M Long 资源包版本ID。 fileName M String 应用包文件名称,最大长度为255个字符,且名称不能包含特殊字符(|)、(:)、(/)、(\\)、(*)、(?)、(\")、(<)、(>)。 fileSHA256 M String 升级包文件SHA256值。 fileLength M Long 升级包文件大小(字节数)。 fileType M Int 升级包文件类型: 0:apk-resource filePartApplyInfo O List 分段上传信息,分段数取值[0,1000]。 要求待上传的资源包文件不能低于5MB。 若待上传的资源包文件超过5GB,建议分段上传文件。 GWFilePartApplyInfo 参数名称 必选(M)/可选(O) 类型 参数说明 partNo O String 分段序号。最大长度为1024个字符。 fileSHA256 O String 分段升级包文件SHA256值。 fileLength O Long 分段升级包文件大小(字节数)。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "text": "GWFilePartApplyInfo 参数名称 必选(M)/可选(O) 类型 参数说明 partNo O String 分段序号。最大长度为1024个字符。 fileSHA256 O String 分段升级包文件SHA256值。 fileLength O Long 分段升级包文件大小(字节数)。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053", + "text": "GWPackageUploadApplyInfo 参数名称 必选(M)/可选(O) 类型 参数说明 fileId O String 文件ID。 uploadTime O Long 上传时间。 filePartUploadInfos O List 升级文件信息。 GWFilePartUploadInfo 参数名称 必选(M)/可选(O) 类型 参数说明 partNo O String 文件分段序号。 partObjectId O String 分段对象。 uploadInfo O List 上传信息。 GWPackageUploadInfo 参数名称 必选(M)/可选(O) 类型 参数说明 uploadMethod M String 上传http method。 uploadUrl M String 上传URL地址。 uploadHeaders M List 文件上传请求头列表。 GWUploadHeader 参数名称 必选(M)/可选(O) 类型 参数说明 key O String 键。 value O String 值。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053", + "text": "GWFilePartUploadInfo 参数名称 必选(M)/可选(O) 类型 参数说明 partNo O String 文件分段序号。 partObjectId O String 分段对象。 uploadInfo O List 上传信息。 GWPackageUploadInfo 参数名称 必选(M)/可选(O) 类型 参数说明 uploadMethod M String 上传http method。 uploadUrl M String 上传URL地址。 uploadHeaders M List 文件上传请求头列表。 GWUploadHeader 参数名称 必选(M)/可选(O) 类型 参数说明 key O String 键。 value O String 值。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053", + "text": "GWPackageUploadInfo 参数名称 必选(M)/可选(O) 类型 参数说明 uploadMethod M String 上传http method。 uploadUrl M String 上传URL地址。 uploadHeaders M List 文件上传请求头列表。 GWUploadHeader 参数名称 必选(M)/可选(O) 类型 参数说明 key O String 键。 value O String 值。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053", + "text": "GWUploadHeader 参数名称 必选(M)/可选(O) 类型 参数说明 key O String 键。 value O String 值。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTP POST" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-file/apply" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "requestId", + "M", + "String", + "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section119494174419" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section6704618182019" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "uploadFileApplyReq", + "M", + "GWOpUploadFileApplyReq", + "上传文件请求体。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "versionId", + "M", + "Long", + "资源包版本ID。" + ], + [ + "fileName", + "M", + "String", + "应用包文件名称,最大长度为255个字符,且名称不能包含特殊字符(|)、(:)、(/)、(\\)、(*)、(?)、(\")、(<)、(>)。" + ], + [ + "fileSHA256", + "M", + "String", + "升级包文件SHA256值。" + ], + [ + "fileLength", + "M", + "Long", + "升级包文件大小(字节数)。" + ], + [ + "fileType", + "M", + "Int", + "升级包文件类型: 0:apk-resource" + ], + [ + "filePartApplyInfo", + "O", + "List", + "分段上传信息,分段数取值[0,1000]。 要求待上传的资源包文件不能低于5MB。 若待上传的资源包文件超过5GB,建议分段上传文件。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "partNo", + "O", + "String", + "分段序号。最大长度为1024个字符。" + ], + [ + "fileSHA256", + "O", + "String", + "分段升级包文件SHA256值。" + ], + [ + "fileLength", + "O", + "Long", + "分段升级包文件大小(字节数)。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ], + [ + "data", + "M", + "GWPackageUploadApplyInfo", + "文件上传返回体。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileId", + "O", + "String", + "文件ID。" + ], + [ + "uploadTime", + "O", + "Long", + "上传时间。" + ], + [ + "filePartUploadInfos", + "O", + "List", + "升级文件信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "partNo", + "O", + "String", + "文件分段序号。" + ], + [ + "partObjectId", + "O", + "String", + "分段对象。" + ], + [ + "uploadInfo", + "O", + "List", + "上传信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "uploadMethod", + "M", + "String", + "上传http method。" + ], + [ + "uploadUrl", + "M", + "String", + "上传URL地址。" + ], + [ + "uploadHeaders", + "M", + "List", + "文件上传请求头列表。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "key", + "O", + "String", + "键。" + ], + [ + "value", + "O", + "String", + "值。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section49198053" + } + ], + "title": "资源包文件上传申请", + "updatedAt": "2026-02-12 17:29", + "checkedAt": "2026-10-07T05:16:45.382Z" +} diff --git a/pkg/domain/reference/resources/respackapi-uploadapplyfor.parameters.json b/pkg/domain/reference/resources/respackapi-uploadapplyfor.parameters.json new file mode 100644 index 0000000..711df45 --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-uploadapplyfor.parameters.json @@ -0,0 +1,109 @@ +[ + { + "name": "requestId", + "in": "header", + "type": "string", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section119494174419", + "maxLength": 128 + }, + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section6704618182019" + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": true, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "name": "versionId", + "in": "body", + "type": "integer", + "required": true, + "description": "资源包版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "name": "fileName", + "in": "body", + "type": "string", + "required": true, + "description": "应用包文件名称,最大长度为255个字符,且名称不能包含特殊字符(|)、(:)、(/)、(\\)、(*)、(?)、(\")、(<)、(>)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "maxLength": 255, + "pattern": "^[^|:/\\\\*?\"<>]+$" + }, + { + "name": "fileSHA256", + "in": "body", + "type": "string", + "required": true, + "description": "升级包文件SHA256值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "name": "fileLength", + "in": "body", + "type": "integer", + "required": true, + "description": "升级包文件大小(字节数)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "name": "fileType", + "in": "body", + "type": "integer", + "required": true, + "description": "升级包文件类型: 0:apk-resource", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "enum": [ + "0" + ] + }, + { + "name": "filePartApplyInfo", + "in": "body", + "type": "array", + "required": false, + "description": "分段上传信息,分段数取值[0,1000]。 要求待上传的资源包文件不能低于5MB。 若待上传的资源包文件超过5GB,建议分段上传文件。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "itemsType": "object", + "maxItems": 1000, + "itemsProperties": [ + { + "name": "partNo", + "in": "body", + "type": "string", + "required": false, + "description": "分段序号。最大长度为1024个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234", + "maxLength": 1024 + }, + { + "name": "fileSHA256", + "in": "body", + "type": "string", + "required": false, + "description": "分段升级包文件SHA256值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + }, + { + "name": "fileLength", + "in": "body", + "type": "integer", + "required": false, + "description": "分段升级包文件大小(字节数)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadapplyfor-0000002328236376#section985411610234" + } + ] + } +] diff --git a/pkg/domain/reference/resources/respackapi-uploadconfirm.json b/pkg/domain/reference/resources/respackapi-uploadconfirm.json new file mode 100644 index 0000000..046f16f --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-uploadconfirm.json @@ -0,0 +1,341 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section175272026758", + "text": "请求示例\nPOST /api/games-background-assets-service/v1/open-gw/dev/12***3344/package-file/confirm HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41*****7168\nAuthorization: Bearer ******\nrequestId: *****\n{\n \"appId\": \"12345678\",\n \"fileId\": 17***736,\n \"uploadResult\": 0,\n \"versionId\": 0, \n \"hotUpdateVersion\": \"2.4.1\",\n \"filePartConfirmInfos\": [\n {\n \"partNo\": \"20\",\n \"partObjectId\": \"string\",\n \"etag\": \"string\",\n \"xGoogleGeneration\": \"string\"\n }\n ]\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section847941515100", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n }\n }" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#ZH-CN_TOPIC_0000002362394641__li9381123216197", + "title": "GWUploadFileConfirmReq" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/appgallery_queryappinfo", + "title": "查询应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#ZH-CN_TOPIC_0000002362394641__li660113537197", + "title": "GWFilePartConfirmInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#ZH-CN_TOPIC_0000002362394641__li1750915382310", + "title": "GbasRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-returncode-0000002328236396", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section8711909", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section42749152", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section6704618182019", + "title": "Path" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section175272026758", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section49198053", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section847941515100", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section145575382294", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section8711909", + "text": "确认资源包文件已上传。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "text": "GWUploadFileConfirmReq 参数名称 必选(M)/可选(O) 类型 参数说明 appId O String 游戏APP ID,获取方法参考查询应用信息。 fileId O Long 文件ID。 uploadResult M Int(32) 上传结果: 0:成功 1:失败 versionId M Long 资源包版本ID。 hotUpdateVersion O String 资源包子版本号。最长128个字符。 filePartConfirmInfos O List 文件分片确认信息。 GWFilePartConfirmInfo 参数名称 必选(M)/可选(O) 类型 参数说明 partNo O String 分段序号。最大长度1024个字符。 partObjectId O String 分段对象,大文件创建接口响应获取。最大长度2048个字符。 etag O String 分段Etag,上传至OBS响应的header中获取。最大长度2048个字符。 xGoogleGeneration O String 分段x_google_gengration,上传至OBS响应的header中获取。最大长度2048个字符。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "text": "GWFilePartConfirmInfo 参数名称 必选(M)/可选(O) 类型 参数说明 partNo O String 分段序号。最大长度1024个字符。 partObjectId O String 分段对象,大文件创建接口响应获取。最大长度2048个字符。 etag O String 分段Etag,上传至OBS响应的header中获取。最大长度2048个字符。 xGoogleGeneration O String 分段x_google_gengration,上传至OBS响应的header中获取。最大长度2048个字符。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section49198053", + "text": "GbasRet 参数名称 必选(M)/可选(O) 类型 参数说明 code O Int 返回码,请参见错误码。 msg O String 返回码描述信息。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTP POST" + ], + [ + "接口方向", + "开发者服务器 ->华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/games-background-assets-service/v1/open-gw/dev/{devId}/package-file/confirm" + ], + [ + "数据格式", + "请求消息:Content-Type: application/json 响应消息:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端,其中“角色”支持勾选“APP管理员”、“管理员”、“运营”。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "requestId", + "M", + "String", + "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section119494174419" + }, + { + "location": "path", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "devId", + "M", + "Long", + "开发者ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section6704618182019" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileConfirmReq", + "M", + "GWUploadFileConfirmReq", + "文件确认请求体。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "O", + "String", + "游戏APP ID,获取方法参考查询应用信息。" + ], + [ + "fileId", + "O", + "Long", + "文件ID。" + ], + [ + "uploadResult", + "M", + "Int(32)", + "上传结果: 0:成功 1:失败" + ], + [ + "versionId", + "M", + "Long", + "资源包版本ID。" + ], + [ + "hotUpdateVersion", + "O", + "String", + "资源包子版本号。最长128个字符。" + ], + [ + "filePartConfirmInfos", + "O", + "List", + "文件分片确认信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "partNo", + "O", + "String", + "分段序号。最大长度1024个字符。" + ], + [ + "partObjectId", + "O", + "String", + "分段对象,大文件创建接口响应获取。最大长度2048个字符。" + ], + [ + "etag", + "O", + "String", + "分段Etag,上传至OBS响应的header中获取。最大长度2048个字符。" + ], + [ + "xGoogleGeneration", + "O", + "String", + "分段x_google_gengration,上传至OBS响应的header中获取。最大长度2048个字符。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "GbasRet", + "包含返回码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为返回码,description为返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section49198053" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Int", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section49198053" + } + ], + "title": "资源包文件上传确认", + "updatedAt": "2025-08-08 14:18", + "checkedAt": "2026-10-07T03:00:29.824Z", + "family": "resources", + "endpoint": "respackapi-uploadconfirm" +} diff --git a/pkg/domain/reference/resources/respackapi-uploadconfirm.parameters.json b/pkg/domain/reference/resources/respackapi-uploadconfirm.parameters.json new file mode 100644 index 0000000..2cbc22c --- /dev/null +++ b/pkg/domain/reference/resources/respackapi-uploadconfirm.parameters.json @@ -0,0 +1,111 @@ +[ + { + "name": "requestId", + "in": "header", + "type": "string", + "required": true, + "description": "请求ID,最大长度128个字符,必须唯一。开发者自定义,用于鉴别是否是重复请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section119494174419", + "maxLength": 128 + }, + { + "name": "devId", + "in": "path", + "type": "integer", + "required": true, + "description": "开发者ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section6704618182019" + }, + { + "name": "appId", + "in": "body", + "type": "string", + "required": false, + "description": "游戏APP ID,获取方法参考查询应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234" + }, + { + "name": "fileId", + "in": "body", + "type": "integer", + "required": false, + "description": "文件ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234" + }, + { + "name": "uploadResult", + "in": "body", + "type": "integer", + "required": true, + "description": "上传结果: 0:成功 1:失败", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "enum": [ + "0", + "1" + ] + }, + { + "name": "versionId", + "in": "body", + "type": "integer", + "required": true, + "description": "资源包版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234" + }, + { + "name": "hotUpdateVersion", + "in": "body", + "type": "string", + "required": false, + "description": "资源包子版本号。最长128个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 128 + }, + { + "name": "filePartConfirmInfos", + "in": "body", + "type": "array", + "required": false, + "description": "文件分片确认信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "itemsType": "object", + "itemsProperties": [ + { + "name": "partNo", + "in": "body", + "type": "string", + "required": false, + "description": "分段序号。最大长度1024个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 1024 + }, + { + "name": "partObjectId", + "in": "body", + "type": "string", + "required": false, + "description": "分段对象,大文件创建接口响应获取。最大长度2048个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 2048 + }, + { + "name": "etag", + "in": "body", + "type": "string", + "required": false, + "description": "分段Etag,上传至OBS响应的header中获取。最大长度2048个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 2048 + }, + { + "name": "xGoogleGeneration", + "in": "body", + "type": "string", + "required": false, + "description": "分段x_google_gengration,上传至OBS响应的header中获取。最大长度2048个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-respackapi-uploadconfirm-0000002362394641#section985411610234", + "maxLength": 2048 + } + ] + } +] diff --git a/pkg/domain/reference/serverless/endpoints.json b/pkg/domain/reference/serverless/endpoints.json new file mode 100644 index 0000000..418c7da --- /dev/null +++ b/pkg/domain/reference/serverless/endpoints.json @@ -0,0 +1,4691 @@ +[ + { + "id": "create-version", + "familyId": "hosting", + "name": "创建版本", + "description": "此接口用于创建云托管站点版本,已归档版本可作为新版本的基线版本。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/create", + "command": "agc hosting create-version", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196", + "officialSlug": "agcapi-cloudhost-newapp-0000001111685196", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "baseVersion", + "type": "string", + "required": false, + "description": "基线版本号,基于该版本创建新的版本。 仅支持版本状态为“FINALIZED”的版本作为基线版本。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196#section17512144171520", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "id": "modify-files", + "familyId": "hosting", + "name": "修改版本文件列表", + "description": "此接口用于对基线版本需要删除的文件做版本修改,标记需要删除文件的绝对路径,在归档版本时处理文件。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/modifyFilelist", + "command": "agc hosting modify-files", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867", + "officialSlug": "agcapi-cloudhost-modifyversion-0000001211627867", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section13360089148", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管站点版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号(仅支持版本状态为“CREATED”的版本)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "deleteFiles", + "type": "array", + "required": true, + "description": "需要删除的文件列表(文件的绝对路径),一次最多删除1000个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867#section17512144171520", + "in": "body", + "itemsType": "string", + "maxItems": 1000 + } + ] + }, + { + "id": "upload-url", + "familyId": "hosting", + "name": "获取版本压缩包上传地址", + "description": "此接口用于获取增量版本文件压缩包或全量版本文件压缩包的上传地址等信息,并完成增量版本包上传。您可以多次获取上传地址,以最后一次获取为最终增量版本。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/populateFiles", + "command": "agc hosting upload-url", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "officialSlug": "agcapi-cloudhost-uploadurl-0000001166347942", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section13360089148", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在的站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号(只支持“CREATED”状态版本)", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "materialInfos", + "type": "array", + "required": true, + "description": "zip增量包参数信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "sceneId", + "type": "string", + "required": true, + "description": "场景ID,与项目ID一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 128 + }, + { + "name": "fileName", + "type": "string", + "required": true, + "description": "文件名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 256 + }, + { + "name": "fileSha256", + "type": "string", + "required": true, + "description": "zip增量的Hash值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "maxLength": 64, + "pattern": "^[a-fA-F0-9]{64}$" + }, + { + "name": "fileSize", + "type": "integer", + "required": true, + "description": "文件大小,参数最大限制10G。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "minimum": 0, + "maximum": 10737418240 + }, + { + "name": "contentType", + "type": "integer", + "required": true, + "description": "上传资源类型。固定值为:902。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942#section17512144171520", + "in": "body", + "enum": [ + "902" + ] + } + ] + } + ] + }, + { + "id": "upload-version", + "familyId": "hosting", + "name": "上传版本压缩包", + "description": "通过获取上传地址的响应请求地址、请求方法、请求头信息,上传版本压缩包至云托管。", + "method": "PUT", + "path": "{uploadUrl}", + "command": "agc hosting upload-version", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "officialSlug": "agcapi-cloudhost-uploadversion-0000001211707813", + "direction": "developer-to-huawei", + "defaultBaseUrl": "", + "authentication": "signed-upload", + "requestContentType": "", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": true, + "description": "校验信息,对应获取版本压缩包上传地址接口返回的headers参数中的Authorization。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "x-amz-content-sha256", + "type": "string", + "required": true, + "description": "文件对象内容的SHA256哈希值,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-content-sha256。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "x-amz-client-request-id", + "type": "string", + "required": true, + "description": "文件上传的唯一标识,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-client-request-id。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "x-amz-date", + "type": "string", + "required": true, + "description": "文件上传地址生成的时间,对应获取版本压缩包上传地址接口返回的headers参数中的x-amz-date。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "Host", + "type": "string", + "required": true, + "description": "上传服务器地址,对应获取版本压缩包上传地址接口返回的headers参数中的Host。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "Content-Type", + "type": "string", + "required": true, + "description": "对象内容的类型,对应获取版本压缩包上传地址接口返回的headers参数中的Content-Type。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813#section236517415165", + "in": "header" + }, + { + "name": "uploadUrl", + "in": "path", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813" + }, + { + "name": "file", + "in": "file", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813" + } + ] + }, + { + "id": "archive-version", + "familyId": "hosting", + "name": "归档版本", + "description": "版本包上传完成后,此接口用于对新版本进行归档。如果上传的是增量版本包,云托管对基线版本和增量版本包进行合并,归档为完整的新版本文件包。归档版本是异步操作,从开始到完成,版本的状态从“MERGING”变为“FINALIZED”。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/merge", + "command": "agc hosting archive-version", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385", + "officialSlug": "agcapi-cloudhost-archivedversion-0000001211826385", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号(只支持“CREATED”状态)。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385#section17512144171520", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "id": "release-version", + "familyId": "hosting", + "name": "发布版本", + "description": "此接口用于发布新版本。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/release", + "command": "agc hosting release-version", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484", + "officialSlug": "agcapi-cloudhost-releaseversion-0000001166666484", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在站点ID。 可根据站点名称查询站点ID,获取方法参考查询站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "当前版本的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "environment", + "type": "integer", + "required": true, + "description": "发布环境类型。 0:生产 1:沙箱", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484#section17512144171520", + "in": "body", + "enum": [ + "0", + "1" + ] + } + ] + }, + { + "id": "list-versions", + "familyId": "hosting", + "name": "查询版本列表", + "description": "此接口用于查询云托管站点下的版本列表。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/query", + "command": "agc hosting list-versions", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920", + "officialSlug": "agcapi-cloudhost-queryversion-0000001166507920", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": false, + "description": "云托管版本所在站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "tenantId", + "type": "string", + "required": false, + "description": "租户ID,与项目ID一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": false, + "description": "版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "versionStatus", + "type": "string", + "required": false, + "description": "版本状态,参考版本状态码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920#section17512144171520", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "id": "list-version-files", + "familyId": "hosting", + "name": "查询归档版本文件", + "description": "此接口用于查询已归档版本的归档文件信息,为创建和修改版本提供基线版本内容的查询。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/version/queryFiles", + "command": "agc hosting list-version-files", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869", + "officialSlug": "agcapi-cloudhost-queryfile-0000001211627869", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "云托管版本所在站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "version", + "type": "string", + "required": true, + "description": "站点版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "maxLength": 64 + }, + { + "name": "pageInfo", + "type": "object", + "required": true, + "description": "分页模型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "properties": [ + { + "name": "queryIndex", + "type": "integer", + "required": false, + "description": "索引查询,默认值为0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body" + }, + { + "name": "querySize", + "type": "integer", + "required": false, + "description": "每页查询数量,默认值为1000,最大值为1000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869#section17512144171520", + "in": "body", + "maximum": 1000 + } + ] + } + ] + }, + { + "id": "delete-version", + "familyId": "hosting", + "name": "删除版本", + "description": "此接口用于删除站点下非“上线”状态的版本。", + "method": "DELETE", + "path": "/api/cloudhosting/web/v1/version/{versionId}", + "command": "agc hosting delete-version", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944", + "officialSlug": "agcapi-cloudhost-deleteversion-0000001166347944", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section236517415165", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "versionId", + "type": "string", + "required": true, + "description": "站点版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944#section17512144171520", + "in": "path", + "maxLength": 64 + } + ] + }, + { + "id": "create-environment", + "familyId": "hosting", + "name": "创建站点环境", + "description": "此接口用于创建站点环境。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/environment/create", + "command": "agc hosting create-environment", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720", + "officialSlug": "agcapi-cloudhost-createnvir-0000001216965720", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "environmentId", + "type": "string", + "required": true, + "description": "环境ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720#section2809102219131", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "id": "list-environments", + "familyId": "hosting", + "name": "查询站点环境", + "description": "此接口用于查询站点环境。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/environment/query", + "command": "agc hosting list-environments", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680", + "officialSlug": "agcapi-cloudhost-queryenvir-0000001217285680", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "environmentId", + "type": "string", + "required": false, + "description": "环境ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680#section2809102219131", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "id": "delete-environment", + "familyId": "hosting", + "name": "删除站点环境", + "description": "此接口用于删除站点环境。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/environment/delete", + "command": "agc hosting delete-environment", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648", + "officialSlug": "agcapi-cloudhost-deletenvir-0000001217445648", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "environmentId", + "type": "string", + "required": true, + "description": "环境ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648#section2809102219131", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "id": "create-site", + "familyId": "hosting", + "name": "创建站点", + "description": "此接口用于创建泛域名站点。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/create", + "command": "agc hosting create-site", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466", + "officialSlug": "agcapi-cloudhost-createsite-0000001216061466", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteName", + "type": "string", + "required": true, + "description": "站点名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131", + "in": "body", + "maxLength": 30 + }, + { + "name": "description", + "type": "string", + "required": false, + "description": "站点描述信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466#section2809102219131", + "in": "body", + "maxLength": 1000 + } + ] + }, + { + "id": "list-sites", + "familyId": "hosting", + "name": "查询站点", + "description": "此接口用于通过站点部分信息查询站点其他信息,例如通过站点名称查询站点ID。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/query", + "command": "agc hosting list-sites", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "officialSlug": "agcapi-cloudhost-querysite-0000001166826430", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "site", + "type": "object", + "required": true, + "description": "站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "properties": [ + { + "name": "siteName", + "type": "string", + "required": false, + "description": "站点名称。 可通过云托管站点名称查询站点完整信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maxLength": 63 + }, + { + "name": "siteId", + "type": "string", + "required": false, + "description": "站点ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "tenantId", + "type": "string", + "required": false, + "description": "租户ID,与项目ID一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maxLength": 64 + } + ] + }, + { + "name": "pageInfo", + "type": "object", + "required": false, + "description": "分页模型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "properties": [ + { + "name": "queryIndex", + "type": "integer", + "required": false, + "description": "索引查询,默认值为0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body" + }, + { + "name": "querySize", + "type": "integer", + "required": false, + "description": "每页查询数量。默认值为1000,最大值为1000", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430#section2809102219131", + "in": "body", + "maximum": 1000 + } + ] + } + ] + }, + { + "id": "update-site", + "familyId": "hosting", + "name": "更新站点", + "description": "此接口用于更新站点描述信息及控制是否开启简洁链接。", + "method": "POST", + "path": "/api/cloudhosting/web/v1/site/modify", + "command": "agc hosting update-site", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359", + "officialSlug": "agcapi-cloudhost-refreshsite-0000001260949359", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "in": "body", + "maxLength": 64 + }, + { + "name": "description", + "type": "string", + "required": false, + "description": "描述信息内容,匹配中文、空格、下划线、中划线、点、英文字母及数字。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "in": "body", + "maxLength": 1000 + }, + { + "name": "cleanSuffix", + "type": "integer", + "required": false, + "description": "简洁链接: 0-关闭。 1-开启。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359#section2809102219131", + "in": "body", + "enum": [ + "0", + "1" + ] + } + ] + }, + { + "id": "delete-site", + "familyId": "hosting", + "name": "删除站点", + "description": "此接口用于删除站点。", + "method": "DELETE", + "path": "/api/cloudhosting/web/v1/site/{siteId}", + "command": "agc hosting delete-site", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361", + "officialSlug": "agcapi-cloudhost-deletesite-0000001260869361", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "server-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证鉴权信息。 认证方式:Bearer token。 格式:“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,获取方法参考查询开发者账号ID及项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "requestid", + "type": "string", + "required": true, + "description": "自定义的请求字符串,必须唯一标识此请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header" + }, + { + "name": "service", + "type": "string", + "required": true, + "description": "API业务标识。固定值:hosting。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section580816227139", + "in": "header", + "enum": [ + "hosting" + ] + }, + { + "name": "siteId", + "type": "string", + "required": true, + "description": "站点信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361#section2809102219131", + "in": "path", + "maxLength": 64 + } + ] + }, + { + "id": "import-users", + "familyId": "cloud-auth", + "name": "导入用户", + "description": "此接口用于将准备好的用户信息导入到认证服务的用户数据中。", + "method": "POST", + "path": "/api/auth-service/v1/server/user:import", + "command": "agc cloud-auth import-users", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892", + "officialSlug": "server-rest-import-0000001136020892", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section17216134314169", + "in": "header" + }, + { + "name": "users", + "type": "array", + "required": true, + "description": "第三方的认证信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "importUid", + "type": "string", + "required": true, + "description": "用户ID,唯一标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "displayName", + "type": "string", + "required": false, + "description": "用户昵称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "photoUrl", + "type": "string", + "required": false, + "description": "头像地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 2048 + }, + { + "name": "email", + "type": "string", + "required": false, + "description": "用户邮箱地址。 第三方的认证信息providers中的providerId为12的时候不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 512 + }, + { + "name": "emailVerified", + "type": "boolean", + "required": false, + "description": "邮箱是否需要验证,值为true或者false。 第三方的认证信息providers中的providerId为12的时候不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body" + }, + { + "name": "phone", + "type": "string", + "required": false, + "description": "手机号。格式: +国家码-手机号,示例+86-18260096275。 第三方的认证信息providers中的providerId为11的时候不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 32 + }, + { + "name": "createTime", + "type": "string", + "required": true, + "description": "创建时间,距离1970年1月1日毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 20 + }, + { + "name": "lastLoginTime", + "type": "string", + "required": false, + "description": "上次登入时间,距离1970年1月1日的毫秒数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 20 + }, + { + "name": "passwordHash", + "type": "string", + "required": false, + "description": "明文密码经过PBKDF2WithSHA256后的结果,迭代次数10000,盐值对应passwordSalt。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 8192 + }, + { + "name": "passwordSalt", + "type": "string", + "required": false, + "description": "密码算法的盐值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 8192 + }, + { + "name": "providers", + "type": "array", + "required": true, + "description": "第三方的认证信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "itemsType": "object", + "maxItems": 32, + "itemsProperties": [ + { + "name": "provider", + "type": "string", + "required": true, + "description": "认证方式类型: 0:匿名账号 1:华为账号 2: FACEBOOK* 3. TWITTER* 4:微信 5:华为游戏 6:QQ 7:微博 8:GOOGLE* 9: GOOGLE_PLAY_GAME* 10:自建账号 11:手机 12:邮箱 13:苹果账号 18:支付宝账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body" + }, + { + "name": "providerUid", + "type": "string", + "required": true, + "description": "用户唯一标识,由三方系统分配。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "photoUrl", + "type": "string", + "required": false, + "description": "头像地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 2048 + }, + { + "name": "displayName", + "type": "string", + "required": false, + "description": "用户昵称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + }, + { + "name": "openId", + "type": "string", + "required": false, + "description": "发送者唯一标识,例如微信openId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892#section12304113241318", + "in": "body", + "maxLength": 1024 + } + ] + } + ] + } + ] + }, + { + "id": "export-users", + "familyId": "cloud-auth", + "name": "导出用户", + "description": "此接口用于导出认证服务中的用户信息。", + "method": "POST", + "path": "/api/auth-service/v1/server/user:export", + "command": "agc cloud-auth export-users", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686", + "officialSlug": "server-rest-export-0000001136180686", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section1651855118124", + "in": "header" + }, + { + "name": "block", + "type": "", + "required": false, + "description": "当前存储块号。不填默认是0。第1次调用时,block设置为0。服务端会返回totalBlock。后面采用循环调用,遍历导出block块里面的用户。 Documented String/example integer conflict; accepted without coercion.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686#section16294334331", + "in": "body" + } + ] + }, + { + "id": "verify-token", + "familyId": "cloud-auth", + "name": "验证用户凭据", + "description": "此接口用于验证已经颁发的用户凭据并且检查用户凭据是否已经撤销。", + "method": "GET", + "path": "/api/oauth2/third/v1/verify-token", + "command": "agc cloud-auth verify-token", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271", + "officialSlug": "server-rest-verify-0000001182300271", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "用户凭据。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section1651855118124", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271#section29031245171214", + "in": "query" + } + ] + }, + { + "id": "revoke-token", + "familyId": "cloud-auth", + "name": "撤销用户凭据", + "description": "此接口用于撤销已经颁发的用户访问凭据。", + "method": "POST", + "path": "/api/oauth2/third/v1/revoke-token", + "command": "agc cloud-auth revoke-token", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193", + "officialSlug": "server-rest-revoke-0000001182420193", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-api.cloud.huawei.com", + "authentication": "service-account-or-api-client", + "requestContentType": "application/json", + "parameters": [ + { + "name": "uid", + "type": "string", + "required": true, + "description": "待撤销凭据的用户。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1649104725019", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193#section1696945244814", + "in": "query" + } + ] + }, + { + "id": "client-token", + "familyId": "cloud-auth", + "name": "获取Token", + "description": "在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。", + "method": "POST", + "path": "/agc/apigw/oauth2/v1/token", + "command": "agc cloud-auth client-token", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "officialSlug": "client-rest-auth-obtaintoken-0000001414202481", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "body-client-credentials", + "requestContentType": "application/json", + "parameters": [ + { + "name": "useJwt", + "type": "integer", + "required": true, + "description": "是否使用自有账号凭据JWT(Json Web Token): 1:使用JWT。 0:不使用,默认为0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "grant_type", + "type": "string", + "required": true, + "description": "固定传入“client_credentials”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body", + "enum": [ + "client_credentials" + ] + }, + { + "name": "client_id", + "type": "string", + "required": true, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body" + }, + { + "name": "client_secret", + "type": "string", + "required": true, + "description": "客户端密钥,即获取客户端API授权中的“Client Secret”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481#section128mcpsimp", + "in": "body" + } + ] + }, + { + "id": "request-code", + "familyId": "cloud-auth", + "name": "验证码申请", + "description": "此接口用于用户注册、登录或者重置密码时验证码申请。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/verify-code", + "command": "agc cloud-auth request-code", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "officialSlug": "client-rest-auth-verifycode-0000001294228992", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section16132444182317", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section228117246513", + "in": "query" + }, + { + "name": "phone", + "type": "string", + "required": false, + "description": "手机号。需包含国家码,以“+”开头,国家码和手机号之间以“-”连接,例如中国大陆手机号“+86-150xxxxxxxx”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body" + }, + { + "name": "email", + "type": "string", + "required": false, + "description": "电子邮箱。 电子邮箱和手机号码二者必填一个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body" + }, + { + "name": "action", + "type": "integer", + "required": false, + "description": "验证码行为,取值如下: 1001:注册登录时申请验证码。 1002:重置密码时申请验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body", + "enum": [ + "1001", + "1002" + ] + }, + { + "name": "lang", + "type": "string", + "required": false, + "description": "语言,格式为“zh_CN”。所有支持的语言类型请参考认证服务验证码语言类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body", + "enum": [ + "am_ET", + "ar_EG", + "as_IN", + "az_AZ", + "be_BY", + "bg_BG", + "bn_BD", + "bo_CN", + "bs_BA", + "ca_ES", + "cs_CZ", + "da_DK", + "de_DE", + "el_GR", + "en_GB", + "en_US", + "es_ES", + "es_US", + "et_EE", + "eu_ES", + "fa_IR", + "fi_FI", + "fr_FR", + "gl_ES", + "gu_IN", + "iw_IL", + "hi_IN", + "hr_HR", + "hu_HU", + "in_ID", + "it_IT", + "ja_JP", + "jv_Latn", + "ka_GE", + "kk_KZ", + "km_KH", + "kn_IN", + "ko_KR", + "lo_LA", + "lt_LT", + "lv_LV", + "mai_IN", + "mi_NZ", + "mk_MK", + "ml_IN", + "mn_MN", + "mr_IN", + "ms_MY", + "my_MM", + "ne_NP", + "nl_NL", + "nb_NO", + "or_IN", + "pa_IN", + "pl_PL", + "pt_BR", + "pt_PT", + "ro_RO", + "ru_RU", + "si_LK", + "sk_SK", + "sl_SI", + "sr_latn", + "sv_SE", + "sw_KE", + "ta_IN", + "te_IN", + "th_TH", + "tl_PH", + "tr_TR", + "my_ZG", + "uk_UA", + "ur_PK", + "uz_UZ", + "vi_VN", + "zh_CN", + "zh_HK", + "zh_TW" + ] + }, + { + "name": "sendInterval", + "type": "integer", + "required": false, + "description": "验证码发送间隔,30s到120s之间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992#section31763842416", + "in": "body", + "minimum": 30, + "maximum": 120 + } + ] + }, + { + "id": "register", + "familyId": "cloud-auth", + "name": "用户注册", + "description": "此接口用于用户注册。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-register", + "command": "agc cloud-auth register", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "officialSlug": "client-rest-auth-register-0000001346709109", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1271295172910", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section3324145832711", + "in": "query" + }, + { + "name": "phone", + "type": "string", + "required": false, + "description": "手机号,包括国家码,以“+”开头,例如中国大陆的手机号以“+86”开头。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "email", + "type": "string", + "required": false, + "description": "电子邮箱。 电子邮箱和手机号码二者必填一个。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "verifyCode", + "type": "string", + "required": false, + "description": "验证码,传入手机号时必填。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "password", + "type": "string", + "required": false, + "description": "登录密码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109#section1041827152910", + "in": "body" + } + ] + }, + { + "id": "sign-in-password", + "familyId": "cloud-auth", + "name": "用户密码登录", + "description": "此接口用于用户使用密码登录。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signin", + "command": "agc cloud-auth sign-in-password", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348", + "officialSlug": "client-rest-auth-signin-0000001294069348", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1180818719577", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section8252421578", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348#section1643221416579", + "in": "body" + } + ] + }, + { + "id": "sign-in-code", + "familyId": "cloud-auth", + "name": "用户验证码登录", + "description": "此接口用于用户使用验证码登录。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signin", + "command": "agc cloud-auth sign-in-code", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685", + "officialSlug": "client-rest-auth-usersigini-0000001346828685", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section0279104411591", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section11159123655916", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于验证码登录时填写验证码,填写样例如 {\\\"verifyCode\\\":\\\"123456\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685#section1432704914599", + "in": "body" + } + ] + }, + { + "id": "update-account", + "familyId": "cloud-auth", + "name": "修改手机号或邮箱地址", + "description": "此接口用于用户修改手机号码或者邮箱地址。", + "method": "PUT", + "path": "/agc/apigw/oauth2/third/v1/user-phone-email", + "command": "agc cloud-auth update-account", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "officialSlug": "client-rest-auth-modify-phone-email-0000001347069197", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section14358637816", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1454420327110", + "in": "query" + }, + { + "name": "lang", + "type": "string", + "required": false, + "description": "语言,格式为“zh_CN”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + }, + { + "name": "newPhone", + "type": "string", + "required": false, + "description": "新手机号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + }, + { + "name": "newEmail", + "type": "string", + "required": false, + "description": "新邮箱地址。 新邮箱地址和新手机号必填一个且只能填一个,即一次只修改手机号或者只修改邮箱地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + }, + { + "name": "newVerifyCode", + "type": "string", + "required": true, + "description": "新验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197#section1556604410117", + "in": "body" + } + ] + }, + { + "id": "reset-password", + "familyId": "cloud-auth", + "name": "重置密码", + "description": "此接口用于用户进行密码重置。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/reset-password", + "command": "agc cloud-auth reset-password", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500", + "officialSlug": "client-rest-auth-resetpwd-0000001293909500", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section187405231633", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1226971914320", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": false, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "account", + "type": "string", + "required": false, + "description": "用户手机账号或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body" + }, + { + "name": "verifyCode", + "type": "string", + "required": false, + "description": "验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body" + }, + { + "name": "password", + "type": "string", + "required": false, + "description": "新密码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500#section1263082911311", + "in": "body" + } + ] + }, + { + "id": "update-password", + "familyId": "cloud-auth", + "name": "修改密码", + "description": "此接口用于用户进行密码修改。", + "method": "PUT", + "path": "/agc/apigw/oauth2/third/v1/user-password", + "command": "agc cloud-auth update-password", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536", + "officialSlug": "client-rest-auth-modifypwd-0000001293749536", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section10676123415615", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section790812451959", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": false, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "verifyCode", + "type": "string", + "required": false, + "description": "验证码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "in": "body" + }, + { + "name": "newPassword", + "type": "string", + "required": true, + "description": "新密码。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536#section787416439612", + "in": "body" + } + ] + }, + { + "id": "link-user", + "familyId": "cloud-auth", + "name": "用户关联", + "description": "此接口用于用户进行账号关联操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-link", + "command": "agc cloud-auth link-user", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381", + "officialSlug": "client-rest-auth-userlink-0000001346909381", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section1871425017815", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section448216421586", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于账号关联时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 1:自动创建,默认为1。 0:不自动创建。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381#section101544567816", + "in": "body" + } + ] + }, + { + "id": "unlink-user", + "familyId": "cloud-auth", + "name": "取消关联", + "description": "此接口用于用户取消账号关联。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-unlink", + "command": "agc cloud-auth unlink-user", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000", + "officialSlug": "client-rest-auth-unlink-0000001294229000", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section7186123271011", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "需要取消关联的provider认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000#section14425102781015", + "in": "query", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + } + ] + }, + { + "id": "sign-out", + "familyId": "cloud-auth", + "name": "登出", + "description": "此接口用于用户进行登出操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signout", + "command": "agc cloud-auth sign-out", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113", + "officialSlug": "client-rest-auth-signout-0000001346709113", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section28252016123", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section664965521111", + "in": "query" + }, + { + "name": "refreshToken", + "type": "string", + "required": true, + "description": "用于刷新accessToken。当accessToken过期后,需要使用refreshToken去获取新的accessToken。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217", + "in": "body" + }, + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113#section1894611571217", + "in": "body" + } + ] + }, + { + "id": "delete-user", + "familyId": "cloud-auth", + "name": "注销", + "description": "此接口用于用户进行账号注销操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-delete", + "command": "agc cloud-auth delete-user", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360", + "officialSlug": "client-rest-auth-userdelete-0000001294069360", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section6802739131316", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360#section1636433517133", + "in": "query" + } + ] + }, + { + "id": "reauthenticate", + "familyId": "cloud-auth", + "name": "账号重认证", + "description": "此接口用于用户进行账号重认证操作。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-reauthenticate", + "command": "agc cloud-auth reauthenticate", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693", + "officialSlug": "client-rest-auth-reauthenticate-0000001346828693", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": true, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section587118188151", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section13279111311156", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于账号重认证时填写密码,填写样例如{\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号: 0:不自动创建。 1:自动创建,默认为1。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": false, + "description": "是否使用自有账号凭据JWT(Json Web Token): 0:不使用,默认为0。 1:使用。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693#section05352023131512", + "in": "body" + } + ] + }, + { + "id": "client-token", + "familyId": "clouddb", + "name": "获取Token", + "description": "在使用客户端REST API调用业务接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。", + "method": "POST", + "path": "/agc/apigw/oauth2/v1/token", + "command": "agc clouddb client-token", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "officialSlug": "clouddb-obtaintoken-rest-0000001446607602", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "body-client-credentials", + "requestContentType": "application/json", + "parameters": [ + { + "name": "useJwt", + "type": "integer", + "required": true, + "description": "使用账号凭据JWT(Json Web Token),固定传入“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "grant_type", + "type": "string", + "required": true, + "description": "固定传入“client_credentials”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body", + "enum": [ + "client_credentials" + ] + }, + { + "name": "client_id", + "type": "string", + "required": true, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body" + }, + { + "name": "client_secret", + "type": "string", + "required": true, + "description": "客户端密钥,即获取客户端API授权中的“Client Secret”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602#section128mcpsimp", + "in": "body" + } + ] + }, + { + "id": "sign-in", + "familyId": "clouddb", + "name": "用户登录", + "description": "该接口用于用户使用账号密码登录。", + "method": "POST", + "path": "/agc/apigw/oauth2/third/v1/user-signin", + "command": "agc clouddb sign-in", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "officialSlug": "clouddb-signin-rest-0000001496447669", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息。格式为“Authorization: Bearer ${access_token}”。 access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1180818719577", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section8252421578", + "in": "query" + }, + { + "name": "provider", + "type": "integer", + "required": true, + "description": "账号授权提供方,取值及对应认证方式如下: 0:匿名账号 1:华为账号 2:Facebook* 3:Twitter* 4:微信 5:华为游戏 6:QQ 7:微博 8:Google* 9:Google Play Game* 10:自建账号 11:手机 12:邮箱 13:苹果账号 说明 *星号标记的账号类型仅在海外站点支持,当您选择数据处理位置为德国、新加坡或俄罗斯时可以使用这些认证方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13" + ] + }, + { + "name": "token", + "type": "string", + "required": true, + "description": "手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + }, + { + "name": "extraData", + "type": "string", + "required": false, + "description": "扩展字段,此处用于密码登录时填写密码,填写样例如 {\\\"password\\\":\\\"xxxxxxxxx\\\"}。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + }, + { + "name": "autoCreateUser", + "type": "integer", + "required": false, + "description": "是否自动创建用户,仅用于非托管账号。 0:不自动创建用户。 1:默认值,自动创建用户。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "useJwt", + "type": "integer", + "required": true, + "description": "使用账号凭据JWT(Json Web Token),固定传入“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body", + "enum": [ + "0", + "1" + ] + }, + { + "name": "channelId", + "type": "string", + "required": false, + "description": "渠道标识,当前渠道划分为华为渠道、AppStore渠道以及GooglePlay渠道。当从这些渠道SDK登录时,该参数有值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + }, + { + "name": "aaId", + "type": "string", + "required": false, + "description": "应用实例唯一编号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669#section1643221416579", + "in": "body" + } + ] + }, + { + "id": "query-data", + "familyId": "clouddb", + "name": "查询数据", + "description": "该接口用于用户查询数据,云数据库提供了丰富的谓词查询,比如equalTo、notEqualTo、in等,通过单个或者多个链式过滤条件,您可以从云侧数据库查询到满足特定条件的对象,也可以通过限定查询返回数量谓词限定查询结果返回的数量,还可以支持聚合查询,例如查询平均值、最大值、最小值等。", + "method": "POST", + "path": "/agc/apigw/clouddb/clouddbservice/sync/query", + "command": "agc clouddb query-data", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "officialSlug": "clouddb-query-data-rest-0000001496647573", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考获取客户端API授权。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息。格式为“Authorization: Bearer ${client_token}”。 client_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section1191513141413", + "in": "header" + }, + { + "name": "_v", + "type": "integer", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section88414213129", + "in": "query", + "enum": [ + "4" + ] + }, + { + "name": "msgInfo", + "type": "object", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "in": "body", + "properties": [ + { + "name": "type", + "type": "integer", + "required": true, + "description": "查询请求。入参需为“5”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "in": "body", + "enum": [ + "5" + ] + }, + { + "name": "opStore", + "type": "object", + "required": true, + "description": "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section42449327218", + "in": "body", + "properties": [ + { + "name": "storeName", + "in": "body", + "type": "string", + "required": true + } + ] + } + ] + }, + { + "name": "clientInfo", + "type": "object", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "in": "body", + "properties": [ + { + "name": "appVer", + "type": "integer", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section448214662111", + "in": "body" + } + ] + }, + { + "name": "queryReqMsg", + "type": "object", + "required": true, + "description": "查询请求的基本信息,具体请参见QueryRequestMessage。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section2069774871410", + "in": "body", + "properties": [ + { + "name": "queryType", + "type": "integer", + "required": true, + "description": "查询类型。涉及到的查询值类型如下: 0:默认值,普通查询。 1:AVG、Average,平均值查询。 2:SUM,总和查询。 3:MAX,最大值查询。 4:MIN,最小值查询。 5:COUNT,计数查询。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "in": "body", + "enum": [ + "0", + "1", + "2", + "3", + "4", + "5" + ] + }, + { + "name": "queryTable", + "type": "string", + "required": true, + "description": "查询的对象类型名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "in": "body" + }, + { + "name": "queryCond", + "type": "string", + "required": true, + "description": "查询条件。Json格式的字符串,例如:\"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"3\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\" 说明 当queryType不为0时,queryCond的conditionType参数必须设置为与queryType取值一致的查询条件,否则会导致接口返回错误。 例如:queryType取值为2时,conditionType必须设置为SUM。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573#section18423962213", + "in": "body", + "encodedJson": { + "type": "object", + "properties": [ + { + "name": "queryConditions", + "in": "body", + "type": "array", + "required": true, + "itemsType": "object", + "itemsProperties": [ + { + "name": "conditionType", + "in": "body", + "type": "string", + "required": true + }, + { + "name": "fieldName", + "in": "body", + "type": "string" + }, + { + "name": "value", + "in": "body" + } + ] + } + ] + } + } + ] + } + ] + }, + { + "id": "update-data", + "familyId": "clouddb", + "name": "更新数据", + "description": "该接口用于用户更新数据,支持数据的新增和更新。更新数据时,如果在CloudDBZone已经存在主键值相同的对象,则更新已有的对象;如果不存在,则写入一个新的对象。更新操作需要设置naturalbase_deleted字段为false,具体请参见SchemaField字段设置。", + "method": "POST", + "path": "/agc/apigw/clouddb/clouddbservice/sync/upsert", + "command": "agc clouddb update-data", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "officialSlug": "clouddb-update-data-rest-0000001446287706", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1840608132312", + "in": "header" + }, + { + "name": "_v", + "type": "integer", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1475695062212", + "in": "query", + "enum": [ + "4" + ] + }, + { + "name": "msgInfo", + "type": "object", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "properties": [ + { + "name": "type", + "type": "integer", + "required": true, + "description": "更新请求,入参需为“3”。 “3”:更新数据或删除数据请求。 “5”:查询数据请求。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "in": "body", + "enum": [ + "3" + ] + }, + { + "name": "opStore", + "type": "object", + "required": true, + "description": "JSON字符串。格式为{\"storeName\": \"cloudDBZone\"}。 cloudDBZone为存储区名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1295143742319", + "in": "body", + "properties": [ + { + "name": "storeName", + "in": "body", + "type": "string", + "required": true + } + ] + } + ] + }, + { + "name": "clientInfo", + "type": "object", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "properties": [ + { + "name": "appVer", + "type": "integer", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section10559951122313", + "in": "body" + } + ] + }, + { + "name": "schemas", + "type": "array", + "required": true, + "description": "表对象信息,具体请参见Schema。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "对象类型名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "in": "body" + }, + { + "name": "fs", + "type": "array", + "required": true, + "description": "字段名称。更新字段时,该字段必须属于同一个对象类型,否则会导致更新失败。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section1344310632417", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "字段名。更新操作时必须有如下两个字段,并遵循如下约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 布尔类型的naturalbase_deleted字段:需设置为固定值“false”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "in": "body" + }, + { + "name": "t", + "type": "string", + "required": true, + "description": "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section3658142019245", + "in": "body" + } + ] + } + ] + }, + { + "name": "opData", + "type": "array", + "required": true, + "description": "更新数据对象信息,具体请参见OperatorData。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section621613240231", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "os", + "type": "array", + "required": true, + "description": "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fs", + "type": "array", + "required": true, + "description": "单条对象信息。 说明 更新操作包含naturalbase_deleted的字段固定设置值为false。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section101441056257", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "boolean", + "required": false, + "description": "是否设置为null", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "bl", + "type": "boolean", + "required": false, + "description": "boolean类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "b", + "type": "integer", + "required": false, + "description": "byte类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "st", + "type": "integer", + "required": false, + "description": "short类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "i", + "type": "integer", + "required": false, + "description": "int类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "l", + "type": "integer", + "required": false, + "description": "long类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "f", + "type": "number", + "required": false, + "description": "float类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "d", + "type": "number", + "required": false, + "description": "double类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "ba", + "type": "", + "required": false, + "description": "byteArray类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + }, + { + "name": "s", + "type": "string", + "required": false, + "description": "String类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section153514306256", + "in": "body" + } + ] + } + ], + "maxItems": 1 + }, + { + "name": "t", + "type": "integer", + "required": true, + "description": "更新操作类型,入参为“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706#section090964114246", + "in": "body", + "enum": [ + "1" + ] + } + ] + } + ] + }, + { + "id": "delete-data", + "familyId": "clouddb", + "name": "删除数据", + "description": "该接口用于用户删除数据,根据您传入对象主键删除相应的数据,不会比对该对象其他属性与存储的数据是否一致,删除操作需要设置naturalbase_deleted字段为true,具体请参见SchemaField字段设置。", + "method": "POST", + "path": "/agc/apigw/clouddb/clouddbservice/sync/upsert", + "command": "agc clouddb delete-data", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "officialSlug": "clouddb-delete-data-rest-0000001449956714", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://connect-drcn.dbankcloud.cn", + "authentication": "client-api-token", + "requestContentType": "application/json", + "parameters": [ + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,即获取客户端API授权中的“Client ID”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${authorization_token}”。 authorization_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "access_token", + "type": "string", + "required": false, + "description": "认证凭据。用户登录成功后,在登录接口的响应参数“accessToken”中获取。该值为空时,则表示匿名账号登录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section664671343615", + "in": "header" + }, + { + "name": "_v", + "type": "integer", + "required": true, + "description": "数据版本类型,入参需为“4”表示protobuf v2 版本类型的json字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1664165216352", + "in": "query", + "enum": [ + "4" + ] + }, + { + "name": "msgInfo", + "type": "object", + "required": true, + "description": "消息的基本信息,具体请参见MsgInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "properties": [ + { + "name": "type", + "in": "body", + "type": "integer", + "required": true, + "enum": [ + "3" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714" + }, + { + "name": "opStore", + "in": "body", + "type": "object", + "required": true, + "properties": [ + { + "name": "storeName", + "in": "body", + "type": "string", + "required": true + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714" + } + ] + }, + { + "name": "clientInfo", + "type": "object", + "required": true, + "description": "客户端的基本信息,具体请参见ClientInfo。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "properties": [ + { + "name": "appVer", + "type": "integer", + "required": true, + "description": "对象类型对应的版本号,获取请参考导出对象类型步骤4中的版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section177593293713", + "in": "body" + } + ] + }, + { + "name": "schemas", + "type": "array", + "required": true, + "description": "对象类型信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "对象类型名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "in": "body" + }, + { + "name": "fs", + "type": "array", + "required": true, + "description": "字段名称。删除字段时,该对象必须属于同一个对象类型,且只能传入一个SchemaField。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section18342205718374", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "string", + "required": true, + "description": "字段名。删除操作时必须有如下两个字段,并遵循相关约束: long类型的naturalbase_version字段:该字段不生效,可设置为任意值。 boolean类型的naturalbase_deleted字段:需设置为固定值“true”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "in": "body" + }, + { + "name": "t", + "type": "string", + "required": true, + "description": "字段类型,取值包含如下字段类型: 1:TYPE_BOOLEAN,布尔类型。 2:TYPE_BYTE,byte类型。 3:TYPE_SHORT,short类型。 4:TYPE_INT32,int类型。 5:TYPE_LONG,long类型。 6:TYPE_FLOAT,float类型。 7:TYPE_DOUBLE,double类型。 8:TYPE_BYTE_ARRAY,byte数组类型。 9:TYPE_STRING,String类型。 10:TYPE_DATE,date类型。 11:TYPE_TEXT,文本类型。 12:TYPE_AUTO_INCREMENT_INT,int自增类型。 13:TYPE_AUTO_INCREMENT_LONG,long自增类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section129653168386", + "in": "body" + } + ] + } + ] + }, + { + "name": "opData", + "type": "array", + "required": true, + "description": "更新数据的对象信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1719674619367", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "os", + "type": "array", + "required": true, + "description": "操作对象信息。该对象必须属于同一个对象类型,且仅支持传入一个Field。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "fs", + "type": "array", + "required": true, + "description": "单条对象信息。 说明 删除操作中包含主键、naturalbase_deleted的字段固定设置值为true。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section156861057163820", + "in": "body", + "itemsType": "object", + "itemsProperties": [ + { + "name": "n", + "type": "boolean", + "required": false, + "description": "是否设置为null", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "bl", + "type": "boolean", + "required": false, + "description": "boolean类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "b", + "type": "integer", + "required": false, + "description": "byte类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "st", + "type": "integer", + "required": false, + "description": "short类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "i", + "type": "integer", + "required": false, + "description": "int类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "l", + "type": "integer", + "required": false, + "description": "long类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "f", + "type": "number", + "required": false, + "description": "float类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "d", + "type": "number", + "required": false, + "description": "double类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "ba", + "type": "", + "required": false, + "description": "byteArray类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + }, + { + "name": "s", + "type": "string", + "required": false, + "description": "String类型值", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section1176810453917", + "in": "body" + } + ] + } + ], + "maxItems": 1 + }, + { + "name": "t", + "type": "integer", + "required": true, + "description": "删除操作类型,入参为“1”。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714#section7855744143812", + "in": "body", + "enum": [ + "1" + ] + } + ] + } + ] + }, + { + "id": "upload-file", + "familyId": "storage", + "name": "上传文件", + "description": "此接口用于上传文件。", + "method": "PUT", + "path": "/{bucket_name}/{object_name}", + "command": "agc storage upload-file", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "officialSlug": "storage-restapi-uploadfile-0000001549318457", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "requestContentType": "", + "parameters": [ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-File-Size", + "type": "string", + "required": false, + "description": "文件大小,断点续传时为必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-File-Offset", + "type": "string", + "required": false, + "description": "文件偏移量,断点续传的起始位置非零时为必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Sha256", + "type": "string", + "required": false, + "description": "文件的SHA256值,断点续传时为必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Type", + "type": "string", + "required": false, + "description": "文件类型。 默认值:application/octet-stream", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Disposition", + "type": "string", + "required": false, + "description": "文件打开方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Encoding", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Encoding。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Cache-Control", + "type": "string", + "required": false, + "description": "HTTP标准头部Cache-Control。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Language", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Language。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-meta-*", + "type": "string", + "required": false, + "description": "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头部出现。 X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。例如,您传入的是“X-Agc-meta-test: test metadata”,保存的数据实例为“test: test metadata”。 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "file", + "in": "file", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457" + } + ] + }, + { + "id": "download-file", + "familyId": "storage", + "name": "下载文件", + "description": "此接口用于使用用户身份认证方式下载文件。", + "method": "GET", + "path": "/{bucket_name}/{object_name}", + "command": "agc storage download-file", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "officialSlug": "storage-restapi-getfile-0000001498998530", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "requestContentType": "", + "parameters": [ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "Range", + "type": "string", + "required": false, + "description": "HTTP标准协议头,用于指定第一个字节和最后一个字节的位置,告诉服务器想获取的文件范围。如未指定,则获取整个文件。 例如一个文件有900个字节,其范围为0-899,则: Range: bytes=500- 表示读取该文件的500-899字节。 Range: bytes=500-699 表示读取该文件的500-699字节。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "If-Modified-Since", + "type": "string", + "required": false, + "description": "一个条件式请求首部。 服务器只在所请求的资源在给定的时间之后对内容进行过修改的情况下才会将资源返回,状态码为200 。如果请求的资源在给定的时间之后未经修改,则返回一个不带消息主体的304响应。 格式:, :: GMT 举例:Mon, 10 Apr 2023 07:28:00 GMT 说明 If-Modified-Since只可以用在GET或HEAD请求中。当与If-None-Match 一同出现时,If-Modified-Since会被忽略,除非服务器不支持If-None-Match。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "If-None-Match", + "type": "string", + "required": false, + "description": "一个条件式请求首部。 对于GET和HEAD方法,当且仅当服务器上没有任何资源的ETag属性值与这个首部中列出的相匹配时,服务器端会才返回所请求的资源,响应码为200 ,否则返回304。其他方法暂不实现。 格式:If-None-Match: \"\" 不支持通配符*,不支持弱比较算法。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + } + ] + }, + { + "id": "delete-file", + "familyId": "storage", + "name": "删除文件", + "description": "此接口用于删除文件。", + "method": "DELETE", + "path": "/{bucket_name}/{object_name}", + "command": "agc storage delete-file", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "officialSlug": "storage-restapi-deletefile-0000001549478405", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "requestContentType": "", + "parameters": [ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + } + ] + }, + { + "id": "get-metadata", + "familyId": "storage", + "name": "获取文件元数据", + "description": "此接口用于获取文件元数据。", + "method": "GET", + "path": "/{bucket_name}/{object_name}?metadata=query", + "command": "agc storage get-metadata", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "officialSlug": "storage-restapi-getmetadata-0000001549518573", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "requestContentType": "", + "parameters": [ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + } + ] + }, + { + "id": "update-metadata", + "familyId": "storage", + "name": "修改文件元数据", + "description": "此接口用于修改文件元数据。", + "method": "GET", + "path": "/{bucket_name}/{object_name}?metadata=update", + "command": "agc storage update-metadata", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "officialSlug": "storage-restapi-changemetadata-0000001549198553", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "requestContentType": "", + "parameters": [ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Type", + "type": "string", + "required": false, + "description": "文件类型。 默认值:application/octet-stream", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Disposition", + "type": "string", + "required": false, + "description": "文件打开方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Encoding", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Encoding。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Cache-Control", + "type": "string", + "required": false, + "description": "HTTP标准头部Cache-Control。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Language", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Language。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-meta-*", + "type": "string", + "required": false, + "description": "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头中出现。 示例:X-Agc-meta-test: test metadata 保存实例为:test: test metadata 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。 目录对象不支持自定义元数据,所以此接口不支持目录对象。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + } + ] + }, + { + "id": "list-files", + "familyId": "storage", + "name": "列举文件", + "description": "此接口用于列举文件。", + "method": "GET", + "path": "/{bucket_name}", + "command": "agc storage list-files", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "officialSlug": "storage-restapi-listfile-0000001498518878", + "direction": "developer-to-huawei", + "defaultBaseUrl": "https://ops-server-drcn.agcstorage.link/v0", + "authentication": "server-api-client", + "requestContentType": "", + "parameters": [ + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "max-keys", + "type": "string", + "required": false, + "description": "指定返回文件个数的最大值,默认值为50,取值范围为[1,1000]。 超出范围时,按照默认值进行处理。 如果因为max-keys的设置无法一次完成列举,返回结果会附加NextMarker元素作为下一次列举的marker。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + }, + { + "name": "marker", + "type": "string", + "required": false, + "description": "指定返回哪个标识符之后的文件,按照文件Key的UTF-8字典顺序排序。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + }, + { + "name": "prefix", + "type": "string", + "required": false, + "description": "列举以指定的字符串prefix开头的文件。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + }, + { + "name": "delimiter", + "type": "string", + "required": false, + "description": "将文件名按照特定字符分割的分割符。 注意 当前仅支持传空值或正斜杠(/),正斜杠(/)编码后为%2F。 如果指定了prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从prefix到第一个delimiter之间相同的部分会形成一条CommonPrefixes。 如果未携带prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从文件名开始到第一个delimiter之间相同的部分形成一条CommonPrefixes。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + } + ] + }, + { + "id": "user-id", + "familyId": "templates", + "name": "获取用户ID", + "description": "通过accessToken获取抽奖用户ID,即userId。", + "method": "POST", + "path": "{callbackUrl}", + "command": "agc templates user-id", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838", + "officialSlug": "agc-serverless-comm-api-obtainuserid-0000001260291838", + "direction": "inbound-callback", + "defaultBaseUrl": "", + "authentication": "callback-body", + "requestContentType": "application/json", + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "type": "string", + "required": true, + "description": "Developer HTTPS authentication callback URL", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838" + }, + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "认证凭据。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section128mcpsimp", + "in": "body", + "maxLength": 256 + } + ] + }, + { + "id": "player-id", + "familyId": "templates", + "name": "获取玩家ID", + "description": "通过accessToken获取游戏排行榜的用户ID。", + "method": "POST", + "path": "{callbackUrl}", + "command": "agc templates player-id", + "status": "registered", + "source": "Huawei AppGallery Connect API reference", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276", + "officialSlug": "agc-serverless-get-id-0000001296645276", + "direction": "inbound-callback", + "defaultBaseUrl": "", + "authentication": "callback-body", + "requestContentType": "application/json", + "parameters": [ + { + "name": "callbackUrl", + "in": "path", + "type": "string", + "required": true, + "description": "Developer HTTPS authentication callback URL", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276" + }, + { + "name": "appId", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "in": "body", + "maxLength": 64 + }, + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "玩家ID的认证凭据,来自于您调用函数接口时带的参数值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "in": "body", + "maxLength": 2048 + } + ] + } +] diff --git a/pkg/domain/reference/storage/delete-file.json b/pkg/domain/reference/storage/delete-file.json new file mode 100644 index 0000000..9b7ff1f --- /dev/null +++ b/pkg/domain/reference/storage/delete-file.json @@ -0,0 +1,189 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section111611358426", + "text": "请求示例\nDELETE /v0/testagc-02reg/test6.jpg\nclient_id: 8490337****232064\nproductId: 7364300****4461998\nContent-Type: application/json\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\ncontent-length:" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section4608111864818", + "text": "响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:08:30 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: 2f642104-9b6d-431f-8736-09280fb38ff4\nServer: elb" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-storage-getapicredentials-0000001498508514#section8727185210538", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "title": "下载文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "title": "获取文件元数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section1525581481918", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section15408512141113", + "text": "此接口用于删除文件。" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\n删除文件\n删除文件\n更新时间: 2026-10-22 14:56\n功能介绍\n\n此接口用于删除文件。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS DELETE\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/{bucket_name}/{object_name}\n\n注意\n{bucket_name}为当前存储实例名称,{object_name}为待删除的文件名称。\n{domain}为接口域名。\n中国站点的域名:ops-server-drcn.agcstorage.link/v0\n德国站点的域名:ops-server-dre.agcstorage.link/v0\n新加坡站点的域名:ops-server-dra.agcstorage.link/v0\n俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0\n调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nAuthorization\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\nclient_id\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。\n\n请求示例\nDELETE /v0/testagc-02reg/test6.jpg\nclient_id: 8490337****232064\nproductId: 7364300****4461998\nContent-Type: application/json\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\ncontent-length:\n响应参数\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nstatus\n\n\t\n\nInteger\n\n\t\n\nM\n\n\t\n\nHTTP响应码,200表示成功。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。\n\n响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:08:30 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: 2f642104-9b6d-431f-8736-09280fb38ff4\nServer: elb\n调用示例\nimport lombok.Builder;\nimport lombok.Getter;\nimport lombok.extern.slf4j.Slf4j;\n\n\nimport org.apache.http.HttpStatus;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpDelete;\nimport org.apache.http.client.utils.URIBuilder;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\nimport org.junit.Ignore;\n\n\n/**\n * 删除文件REST API示例代码\n */\n@Slf4j\npublic class DeleteObjectTest {\n /**\n * 删除文件\n * 如果业务需要批量删除文件,则需要for循环调用deleteObject方法\n *\n * @param storageUrl 云存储url\n * @param param 删除文件接口入参\n * @throws Exception 异常\n */\n public static void deleteObject(String storageUrl, DeleteObjectParam param) throws Exception {\n URIBuilder uriBuilder = new URIBuilder(storageUrl + param.getBucketName() + \"/\" + param.getObjectName());\n HttpDelete httpDelete = new HttpDelete(uriBuilder.build());\n httpDelete.setHeader(\"productId\", param.getProjectId());\n httpDelete.setHeader(\"client_id\", param.getClientId());\n httpDelete.setHeader(\"Authorization\", \"Bearer \" + param.getToken());\n CloseableHttpClient httpClient = HttpClients.createDefault();\n CloseableHttpResponse httpResponse = httpClient.execute(httpDelete);\n int statusCode = httpResponse.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n log.info(\"Delete success\");\n } else {\n log.error(\"Delete failed, errorCode:{}\", statusCode);\n }\n }\n\n\n public void client() throws Exception {\n\n\n String clientToken = TokenServiceTest.getToken(\"https://connect-api.cloud.huawei.com/api/\", \"84903XXXXXX32064\",\n \"00E5CCADB655891XXXXXXXXXXXX8CDCC83ACF22\");\n DeleteObjectParam param = DeleteObjectParam.builder()\n .projectId(\"73643XXXXXX61998\")\n .clientId(\"84903XXXXXX32064\")\n .token(clientToken)\n .bucketName(\"test-q36q0\")\n .objectName(\"temp/hello.txt\")\n .build();\n deleteObject(\"https://ops-server-drcn.agcstorage.link/v0/\", param);\n }\n\n\n public static void main(String[] args) throws Exception {\n ConstantsTest.preCheck();\n new DeleteObjectTest().client();\n }\n\n\n @Builder\n @Getter\n static class DeleteObjectParam {\n // 项目ID\n String projectId;\n\n\n // 客户端ID\n String clientId;\n\n\n // clientToken\n String token;\n\n\n // 云存储实例名\n String bucketName;\n\n\n // 待删除的文件名,需要携带路径\n String objectName;\n }\n}\n下载文件\n获取文件元数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nHeader\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器->华为服务器" + ], + [ + "接口URL", + "https://{domain}/{bucket_name}/{object_name} 注意 {bucket_name}为当前存储实例名称,{object_name}为待删除的文件名称。 {domain}为接口域名。 中国站点的域名:ops-server-drcn.agcstorage.link/v0 德国站点的域名:ops-server-dre.agcstorage.link/v0 新加坡站点的域名:ops-server-dra.agcstorage.link/v0 俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0 调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17667171510253" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "Authorization", + "String", + "M", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "client_id", + "String", + "M", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "String", + "M", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169" + }, + { + "location": "", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "status", + "Integer", + "M", + "HTTP响应码,200表示成功。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section1787523414439" + } + ], + "title": "删除文件", + "updatedAt": "2026-10-22 14:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/storage/delete-file.parameters.json b/pkg/domain/reference/storage/delete-file.parameters.json new file mode 100644 index 0000000..248ea56 --- /dev/null +++ b/pkg/domain/reference/storage/delete-file.parameters.json @@ -0,0 +1,50 @@ +[ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405#section17216134314169", + "in": "header" + } +] diff --git a/pkg/domain/reference/storage/delete-file.rules.json b/pkg/domain/reference/storage/delete-file.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/storage/delete-file.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/storage/download-file.json b/pkg/domain/reference/storage/download-file.json new file mode 100644 index 0000000..fb02a77 --- /dev/null +++ b/pkg/domain/reference/storage/download-file.json @@ -0,0 +1,225 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section111611358426", + "text": "请求示例\nGET /v0/testagc-02reg/test3.jpg\nclient_id: 8490****0232064\nproductId: 7364****4461998\nContent-Type: application/json\nX-Agc-Trace-Id: 123456789\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section4608111864818", + "text": "响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:14:08 GMT\nContent-Type: image/jpeg\nContent-Length: 2536\nConnection: keep-alive\nAccept-Ranges: bytes\nETag: \"d0f320face7****d0fb80498add\"\nLast-Modified: Tue, 30 Aug 2022 06:14:35 GMT\nX-Agc-Trace-Id: 123456789\nX-Agc-server-side-encryption: AES256\nContent-Disposition: attachment;filename=\"test3.jpg\"\nServer: elb" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-storage-getapicredentials-0000001498508514#section8727185210538", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "title": "删除文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section489173017181", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section15408512141113", + "text": "此接口用于使用用户身份认证方式下载文件。" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\n下载文件\n下载文件\n更新时间: 2026-10-22 14:56\n功能介绍\n\n此接口用于使用用户身份认证方式下载文件。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS GET\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/{bucket_name}/{object_name}\n\n注意\n{bucket_name}为当前存储实例名称,{object_name}为需获取的文件名称。\n{domain}为接口域名。\n中国站点的域名:ops-server-drcn.agcstorage.link/v0\n德国站点的域名:ops-server-dre.agcstorage.link/v0\n新加坡站点的域名:ops-server-dra.agcstorage.link/v0\n俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0\n调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nAuthorization\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\nclient_id\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nRange\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准协议头,用于指定第一个字节和最后一个字节的位置,告诉服务器想获取的文件范围。如未指定,则获取整个文件。\n\n例如一个文件有900个字节,其范围为0-899,则:\n\nRange: bytes=500- 表示读取该文件的500-899字节。\n\nRange: bytes=500-699 表示读取该文件的500-699字节。\n\n\n\n\nIf-Modified-Since\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n一个条件式请求首部。\n\n服务器只在所请求的资源在给定的时间之后对内容进行过修改的情况下才会将资源返回,状态码为200 。如果请求的资源在给定的时间之后未经修改,则返回一个不带消息主体的304响应。\n\n格式:, :: GMT\n\n举例:Mon, 10 Apr 2023 07:28:00 GMT\n\n说明\n\nIf-Modified-Since只可以用在GET或HEAD请求中。当与If-None-Match 一同出现时,If-Modified-Since会被忽略,除非服务器不支持If-None-Match。\n\n\n\n\nIf-None-Match\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n一个条件式请求首部。\n\n对于GET和HEAD方法,当且仅当服务器上没有任何资源的ETag属性值与这个首部中列出的相匹配时,服务器端会才返回所请求的资源,响应码为200 ,否则返回304。其他方法暂不实现。\n\n格式:If-None-Match: \"\"\n\n不支持通配符*,不支持弱比较算法。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。\n\n请求示例\nGET /v0/testagc-02reg/test3.jpg\nclient_id: 8490****0232064\nproductId: 7364****4461998\nContent-Type: application/json\nX-Agc-Trace-Id: 123456789\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\n响应参数\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nstatus\n\n\t\n\nInteger\n\n\t\n\nM\n\n\t\n\nHTTP响应码,200表示成功。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。\n\n\n\n\nLast-Modified\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件的最近修改时间,配合If-Modified-Since使用。\n\n格式:, :: GMT\n\n举例:Wed, 21 Oct 2015 07:28:00 GMT\n\n\n\n\nEtag\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准Header,配合If-None-Match使用。\n\n格式:\"\"\n\n举例:\"33a64df551425fcc55e4d42a148795d9f25f89d4\"\n\n\n\n\nCache-Control\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准Header,通过指定指令来实现缓存机制。\n\n响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:14:08 GMT\nContent-Type: image/jpeg\nContent-Length: 2536\nConnection: keep-alive\nAccept-Ranges: bytes\nETag: \"d0f320face7****d0fb80498add\"\nLast-Modified: Tue, 30 Aug 2022 06:14:35 GMT\nX-Agc-Trace-Id: 123456789\nX-Agc-server-side-encryption: AES256\nContent-Disposition: attachment;filename=\"test3.jpg\"\nServer: elb\n调用示例\nimport lombok.Builder;\nimport lombok.Getter;\n\n\nimport org.apache.http.HttpStatus;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.client.utils.URIBuilder;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\nimport org.junit.Ignore;\n\n\nimport java.io.FileOutputStream;\nimport java.io.InputStream;\n\n\n/**\n * 功能描述 下载文件 restapi 示例代码\n */\n@Ignore\npublic class DownloadObjectTest {\n /**\n * 下载文件\n *\n * @param storageUrl 云存储url\n * @param param 下载文件接口入参\n * @throws Exception 异常\n */\n public static void download(String storageUrl, DownloadObjectParam param) throws Exception {\n URIBuilder uriBuilder = new URIBuilder(storageUrl + param.getBucketName() + \"/\" + param.getObjectName());\n HttpGet get = new HttpGet(uriBuilder.build());\n get.setHeader(\"productId\", param.getProjectId());\n get.setHeader(\"client_id\", param.getClientId());\n get.setHeader(\"Authorization\", \"Bearer \" + param.getToken());\n CloseableHttpClient httpClient = HttpClients.createDefault();\n CloseableHttpResponse httpResponse = httpClient.execute(get);\n int statusCode = httpResponse.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n try (InputStream inputStream = httpResponse.getEntity().getContent();\n FileOutputStream outputStream = new FileOutputStream(getFileName(param.getObjectName()))) {\n // 将响应的实体流写入到本地文件,业务实际应用时,需要将FileOutputStream的入参改成业务指定的目录下\n byte[] buffer = new byte[1024];\n int len;\n while ((len = inputStream.read(buffer)) > 0) {\n outputStream.write(buffer, 0, len);\n }\n outputStream.flush();\n }\n }\n httpResponse.close();\n }\n\n\n /**\n * 获取文件名\n *\n * @param objectName 文件名(包含路径)\n * @return 不含路径的文件名\n */\n private static String getFileName(String objectName) {\n int index = objectName.lastIndexOf(\"/\");\n return (-1 == index) ? objectName : objectName.substring(index);\n }\n\n\n public void client() throws Exception {\n String clientToken = TokenServiceTest.getToken(\"https://connect-api.cloud.huawei.com/api/\", \"84903XXXXXX32064\",\n \"00E5CCADB655891XXXXXXXXXXXX8CDCC83ACF22\");\n DownloadObjectParam param = DownloadObjectParam.builder()\n .projectId(\"73643XXXXXX61998\")\n .clientId(\"84903XXXXXX32064\")\n .token(clientToken)\n .bucketName(\"test-q36q0\")\n .objectName(\"test3.jpg\")\n .build();\n\n\n download(\"https://ops-server-drcn.agcstorage.link/v0/\", param);\n }\n\n\n public static void main(String[] args) throws Exception {\n new DownloadObjectTest().client();\n }\n\n\n @Builder\n @Getter\n static class DownloadObjectParam {\n // 项目ID\n String projectId;\n\n\n // 客户端ID\n String clientId;\n\n\n // clientToken\n String token;\n\n\n // 云存储实例名\n String bucketName;\n\n\n // 待下载的文件名,需要携带路径\n String objectName;\n }\n}\n上传文件\n删除文件\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nHeader\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->华为服务器" + ], + [ + "接口URL", + "https://{domain}/{bucket_name}/{object_name} 注意 {bucket_name}为当前存储实例名称,{object_name}为需获取的文件名称。 {domain}为接口域名。 中国站点的域名:ops-server-drcn.agcstorage.link/v0 德国站点的域名:ops-server-dre.agcstorage.link/v0 新加坡站点的域名:ops-server-dra.agcstorage.link/v0 俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0 调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17667171510253" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "Authorization", + "String", + "M", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "client_id", + "String", + "M", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "String", + "M", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "Range", + "String", + "O", + "HTTP标准协议头,用于指定第一个字节和最后一个字节的位置,告诉服务器想获取的文件范围。如未指定,则获取整个文件。 例如一个文件有900个字节,其范围为0-899,则: Range: bytes=500- 表示读取该文件的500-899字节。 Range: bytes=500-699 表示读取该文件的500-699字节。" + ], + [ + "If-Modified-Since", + "String", + "O", + "一个条件式请求首部。 服务器只在所请求的资源在给定的时间之后对内容进行过修改的情况下才会将资源返回,状态码为200 。如果请求的资源在给定的时间之后未经修改,则返回一个不带消息主体的304响应。 格式:, :: GMT 举例:Mon, 10 Apr 2023 07:28:00 GMT 说明 If-Modified-Since只可以用在GET或HEAD请求中。当与If-None-Match 一同出现时,If-Modified-Since会被忽略,除非服务器不支持If-None-Match。" + ], + [ + "If-None-Match", + "String", + "O", + "一个条件式请求首部。 对于GET和HEAD方法,当且仅当服务器上没有任何资源的ETag属性值与这个首部中列出的相匹配时,服务器端会才返回所请求的资源,响应码为200 ,否则返回304。其他方法暂不实现。 格式:If-None-Match: \"\" 不支持通配符*,不支持弱比较算法。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169" + }, + { + "location": "", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "status", + "Integer", + "M", + "HTTP响应码,200表示成功。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。" + ], + [ + "Last-Modified", + "String", + "O", + "文件的最近修改时间,配合If-Modified-Since使用。 格式:, :: GMT 举例:Wed, 21 Oct 2015 07:28:00 GMT" + ], + [ + "Etag", + "String", + "O", + "HTTP标准Header,配合If-None-Match使用。 格式:\"\" 举例:\"33a64df551425fcc55e4d42a148795d9f25f89d4\"" + ], + [ + "Cache-Control", + "String", + "O", + "HTTP标准Header,通过指定指令来实现缓存机制。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section1787523414439" + } + ], + "title": "下载文件", + "updatedAt": "2026-10-22 14:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/storage/download-file.parameters.json b/pkg/domain/reference/storage/download-file.parameters.json new file mode 100644 index 0000000..74eab43 --- /dev/null +++ b/pkg/domain/reference/storage/download-file.parameters.json @@ -0,0 +1,74 @@ +[ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "Range", + "type": "string", + "required": false, + "description": "HTTP标准协议头,用于指定第一个字节和最后一个字节的位置,告诉服务器想获取的文件范围。如未指定,则获取整个文件。 例如一个文件有900个字节,其范围为0-899,则: Range: bytes=500- 表示读取该文件的500-899字节。 Range: bytes=500-699 表示读取该文件的500-699字节。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "If-Modified-Since", + "type": "string", + "required": false, + "description": "一个条件式请求首部。 服务器只在所请求的资源在给定的时间之后对内容进行过修改的情况下才会将资源返回,状态码为200 。如果请求的资源在给定的时间之后未经修改,则返回一个不带消息主体的304响应。 格式:, :: GMT 举例:Mon, 10 Apr 2023 07:28:00 GMT 说明 If-Modified-Since只可以用在GET或HEAD请求中。当与If-None-Match 一同出现时,If-Modified-Since会被忽略,除非服务器不支持If-None-Match。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "If-None-Match", + "type": "string", + "required": false, + "description": "一个条件式请求首部。 对于GET和HEAD方法,当且仅当服务器上没有任何资源的ETag属性值与这个首部中列出的相匹配时,服务器端会才返回所请求的资源,响应码为200 ,否则返回304。其他方法暂不实现。 格式:If-None-Match: \"\" 不支持通配符*,不支持弱比较算法。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530#section17216134314169", + "in": "header" + } +] diff --git a/pkg/domain/reference/storage/download-file.rules.json b/pkg/domain/reference/storage/download-file.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/storage/download-file.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/storage/get-metadata.json b/pkg/domain/reference/storage/get-metadata.json new file mode 100644 index 0000000..3bfa055 --- /dev/null +++ b/pkg/domain/reference/storage/get-metadata.json @@ -0,0 +1,306 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section111611358426", + "text": "请求示例\nGET /v0/testagc-02reg/test.jpg\nclient_id: 849033****232064\nproductId: 73643****61998\nContent-Type: application/json\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section4608111864818", + "text": "响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:01:32 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: 98b5dbf2-d7ad-4c13-9858-c829480cf3ba\nServer: elb\n{\"name\":\"test.jpg\",\"metadata\":{},\"createTime\":\"2022-12-10T10:13:46Z\",\"updateTime\":\"2022-12-10T10:13:46Z\",\"storageArea\":\"CN\",\"size\":29797,\"storageRegion\":\"cn-north-4\",\"productId\":\"736430****1998\",\"storageType\":\"STANDARD\",\"bucket\":\"testagc-02reg\",\"contentType\":\"image\\/jpeg\"}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-storage-getapicredentials-0000001498508514#section8727185210538", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "title": "删除文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "title": "修改文件元数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section15416103225912", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section68100472599", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section778723271920", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section15408512141113", + "text": "此接口用于获取文件元数据。" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\n获取文件元数据\n获取文件元数据\n更新时间: 2026-10-22 14:56\n功能介绍\n\n此接口用于获取文件元数据。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS GET\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/{bucket_name}/{object_name}?metadata=query\n\n注意\n{bucket_name}为当前存储实例名称,{object_name}为文件名称。\n{domain}为接口域名。\n中国站点的域名:ops-server-drcn.agcstorage.link/v0\n德国站点的域名:ops-server-dre.agcstorage.link/v0\n新加坡站点的域名:ops-server-dra.agcstorage.link/v0\n俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0\n调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nAuthorization\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\nclient_id\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。\n\n请求示例\nGET /v0/testagc-02reg/test.jpg\nclient_id: 849033****232064\nproductId: 73643****61998\nContent-Type: application/json\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\n响应参数\nHeader\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nstatus\n\n\t\n\nInteger\n\n\t\n\nM\n\n\t\n\nHTTP响应码,200表示成功。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。\n\nBody\n\n属性\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID。\n\n\n\n\nname\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件名称。\n\n\n\n\nbucket\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储实例名称。\n\n\n\n\nstorageArea\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储区域名称。\n\n\n\n\nstorageRegion\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n后端OBS存储站点。\n\n\n\n\nstorageType\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储类型。\n\n\n\n\ncontentType\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件类型。Content-Type标头告诉客户端实际返回的内容类型。\n\n\n\n\ncontentDisposition\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件打开方式,响应头指示回复的内容该以何种形式展示,是以内联的形式(即网页的一部分),还是以附件的形式下载并保存到本地。\n\n\n\n\ncacheControl\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n标准HTTP请求头字段Cache-Control。\n\npublic:文件可缓存到任何位置。\nprivate:文件可以缓存到请求者的本地缓存中。\nno-cache:文件可以缓存,但有请求发出时,缓存会将此请求发到服务器,服务器验证请求中所描述的缓存是否过期,若未过期,返回304,缓存可使用,否则不可使用。\nno-store:缓存中不得存储任何关于客户端请求和服务端响应的内容。\nmax-age=TIME_IN_SECONDS:文件可缓存的时长。\n\n\n\ncontentEncoding\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n标准HTTP请求头Content-Encoding,是一个实体消息首部,用于对特定媒体类型的数据进行压缩。当这个首部出现的时候,它的值表示消息主体进行了何种方式的内容编码转换。\n\n\n\n\ncontentLanguage\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n标准HTTP请求头 Content-Language,用来说明访问者希望采用的语言或语言组合,这样的话用户就可以根据自己偏好的语言来定制不同的内容。\n\n\n\n\nsha256\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件SHA256值。\n\n\n\n\nsize\n\n\t\n\nlong\n\n\t\n\nM\n\n\t\n\n文件大小。\n\n\n\n\ncreateTime\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。\n\n\n\n\nupdateTime\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。\n\n\n\n\nmetadata\n\n\t\n\nMap\n\n\t\n\nO\n\n\t\n\n元数据,用户自定义元数据。\n\n响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:01:32 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: 98b5dbf2-d7ad-4c13-9858-c829480cf3ba\nServer: elb\n{\"name\":\"test.jpg\",\"metadata\":{},\"createTime\":\"2022-12-10T10:13:46Z\",\"updateTime\":\"2022-12-10T10:13:46Z\",\"storageArea\":\"CN\",\"size\":29797,\"storageRegion\":\"cn-north-4\",\"productId\":\"736430****1998\",\"storageType\":\"STANDARD\",\"bucket\":\"testagc-02reg\",\"contentType\":\"image\\/jpeg\"}\n调用示例\nimport com.alibaba.fastjson.JSON;\nimport com.alibaba.fastjson.JSONObject;\n\n\nimport lombok.Builder;\nimport lombok.Getter;\nimport lombok.Setter;\nimport lombok.ToString;\nimport lombok.extern.slf4j.Slf4j;\n\n\nimport org.apache.commons.collections4.MapUtils;\nimport org.apache.http.Consts;\nimport org.apache.http.HttpStatus;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.client.utils.URIBuilder;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\nimport org.junit.Ignore;\n\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.HashMap;\nimport java.util.Map;\n\n\n/**\n * 元数据管理REST API示例代码\n */\n@Slf4j\npublic class MetadataManagingTest {\n\n\n /**\n * 查询元数据信息\n *\n * @param storageUrl 云存储url\n * @param param 查询元数据接口入参\n * @return 元数据信息\n * @throws Exception 异常\n */\n public static ObjectMetadata getObjectMetadata(String storageUrl, ObjectMetadataParam param) throws Exception {\n URIBuilder uriBuilder =\n new URIBuilder(storageUrl + param.getBucketName() + \"/\" + param.getObjectName() + \"?metadata=query\");\n HttpGet get = new HttpGet(uriBuilder.build());\n get.setHeader(\"productId\", param.getProjectId());\n get.setHeader(\"client_id\", param.getClientId());\n get.setHeader(\"Authorization\", \"Bearer \" + param.getToken());\n\n\n CloseableHttpClient httpClient = HttpClients.createDefault();\n CloseableHttpResponse httpResponse = httpClient.execute(get);\n int statusCode = httpResponse.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n log.info(\"getObjectMetadata result:{}\", object.toJSONString());\n return JSONObject.toJavaObject(object, ObjectMetadata.class);\n } else {\n log.error(\"getObjectMetadata error, statusCode:{}\", statusCode);\n return null;\n }\n }\n\n\n public void client() throws Exception {\n String clientToken = TokenServiceTest.getToken(\"https://connect-api.cloud.huawei.com/api/\", \"84903XXXXXX32064\",\n \"00E5CCADB655891XXXXXXXXXXXX8CDCC83ACF22\");\n ObjectMetadataParam param = ObjectMetadataParam.builder()\n .projectId(\"73643XXXXXX61998\")\n .clientId(\"84903XXXXXX32064\")\n .token(clientToken)\n .bucketName(\"test-q36q0\")\n .objectName(\"sha256/test3.jpg\")\n .build();\n getObjectMetadata(\"https://ops-server-drcn.agcstorage.link/v0/\", param);\n }\n\n\n public static void main(String[] args) throws Exception {\n new MetadataManagingTest().client();\n }\n\n\n @Builder\n @Getter\n static class ObjectMetadataParam {\n // 项目ID\n String projectId;\n\n\n // 客户端ID\n String clientId;\n\n\n // clientToken\n String token;\n\n\n // 云存储实例名\n String bucketName;\n\n\n // 待下载的文件的对象名,需要携带路径。\n String objectName;\n\n\n Map metadata;\n }\n\n\n /**\n * 文件的元数据\n */\n @Getter\n @Setter\n @ToString\n static class ObjectMetadata {\n // 项目Id\n private String productId;\n\n\n // 存储的实例名\n private String bucket;\n\n\n // 存储的区域\n private String storageArea;\n\n\n // 后端OBS存储站点\n private String storageRegion;\n\n\n // 存储的类型\n private String storageType;\n\n\n // 文件名\n private String name;\n\n\n // 文件类型\n private String contentType;\n\n\n // 上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ\n private String createTime;\n\n\n // 更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ\n private String updateTime;\n\n\n // 文件大小\n private long size;\n\n\n // 可选,元数据,用户自定义元数据\n private Map metadata;\n\n\n // 可选,标准HTTP请求头Content-Language\n private String contentLanguage;\n\n\n // 可选,标准HTTP请求头Content-Encoding\n private String contentEncoding;\n\n\n // 可选,标准HTTP请求头Cache-Control\n private String cacheControl;\n\n\n // 可选,文件打开方式\n private String contentDisposition;\n }\n}\n删除文件\n修改文件元数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nHeader\n请求示例\n响应参数\nHeader\nBody\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->华为服务器" + ], + [ + "接口URL", + "https://{domain}/{bucket_name}/{object_name}?metadata=query 注意 {bucket_name}为当前存储实例名称,{object_name}为文件名称。 {domain}为接口域名。 中国站点的域名:ops-server-drcn.agcstorage.link/v0 德国站点的域名:ops-server-dre.agcstorage.link/v0 新加坡站点的域名:ops-server-dra.agcstorage.link/v0 俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0 调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17667171510253" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "Authorization", + "String", + "M", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "client_id", + "String", + "M", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "String", + "M", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "status", + "Integer", + "M", + "HTTP响应码,200表示成功。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section15416103225912" + }, + { + "location": "body", + "rows": [ + [ + "属性", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "productId", + "String", + "M", + "项目ID。" + ], + [ + "name", + "String", + "M", + "文件名称。" + ], + [ + "bucket", + "String", + "M", + "存储实例名称。" + ], + [ + "storageArea", + "String", + "M", + "存储区域名称。" + ], + [ + "storageRegion", + "String", + "M", + "后端OBS存储站点。" + ], + [ + "storageType", + "String", + "M", + "存储类型。" + ], + [ + "contentType", + "String", + "M", + "文件类型。Content-Type标头告诉客户端实际返回的内容类型。" + ], + [ + "contentDisposition", + "String", + "O", + "文件打开方式,响应头指示回复的内容该以何种形式展示,是以内联的形式(即网页的一部分),还是以附件的形式下载并保存到本地。" + ], + [ + "cacheControl", + "String", + "O", + "标准HTTP请求头字段Cache-Control。 public:文件可缓存到任何位置。 private:文件可以缓存到请求者的本地缓存中。 no-cache:文件可以缓存,但有请求发出时,缓存会将此请求发到服务器,服务器验证请求中所描述的缓存是否过期,若未过期,返回304,缓存可使用,否则不可使用。 no-store:缓存中不得存储任何关于客户端请求和服务端响应的内容。 max-age=TIME_IN_SECONDS:文件可缓存的时长。" + ], + [ + "contentEncoding", + "String", + "O", + "标准HTTP请求头Content-Encoding,是一个实体消息首部,用于对特定媒体类型的数据进行压缩。当这个首部出现的时候,它的值表示消息主体进行了何种方式的内容编码转换。" + ], + [ + "contentLanguage", + "String", + "O", + "标准HTTP请求头 Content-Language,用来说明访问者希望采用的语言或语言组合,这样的话用户就可以根据自己偏好的语言来定制不同的内容。" + ], + [ + "sha256", + "String", + "O", + "文件SHA256值。" + ], + [ + "size", + "long", + "M", + "文件大小。" + ], + [ + "createTime", + "String", + "M", + "上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。" + ], + [ + "updateTime", + "String", + "M", + "更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。" + ], + [ + "metadata", + "Map", + "O", + "元数据,用户自定义元数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section68100472599" + } + ], + "title": "获取文件元数据", + "updatedAt": "2026-10-22 14:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/storage/get-metadata.parameters.json b/pkg/domain/reference/storage/get-metadata.parameters.json new file mode 100644 index 0000000..cbc647b --- /dev/null +++ b/pkg/domain/reference/storage/get-metadata.parameters.json @@ -0,0 +1,50 @@ +[ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573#section17216134314169", + "in": "header" + } +] diff --git a/pkg/domain/reference/storage/get-metadata.rules.json b/pkg/domain/reference/storage/get-metadata.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/storage/get-metadata.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/storage/list-files.json b/pkg/domain/reference/storage/list-files.json new file mode 100644 index 0000000..1086ecc --- /dev/null +++ b/pkg/domain/reference/storage/list-files.json @@ -0,0 +1,340 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section111611358426", + "text": "请求示例\nGET /v0/testagc-02reg\nclient_id: 8490337****232064\nproductId: 736430****461998\nContent-Type: application/json\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section4608111864818", + "text": "响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 02:54:59 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: b1615584-3926-4cdc-9ae0-345e72efca77\nServer: elb\n{\"contents\":[{\"size\":\"92736\",\"lastModified\":\"2022-03-14T03:07:20Z\",\"key\":\"2.png\",\"contentType\":\"image/png\"}],\"bucket\":\"testagc-02reg\",\"isTruncated\":false,\"productId\":\"736430****461998\"}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-storage-getapicredentials-0000001498508514#section8727185210538", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#ZH-CN_TOPIC_0000002757145029__p086973141111", + "title": "Content" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#ZH-CN_TOPIC_0000002757145029__p183512474399", + "title": "CommonPrefix" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "title": "修改文件元数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-datatypes-0000001498678718", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section1969112552197", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section15408512141113", + "text": "此接口用于列举文件。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section1787523414439", + "text": "Content" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section1787523414439", + "text": "CommonPrefix" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\n列举文件\n列举文件\n更新时间: 2026-10-22 14:56\n功能介绍\n\n此接口用于列举文件。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS GET\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/{bucket_name}\n\n注意\n{bucket_name}为当前存储实例名称。\n{domain}为接口域名。\n中国站点的域名:ops-server-drcn.agcstorage.link/v0\n德国站点的域名:ops-server-dre.agcstorage.link/v0\n新加坡站点的域名:ops-server-dra.agcstorage.link/v0\n俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0\n调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nclient_id\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nAuthorization\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。\n\nQuery\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nmax-keys\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n指定返回文件个数的最大值,默认值为50,取值范围为[1,1000]。\n\n超出范围时,按照默认值进行处理。\n\n如果因为max-keys的设置无法一次完成列举,返回结果会附加NextMarker元素作为下一次列举的marker。\n\n\n\n\nmarker\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n指定返回哪个标识符之后的文件,按照文件Key的UTF-8字典顺序排序。\n\n\n\n\nprefix\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n列举以指定的字符串prefix开头的文件。\n\n\n\n\ndelimiter\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n将文件名按照特定字符分割的分割符。\n\n注意\n\n当前仅支持传空值或正斜杠(/),正斜杠(/)编码后为%2F。\n\n如果指定了prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从prefix到第一个delimiter之间相同的部分会形成一条CommonPrefixes。\n如果未携带prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从文件名开始到第一个delimiter之间相同的部分形成一条CommonPrefixes。\n请求示例\nGET /v0/testagc-02reg\nclient_id: 8490337****232064\nproductId: 736430****461998\nContent-Type: application/json\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\n响应参数\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nstatus\n\n\t\n\nInteger\n\n\t\n\nM\n\n\t\n\nHTTP响应码,200表示成功。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID。\n\n\n\n\nbucket\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储实例名称。\n\n\n\n\nnextMarker\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n如果本次没有返回全部结果,响应请求中将包含此字段,用于标明本次请求列举到的最后一个文件。后续请求可以指定Marker等于该值来列举剩余的文件。\n\n\n\n\nisTruncated\n\n\t\n\nBoolean\n\n\t\n\nM\n\n\t\n\n表明是否本次返回的ListBucketResult结果列表被截断。\n\ntrue:表示本次没有返回全部结果。\nfalse:表示本次已经返回了全部结果。\n\n\n\ncontents\n\n\t\n\nContent[]\n\n\t\n\nM\n\n\t\n\n存储实例中的文件列表。\n\n\n\n\ncontentType\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件类型,告诉客户端实际返回内容的类型。\n\n\n\n\ncommonPrefixes\n\n\t\n\nCommonPrefix[]\n\n\t\n\nO\n\n\t\n\n请求中带delimiter参数时返回的CommonPrefixes分组信息。\n\nContent\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nkey\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件名\n\n\n\n\nsize\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件大小\n\n\n\n\nlastModified\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件最后修改时间\n\nCommonPrefix\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nprefix\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n请求中带delimiter参数时返回的分组信息前缀\n\n响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 02:54:59 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: b1615584-3926-4cdc-9ae0-345e72efca77\nServer: elb\n{\"contents\":[{\"size\":\"92736\",\"lastModified\":\"2022-03-14T03:07:20Z\",\"key\":\"2.png\",\"contentType\":\"image/png\"}],\"bucket\":\"testagc-02reg\",\"isTruncated\":false,\"productId\":\"736430****461998\"}\n调用示例\nimport com.alibaba.fastjson.JSON;\nimport com.alibaba.fastjson.JSONObject;\n\n\nimport lombok.Builder;\nimport lombok.Getter;\nimport lombok.extern.slf4j.Slf4j;\n\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.http.Consts;\nimport org.apache.http.HttpStatus;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.client.utils.URIBuilder;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\n\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\n\n/**\n * 列举文件REST API示例代码\n */\n@Slf4j\npublic class ListObjectTest {\n /**\n * @param param 列举文件接口入参\n */\n public static void listObjects(String storageUrl, ListObjectsParam param) {\n try {\n URIBuilder uriBuilder = new URIBuilder(storageUrl + param.getBucketName());\n if (StringUtils.isNotEmpty(param.getPrefix())) {\n uriBuilder.addParameter(\"prefix\", param.getPrefix());\n }\n if (StringUtils.isNotEmpty(param.getMaxKeys())) {\n uriBuilder.addParameter(\"max-keys\", param.getMaxKeys());\n }\n if (StringUtils.isNotEmpty(param.getMarker())) {\n uriBuilder.addParameter(\"marker\", param.getMarker());\n }\n\n\n HttpGet get = new HttpGet(uriBuilder.build());\n get.setHeader(\"productId\", param.getProjectId());\n get.setHeader(\"client_id\", param.getClientId());\n get.setHeader(\"Authorization\", \"Bearer \" + param.getToken());\n\n\n CloseableHttpClient httpClient = HttpClients.createDefault();\n CloseableHttpResponse httpResponse = httpClient.execute(get);\n int statusCode = httpResponse.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n\n\n JSONObject object = JSON.parseObject(result);\n log.info(\"listObjects result:{}\", object.toJSONString());\n }\n } catch (Exception e) {\n log.error(\"listObjects exception:\", e);\n }\n }\n\n\n public static void main(String[] args) {\n ConstantsTest.preCheck();\n\n\n String clientToken = TokenServiceTest.getToken(\"https://connect-api.cloud.huawei.com/api/\", \"84903XXXXXX32064\",\n \"00E5CCADB655891XXXXXXXXXXXX8CDCC83ACF22\");\n ListObjectsParam mirrorParam = ListObjectsParam.builder()\n .projectId(\"73643XXXXXX61998\")\n .clientId(\"84903XXXXXX32064\")\n .token(clientToken)\n .bucketName(\"test-q36q0\")\n .prefix(\"temp\")\n .marker(\"\")\n .maxKeys(\"\")\n .build();\n\n\n listObjects(\"https://ops-server-drcn.agcstorage.link/v0/\", mirrorParam);\n }\n\n\n @Builder\n @Getter\n static class ListObjectsParam {\n // 项目ID\n String projectId;\n\n\n // 客户端ID\n String clientId;\n\n\n // clientToken\n String token;\n\n\n // 云存储实例名\n String bucketName;\n\n\n // 列举以指定的字符串prefix开头的文件\n String prefix;\n\n\n // 指定返回文件个数的最大值,默认50,取值范围为[1,1000]\n String maxKeys;\n\n\n // 指定返回哪个标识符之后的文件,按照文件Key的UTF-8字典顺序排序\n String marker;\n }\n}\n修改文件元数据\n数据类型\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nHeader\nQuery\n请求示例\n响应参数\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->华为服务器" + ], + [ + "接口URL", + "https://{domain}/{bucket_name} 注意 {bucket_name}为当前存储实例名称。 {domain}为接口域名。 中国站点的域名:ops-server-drcn.agcstorage.link/v0 德国站点的域名:ops-server-dre.agcstorage.link/v0 新加坡站点的域名:ops-server-dra.agcstorage.link/v0 俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0 调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17667171510253" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "client_id", + "String", + "M", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "String", + "M", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "Authorization", + "String", + "M", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169" + }, + { + "location": "query", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "max-keys", + "String", + "O", + "指定返回文件个数的最大值,默认值为50,取值范围为[1,1000]。 超出范围时,按照默认值进行处理。 如果因为max-keys的设置无法一次完成列举,返回结果会附加NextMarker元素作为下一次列举的marker。" + ], + [ + "marker", + "String", + "O", + "指定返回哪个标识符之后的文件,按照文件Key的UTF-8字典顺序排序。" + ], + [ + "prefix", + "String", + "O", + "列举以指定的字符串prefix开头的文件。" + ], + [ + "delimiter", + "String", + "O", + "将文件名按照特定字符分割的分割符。 注意 当前仅支持传空值或正斜杠(/),正斜杠(/)编码后为%2F。 如果指定了prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从prefix到第一个delimiter之间相同的部分会形成一条CommonPrefixes。 如果未携带prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从文件名开始到第一个delimiter之间相同的部分形成一条CommonPrefixes。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165" + }, + { + "location": "", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "status", + "Integer", + "M", + "HTTP响应码,200表示成功。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。" + ], + [ + "productId", + "String", + "M", + "项目ID。" + ], + [ + "bucket", + "String", + "M", + "存储实例名称。" + ], + [ + "nextMarker", + "String", + "O", + "如果本次没有返回全部结果,响应请求中将包含此字段,用于标明本次请求列举到的最后一个文件。后续请求可以指定Marker等于该值来列举剩余的文件。" + ], + [ + "isTruncated", + "Boolean", + "M", + "表明是否本次返回的ListBucketResult结果列表被截断。 true:表示本次没有返回全部结果。 false:表示本次已经返回了全部结果。" + ], + [ + "contents", + "Content[]", + "M", + "存储实例中的文件列表。" + ], + [ + "contentType", + "String", + "M", + "文件类型,告诉客户端实际返回内容的类型。" + ], + [ + "commonPrefixes", + "CommonPrefix[]", + "O", + "请求中带delimiter参数时返回的CommonPrefixes分组信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section1787523414439" + }, + { + "location": "", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "key", + "String", + "M", + "文件名" + ], + [ + "size", + "String", + "M", + "文件大小" + ], + [ + "lastModified", + "String", + "M", + "文件最后修改时间" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section1787523414439" + }, + { + "location": "", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "prefix", + "String", + "O", + "请求中带delimiter参数时返回的分组信息前缀" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section1787523414439" + } + ], + "title": "列举文件", + "updatedAt": "2026-10-22 14:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/storage/list-files.parameters.json b/pkg/domain/reference/storage/list-files.parameters.json new file mode 100644 index 0000000..d8708a2 --- /dev/null +++ b/pkg/domain/reference/storage/list-files.parameters.json @@ -0,0 +1,74 @@ +[ + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section17216134314169", + "in": "header" + }, + { + "name": "max-keys", + "type": "string", + "required": false, + "description": "指定返回文件个数的最大值,默认值为50,取值范围为[1,1000]。 超出范围时,按照默认值进行处理。 如果因为max-keys的设置无法一次完成列举,返回结果会附加NextMarker元素作为下一次列举的marker。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + }, + { + "name": "marker", + "type": "string", + "required": false, + "description": "指定返回哪个标识符之后的文件,按照文件Key的UTF-8字典顺序排序。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + }, + { + "name": "prefix", + "type": "string", + "required": false, + "description": "列举以指定的字符串prefix开头的文件。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + }, + { + "name": "delimiter", + "type": "string", + "required": false, + "description": "将文件名按照特定字符分割的分割符。 注意 当前仅支持传空值或正斜杠(/),正斜杠(/)编码后为%2F。 如果指定了prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从prefix到第一个delimiter之间相同的部分会形成一条CommonPrefixes。 如果未携带prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从文件名开始到第一个delimiter之间相同的部分形成一条CommonPrefixes。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878#section233813595165", + "in": "query" + } +] diff --git a/pkg/domain/reference/storage/list-files.rules.json b/pkg/domain/reference/storage/list-files.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/storage/list-files.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/storage/update-metadata.json b/pkg/domain/reference/storage/update-metadata.json new file mode 100644 index 0000000..4ecfc34 --- /dev/null +++ b/pkg/domain/reference/storage/update-metadata.json @@ -0,0 +1,332 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section111611358426", + "text": "请求示例\nGET /v0/testagc-02reg/test.jpg\nclient_id: 8490****30232064\nproductId: 73643****461998\nContent-Type: application/json\nX-Agc-meta-sha256: 2737EBCCC****8829A39E059922E4A4B249E52EDAB0\nX-Agc-meta-md5: 456\nX-Agc-Content-Type: image/jpeg\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section4608111864818", + "text": "响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:06:13 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: a30729fa-1f2b-450c-835f-8f13a97f25f4\nServer: elb\n{\"bucket\":\"testagc-02reg\",\"name\":\"test.jpg\",\"storageType\":\"STANDARD\",\"contentType\":\"image\\/jpeg\",\"metadata\":{\"md5\":\"***\",\"sha256\":\"2737EB****A39E059922E4A4B249E52EDAB0\"},\"size\":29797,\"updateTime\":\"2022-12-10T10:13:46Z\",\"createTime\":\"2022-12-10T10:13:46Z\",\"storageRegion\":\"cn-north-4\",\"productId\":\"73643****461998\",\"storageArea\":\"CN\"}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-storage-getapicredentials-0000001498508514#section8727185210538", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "title": "获取文件元数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "title": "列举文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section2884114014219", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section68100472599", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section182591446101912", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section15408512141113", + "text": "此接口用于修改文件元数据。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "text": "单次请求所有的header数量不得超过40个。" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\n修改文件元数据\n修改文件元数据\n更新时间: 2026-10-22 14:56\n功能介绍\n\n此接口用于修改文件元数据。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS GET\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/{bucket_name}/{object_name}?metadata=update\n\n注意\n{bucket_name}为当前存储实例名称,{object_name}为待修改的文件名称。\n{domain}为接口域名。\n中国站点的域名:ops-server-drcn.agcstorage.link/v0\n德国站点的域名:ops-server-dre.agcstorage.link/v0\n新加坡站点的域名:ops-server-dra.agcstorage.link/v0\n俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0\n调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n说明\n\n单次请求所有的header数量不得超过40个。\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nAuthorization\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\nclient_id\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。\n\n\n\n\nX-Agc-Content-Type\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件类型。\n\n默认值:application/octet-stream\n\n\n\n\nX-Agc-Content-Disposition\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件打开方式。\n\n\n\n\nX-Agc-Content-Encoding\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准头部Content-Encoding。\n\n\n\n\nX-Agc-Cache-Control\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准头部Cache-Control。\n\n\n\n\nX-Agc-Content-Language\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准头部Content-Language。\n\n\n\n\nX-Agc-meta-*\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头中出现。\n\n示例:X-Agc-meta-test: test metadata\n\n保存实例为:test: test metadata\n\n说明\n元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。\n目录对象不支持自定义元数据,所以此接口不支持目录对象。\n请求示例\nGET /v0/testagc-02reg/test.jpg\nclient_id: 8490****30232064\nproductId: 73643****461998\nContent-Type: application/json\nX-Agc-meta-sha256: 2737EBCCC****8829A39E059922E4A4B249E52EDAB0\nX-Agc-meta-md5: 456\nX-Agc-Content-Type: image/jpeg\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\n响应参数\nHeader\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nstatus\n\n\t\n\nInteger\n\n\t\n\nM\n\n\t\n\nHTTP响应码,200表示成功。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。\n\nBody\n\n属性\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID。\n\n\n\n\nname\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件名称。\n\n\n\n\nbucket\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储实例名称。\n\n\n\n\nstorageArea\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储区域名称。\n\n\n\n\nstorageRegion\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n后端OBS存储站点。\n\n\n\n\nstorageType\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储类型。\n\n\n\n\ncontentType\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件类型。Content-Type标头告诉客户端实际返回的内容类型。\n\n\n\n\ncontentDisposition\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件打开方式,响应头指示回复的内容该以何种形式展示,是以内联的形式(即网页的一部分),还是以附件的形式下载并保存到本地。\n\n\n\n\nsha256\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件SHA256值。\n\n\n\n\nsize\n\n\t\n\nlong\n\n\t\n\nM\n\n\t\n\n文件大小。\n\n\n\n\ncreateTime\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。\n\n\n\n\nupdateTime\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。\n\n\n\n\nmetadata\n\n\t\n\nMap\n\n\t\n\nO\n\n\t\n\n元数据,用户自定义元数据。\n\n响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:06:13 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: a30729fa-1f2b-450c-835f-8f13a97f25f4\nServer: elb\n{\"bucket\":\"testagc-02reg\",\"name\":\"test.jpg\",\"storageType\":\"STANDARD\",\"contentType\":\"image\\/jpeg\",\"metadata\":{\"md5\":\"***\",\"sha256\":\"2737EB****A39E059922E4A4B249E52EDAB0\"},\"size\":29797,\"updateTime\":\"2022-12-10T10:13:46Z\",\"createTime\":\"2022-12-10T10:13:46Z\",\"storageRegion\":\"cn-north-4\",\"productId\":\"73643****461998\",\"storageArea\":\"CN\"}\n调用示例\nimport com.alibaba.fastjson.JSON;\nimport com.alibaba.fastjson.JSONObject;\n\n\nimport lombok.Builder;\nimport lombok.Getter;\nimport lombok.Setter;\nimport lombok.ToString;\nimport lombok.extern.slf4j.Slf4j;\n\n\nimport org.apache.commons.collections4.MapUtils;\nimport org.apache.http.Consts;\nimport org.apache.http.HttpStatus;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.client.utils.URIBuilder;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\nimport org.junit.Ignore;\n\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.HashMap;\nimport java.util.Map;\n\n\n/**\n * 元数据管理REST API示例代码\n */\n@Slf4j\npublic class MetadataManagingTest {\n\n\n /**\n * 更新元数据信息\n *\n * @param storageUrl 云存储url\n * @param param 更新元数据接口入参\n * @throws Exception 异常\n */\n public static void updateObjectMetadata(String storageUrl, ObjectMetadataParam param) throws Exception {\n URIBuilder uriBuilder =\n new URIBuilder(storageUrl + param.getBucketName() + \"/\" + param.getObjectName() + \"?metadata=update\");\n HttpGet get = new HttpGet(uriBuilder.build());\n get.setHeader(\"productId\", param.getProjectId());\n get.setHeader(\"client_id\", param.getClientId());\n get.setHeader(\"Authorization\", \"Bearer \" + param.getToken());\n if (MapUtils.isNotEmpty(param.getMetadata())) {\n param.getMetadata().forEach((k, v) -> get.setHeader(k, v));\n }\n\n\n CloseableHttpClient httpClient = HttpClients.createDefault();\n CloseableHttpResponse httpResponse = httpClient.execute(get);\n int statusCode = httpResponse.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n ObjectMetadata objectMetadata = JSONObject.toJavaObject(object, ObjectMetadata.class);\n log.info(\"updateObjectMetadata result:\", objectMetadata);\n }\n }\n\n\n public void client() throws Exception {\n\n\n String clientToken = TokenServiceTest.getToken(\"https://connect-api.cloud.huawei.com/api/\", \"84903XXXXXX32064\",\n \"00E5CCADB655891XXXXXXXXXXXX8CDCC83ACF22\");\n\n\n Map metadata = new HashMap<>();\n metadata.put(\"X-Agc-meta-sha256\", \"get file sha256\");\n metadata.put(\"X-Agc-Content-Encoding\", \"gzip\");\n ObjectMetadataParam updateMetadataParam = ObjectMetadataParam.builder()\n .projectId(\"73643XXXXXX61998\")\n .clientId(\"84903XXXXXX32064\")\n .token(clientToken)\n .bucketName(\"test-q36q0\")\n .objectName(\"sha256/test3.jpg\")\n .metadata(metadata)\n .build();\n updateObjectMetadata(\"https://ops-server-drcn.agcstorage.link/v0/\", updateMetadataParam);\n }\n\n\n public static void main(String[] args) throws Exception {\n new MetadataManagingTest().client();\n }\n\n\n @Builder\n @Getter\n static class ObjectMetadataParam {\n // 项目ID\n String projectId;\n\n\n // 客户端ID\n String clientId;\n\n\n // clientToken\n String token;\n\n\n // 云存储实例名\n String bucketName;\n\n\n // 待修改的文件名,需要携带路径。\n String objectName;\n\n\n Map metadata;\n }\n\n\n /**\n * 文件的元数据\n */\n @Getter\n @Setter\n @ToString\n static class ObjectMetadata {\n // 项目Id\n private String productId;\n\n\n // 存储的实例名\n private String bucket;\n\n\n // 存储的区域\n private String storageArea;\n\n\n // 后端OBS存储站点\n private String storageRegion;\n\n\n // 存储的类型\n private String storageType;\n\n\n // 文件名\n private String name;\n\n\n // 文件类型\n private String contentType;\n\n\n // 上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ\n private String createTime;\n\n\n // 更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ\n private String updateTime;\n\n\n // 文件大小\n private long size;\n\n\n // 可选,元数据,用户自定义元数据\n private Map metadata;\n\n\n // 可选,标准HTTP请求头 Content-Language\n private String contentLanguage;\n\n\n // 可选,标准HTTP请求头 Content-Encoding\n private String contentEncoding;\n\n\n // 可选,标准HTTP请求头 Cache-Control\n private String cacheControl;\n\n\n // 可选,文件打开方式\n private String contentDisposition;\n }\n}\n获取文件元数据\n列举文件\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nHeader\n请求示例\n响应参数\nHeader\nBody\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器->华为服务器" + ], + [ + "接口URL", + "https://{domain}/{bucket_name}/{object_name}?metadata=update 注意 {bucket_name}为当前存储实例名称,{object_name}为待修改的文件名称。 {domain}为接口域名。 中国站点的域名:ops-server-drcn.agcstorage.link/v0 德国站点的域名:ops-server-dre.agcstorage.link/v0 新加坡站点的域名:ops-server-dra.agcstorage.link/v0 俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0 调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17667171510253" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "Authorization", + "String", + "M", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "client_id", + "String", + "M", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "String", + "M", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + ], + [ + "X-Agc-Content-Type", + "String", + "O", + "文件类型。 默认值:application/octet-stream" + ], + [ + "X-Agc-Content-Disposition", + "String", + "O", + "文件打开方式。" + ], + [ + "X-Agc-Content-Encoding", + "String", + "O", + "HTTP标准头部Content-Encoding。" + ], + [ + "X-Agc-Cache-Control", + "String", + "O", + "HTTP标准头部Cache-Control。" + ], + [ + "X-Agc-Content-Language", + "String", + "O", + "HTTP标准头部Content-Language。" + ], + [ + "X-Agc-meta-*", + "String", + "O", + "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头中出现。 示例:X-Agc-meta-test: test metadata 保存实例为:test: test metadata 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。 目录对象不支持自定义元数据,所以此接口不支持目录对象。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "status", + "Integer", + "M", + "HTTP响应码,200表示成功。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section2884114014219" + }, + { + "location": "body", + "rows": [ + [ + "属性", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "productId", + "String", + "M", + "项目ID。" + ], + [ + "name", + "String", + "M", + "文件名称。" + ], + [ + "bucket", + "String", + "M", + "存储实例名称。" + ], + [ + "storageArea", + "String", + "M", + "存储区域名称。" + ], + [ + "storageRegion", + "String", + "M", + "后端OBS存储站点。" + ], + [ + "storageType", + "String", + "M", + "存储类型。" + ], + [ + "contentType", + "String", + "M", + "文件类型。Content-Type标头告诉客户端实际返回的内容类型。" + ], + [ + "contentDisposition", + "String", + "O", + "文件打开方式,响应头指示回复的内容该以何种形式展示,是以内联的形式(即网页的一部分),还是以附件的形式下载并保存到本地。" + ], + [ + "sha256", + "String", + "O", + "文件SHA256值。" + ], + [ + "size", + "long", + "M", + "文件大小。" + ], + [ + "createTime", + "String", + "M", + "上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。" + ], + [ + "updateTime", + "String", + "M", + "更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。" + ], + [ + "metadata", + "Map", + "O", + "元数据,用户自定义元数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section68100472599" + } + ], + "title": "修改文件元数据", + "updatedAt": "2026-10-22 14:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture", + "implementationNotes": [ + "GET with metadata=update matches the prototype and Java HttpGet example; the short request example omits the metadata query." + ] +} diff --git a/pkg/domain/reference/storage/update-metadata.parameters.json b/pkg/domain/reference/storage/update-metadata.parameters.json new file mode 100644 index 0000000..e227159 --- /dev/null +++ b/pkg/domain/reference/storage/update-metadata.parameters.json @@ -0,0 +1,98 @@ +[ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Type", + "type": "string", + "required": false, + "description": "文件类型。 默认值:application/octet-stream", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Disposition", + "type": "string", + "required": false, + "description": "文件打开方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Encoding", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Encoding。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Cache-Control", + "type": "string", + "required": false, + "description": "HTTP标准头部Cache-Control。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Language", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Language。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-meta-*", + "type": "string", + "required": false, + "description": "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头中出现。 示例:X-Agc-meta-test: test metadata 保存实例为:test: test metadata 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。 目录对象不支持自定义元数据,所以此接口不支持目录对象。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553#section17216134314169", + "in": "header" + } +] diff --git a/pkg/domain/reference/storage/update-metadata.rules.json b/pkg/domain/reference/storage/update-metadata.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/storage/update-metadata.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/storage/upload-file.json b/pkg/domain/reference/storage/upload-file.json new file mode 100644 index 0000000..0dff56b --- /dev/null +++ b/pkg/domain/reference/storage/upload-file.json @@ -0,0 +1,291 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section111611358426", + "text": "请求示例\nPUT /v0/testagc-02reg/test5.jpg\nclient_id: 84****32064\nproductId: 736430****461998\nContent-Type: application/json\nX-Agc-Trace-Id: 123\nX-Agc-File-Offset: 0\nX-Agc-File-Size: 12\nX-Agc-Sha256: 11\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\ncontent-length: 2536" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section4608111864818", + "text": "响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:23:25 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: 123\nServer: elb\n{\"uploadStatus\":\"finalize\",\"fileInfo\":{\"updateTime\":\"2023-03-27T03:23:24Z\",\"bucket\":\"testagc-02reg\",\"name\":\"test5.jpg\",\"storageType\":\"STANDARD\",\"createTime\":\"2023-03-27T03:23:24Z\",\"contentType\":\"application\\/octet-stream\",\"size\":2536,\"storageArea\":\"CN\"}}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-storage-getapicredentials-0000001498508514#section8727185210538", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "title": "查询项目ID" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-fileinfo-0000001498838610", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "title": "下载文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section15408512141113", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17667171510253", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section98801710132813", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section111611358426", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section1787523414439", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section052915616139", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section20105181721319", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section4608111864818", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section227853019496", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section15408512141113", + "text": "此接口用于上传文件。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "text": "单次请求所有的header数量不超过40个。" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\n上传文件\n上传文件\n更新时间: 2026-10-22 14:56\n功能介绍\n\n此接口用于上传文件。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS PUT\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器->华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://{domain}/{bucket_name}/{object_name}\n\n注意\n{bucket_name}为当前存储实例名称,{object_name}为待上传的文件名称。\n{domain}为接口域名。\n中国站点的域名:ops-server-drcn.agcstorage.link/v0\n德国站点的域名:ops-server-dre.agcstorage.link/v0\n新加坡站点的域名:ops-server-dra.agcstorage.link/v0\n俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0\n调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\nHeader\n说明\n\n单次请求所有的header数量不超过40个。\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nclient_id\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n客户端ID,获取方法参考创建API客户端。\n\n\n\n\nproductId\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n项目ID,查询方法可参见查询项目ID。\n\n\n\n\nAuthorization\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。\n\n\n\n\nX-Agc-File-Size\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件大小,断点续传时为必选。\n\n\n\n\nX-Agc-File-Offset\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件偏移量,断点续传的起始位置非零时为必选。\n\n\n\n\nX-Agc-Sha256\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件的SHA256值,断点续传时为必选。\n\n\n\n\nX-Agc-Content-Type\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件类型。\n\n默认值:application/octet-stream\n\n\n\n\nX-Agc-Content-Disposition\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件打开方式。\n\n\n\n\nX-Agc-Content-Encoding\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准头部Content-Encoding。\n\n\n\n\nX-Agc-Cache-Control\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准头部Cache-Control。\n\n\n\n\nX-Agc-Content-Language\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\nHTTP标准头部Content-Language。\n\n\n\n\nX-Agc-meta-*\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头部出现。\n\nX-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。例如,您传入的是“X-Agc-meta-test: test metadata”,保存的数据实例为“test: test metadata”。\n\n说明\n\n元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。\n\n请求示例\nPUT /v0/testagc-02reg/test5.jpg\nclient_id: 84****32064\nproductId: 736430****461998\nContent-Type: application/json\nX-Agc-Trace-Id: 123\nX-Agc-File-Offset: 0\nX-Agc-File-Size: 12\nX-Agc-Sha256: 11\nAuthorization: Bearer ****\nUser-Agent: PostmanRuntime/7.6.0\nAccept: */*\nHost: ops-server-drcn.agcstorage.link\naccept-encoding: gzip, deflate\ncontent-length: 2536\n响应参数\nHeader\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nstatus\n\n\t\n\nInteger\n\n\t\n\nM\n\n\t\n\nHTTP响应码,200表示成功。\n\n\n\n\nX-Agc-Trace-Id\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。\n\nBody\n\n参数\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nuploadStatus\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n上传状态。\n\nresumable:断点续传\nfinalize:上传完成\n\n\n\nreceiveBytes\n\n\t\n\nLong\n\n\t\n\nO\n\n\t\n\n已上传字节。从0开始,仅支持顺序上传。文件未上传完毕时返回该字段。\n\n\n\n\nfileInfo\n\n\t\n\nFileInfo\n\n\t\n\nO\n\n\t\n\n文件的详细信息。\n\n响应示例\nHTTP/1.1 200\nstatus: 200\nDate: Mon, 27 Mar 2023 03:23:25 GMT\nContent-Type: text/plain\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Agc-Trace-Id: 123\nServer: elb\n{\"uploadStatus\":\"finalize\",\"fileInfo\":{\"updateTime\":\"2023-03-27T03:23:24Z\",\"bucket\":\"testagc-02reg\",\"name\":\"test5.jpg\",\"storageType\":\"STANDARD\",\"createTime\":\"2023-03-27T03:23:24Z\",\"contentType\":\"application\\/octet-stream\",\"size\":2536,\"storageArea\":\"CN\"}}\n调用示例\n// 获取Token公共类\n// TokenServiceTest .java\nimport com.alibaba.fastjson.JSON;\nimport com.alibaba.fastjson.JSONObject;\n\n\nimport org.apache.http.Consts;\nimport org.apache.http.HttpResponse;\nimport org.apache.http.HttpStatus;\nimport org.apache.http.client.methods.HttpPost;\nimport org.apache.http.entity.StringEntity;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\n\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.nio.charset.Charset;\n\n\n/**\n * 获取accessToken\n *\n */\npublic class TokenServiceTest {\n /**\n * @param domain 域名\n * @param clientId clientId\n * @param clientSecret clientSecret\n * @return accessToken\n */\n public static String getToken(String domain, String clientId, String clientSecret) {\n String token = null;\n CloseableHttpClient httpClient = HttpClients.createDefault();\n HttpPost post = new HttpPost(domain + \"/oauth2/v1/token\");\n try {\n JSONObject keyString = new JSONObject();\n keyString.put(\"client_id\", clientId);\n keyString.put(\"client_secret\", clientSecret);\n keyString.put(\"grant_type\", \"client_credentials\");\n\n\n StringEntity entity = new StringEntity(keyString.toString(), Charset.forName(\"UTF-8\"));\n entity.setContentEncoding(\"UTF-8\");\n entity.setContentType(\"application/json\");\n post.setEntity(entity);\n HttpResponse response = httpClient.execute(post);\n int statusCode = response.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(response.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n token = object.getString(\"access_token\");\n }\n\n\n } catch (Exception e) {\n throw new RuntimeException(\"Get Token Exception\");\n } finally {\n post.releaseConnection();\n try {\n httpClient.close();\n } catch (IOException e) {\n throw new RuntimeException(\"Close httpClient Exception\");\n }\n }\n return token;\n }\n}\n\n\n// UploadObjectTest.java\nimport com.alibaba.fastjson.JSON;\nimport com.alibaba.fastjson.JSONObject;\n\n\nimport lombok.Builder;\nimport lombok.Getter;\nimport lombok.extern.slf4j.Slf4j;\n\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.apache.http.Consts;\nimport org.apache.http.HttpStatus;\nimport org.apache.http.client.methods.CloseableHttpResponse;\nimport org.apache.http.client.methods.HttpPut;\nimport org.apache.http.client.utils.URIBuilder;\nimport org.apache.http.entity.ContentType;\nimport org.apache.http.entity.InputStreamEntity;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\nimport org.junit.Ignore;\n\n\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.RandomAccessFile;\nimport java.security.MessageDigest;\n\n\nimport javax.xml.bind.DatatypeConverter;\n\n\n/**\n * 上传文件REST API示例代码\n */\n@Slf4j\n@Ignore\npublic class UploadObjectTest {\n /**\n * 上传文件\n *\n * @param storageUrl 云存储url\n * @param param 上传文件接口入参\n * @param offset 文件偏移量,普通上传置为-1即可。如果是分片上传,则需要填具体的值。\n * @param fileSize 文件总大小\n * @param inputStreamEntity 文件流\n * @throws Exception 异常\n */\n public static void uploadObject(String storageUrl, UploadObjectParam param, long offset, long fileSize,\n InputStreamEntity inputStreamEntity) throws Exception {\n URIBuilder uriBuilder = new URIBuilder(storageUrl + param.getBucketName() + \"/\" + param.getObjectName());\n HttpPut httpPut = new HttpPut(uriBuilder.build());\n httpPut.setHeader(\"productId\", param.getProjectId());\n httpPut.setHeader(\"client_id\", param.getClientId());\n httpPut.setHeader(\"Authorization\", \"Bearer \" + param.getToken());\n httpPut.setHeader(\"X-Agc-File-Size\", String.valueOf(fileSize));\n if (StringUtils.isNotEmpty(param.getSha256())) {\n // 文件的sha256,断点续传、分片上传时为必填\n httpPut.setHeader(\"X-Agc-Sha256\", param.getSha256());\n }\n if (offset >= 0) {\n // 文件偏移,,断点续传、分片上传时的起始位置非零时为必填\n httpPut.setHeader(\"X-Agc-File-Offset\", String.valueOf(offset));\n }\n try (CloseableHttpClient httpClient = HttpClients.createDefault()) {\n httpPut.setEntity(inputStreamEntity);\n CloseableHttpResponse httpResponse = httpClient.execute(httpPut);\n int statusCode = httpResponse.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n BufferedReader br =\n new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n log.info(\"uploadObject result:{}\", object.toJSONString());\n br.close();\n }\n httpResponse.close();\n }\n }\n\n\n /**\n * 分片上传\n *\n * @throws Exception 异常\n */\n public void chunkClient() throws Exception {\n String clientToken = TokenServiceTest.getToken(\"https://connect-api.cloud.huawei.com/api/\",\n \"84903XXXXXX32064\", \"00E5CCADB655891XXXXXXXXXXXX8CDCC83ACF22\");\n // 分片的大小\n int chunkSize = 1024 * 1024;\n\n\n // 获取文件输入流\n File file = new File(getClass().getClassLoader().getResource(\"run.log\").getFile());\n // 获取文件总大小\n long fileSize = file.length();\n // 计算分片数量\n int chunkCount = (int) Math.ceil((double) fileSize / chunkSize);\n\n\n UploadObjectParam param = UploadObjectParam.builder()\n .projectId(\"73643XXXXXX61998\")\n .clientId(\"84903XXXXXX32064\")\n .token(clientToken)\n .bucketName(\"test-q36q0\")\n .objectName(\"temp/run.log\")\n .sha256(getSha256(file.getPath()))\n .build();\n // 创建一个RandomAccessFile用来读取文件\n try (RandomAccessFile raf = new RandomAccessFile(file, \"r\")) {\n // 逐个分片上传\n for (int i = 0; i < chunkCount; i++) {\n // 计算当前分片的起始位置和长度\n long offset = i * chunkSize;\n long length = Math.min(chunkSize, fileSize - offset);\n // 构造请求实体,包含分片数据\n InputStream inputStream = new InputStreamSegment(raf, offset, length);\n InputStreamEntity entity = new InputStreamEntity(inputStream, length);\n uploadObject(\"https://ops-server-drcn.agcstorage.link/v0/\", param, offset, file.length(), entity);\n }\n }\n }\n\n\n /**\n * 普通文件上传\n *\n * @throws Exception\n */\n public void client() throws Exception {\n String clientToken = TokenServiceTest.getToken(\"https://connect-api.cloud.huawei.com/api/\",\n \"84903XXXXXX32064\", \"00E5CCADB655891XXXXXXXXXXXX8CDCC83ACF22\");\n UploadObjectParam param = UploadObjectParam.builder()\n .projectId(\"401697XXXXXX27846\")\n .clientId(\"84412XXXXXX3648\")\n .token(clientToken)\n .bucketName(\"test-q36q0\")\n .objectName(\"temp/hello.txt\")\n .build();\n File file = new File(getClass().getClassLoader().getResource(\"hello.txt\").getFile());\n FileInputStream fis = new FileInputStream(file);\n InputStreamEntity inputStreamEntity =\n new InputStreamEntity(fis, file.length(), ContentType.APPLICATION_OCTET_STREAM);\n uploadObject(\"https://ops-server-drcn.agcstorage.link/v0/\", param, -1, file.length(), inputStreamEntity);\n }\n\n\n // 获取文件的sha256值\n private static String getSha256(String filePath) throws Exception {\n FileInputStream fileInputStream = new FileInputStream(filePath);\n MessageDigest messageDigest = MessageDigest.getInstance(\"SHA-256\");\n byte[] buffer = new byte[1024];\n int bytesRead = 0;\n while ((bytesRead = fileInputStream.read(buffer)) != -1) {\n messageDigest.update(buffer, 0, bytesRead);\n }\n return DatatypeConverter.printHexBinary(messageDigest.digest());\n }\n\n\n public static void main(String[] args) throws Exception {\n // 文件上传\n new UploadObjectTest().client();\n\n\n // 分片上传\n new UploadObjectTest().chunkClient();\n }\n\n\n @Builder\n @Getter\n static class UploadObjectParam {\n // 项目ID\n String projectId;\n\n\n // 客户端ID\n String clientId;\n\n\n // clientToken\n String token;\n\n\n // 云存储实例名\n String bucketName;\n\n\n // 文件名,如果包含 '/' ,则认为是路径分隔符。如:temp/hello.jpg,则会将文件hello.jpg上传到对应存储实例的temp目录下。\n String objectName;\n\n\n // 文件的sha256,断点续传、分片上传时为必填\n String sha256;\n }\n\n\n static class InputStreamSegment extends InputStream {\n private RandomAccessFile raf;\n\n\n private long offset;\n\n\n private long length;\n\n\n private long position;\n\n\n public InputStreamSegment(RandomAccessFile raf, long offset, long length) {\n this.raf = raf;\n this.offset = offset;\n this.length = length;\n position = 0;\n }\n\n\n @Override\n public int read() throws IOException {\n if (position >= length) {\n return -1;\n }\n raf.seek(offset + position);\n int result = raf.read();\n if (result >= 0) {\n position++;\n }\n return result;\n }\n\n\n @Override\n public int read(byte[] b, int off, int len) throws IOException {\n if (position >= length) {\n return -1;\n }\n raf.seek(offset + position);\n int bytesToRead = (int) Math.min(len, length - position);\n int bytesRead = raf.read(b, off, bytesToRead);\n if (bytesRead >= 0) {\n position += bytesRead;\n }\n return bytesRead;\n }\n\n\n @Override\n public void close() throws IOException {\n }\n }\n}\n\n\nREST API\n下载文件\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\nHeader\n请求示例\n响应参数\nHeader\nBody\n响应示例\n调用示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器->华为服务器" + ], + [ + "接口URL", + "https://{domain}/{bucket_name}/{object_name} 注意 {bucket_name}为当前存储实例名称,{object_name}为待上传的文件名称。 {domain}为接口域名。 中国站点的域名:ops-server-drcn.agcstorage.link/v0 德国站点的域名:ops-server-dre.agcstorage.link/v0 新加坡站点的域名:ops-server-dra.agcstorage.link/v0 俄罗斯站点的域名:ops-server-drru.agcstorage.link/v0 调用获取Token接口时使用的站点必须与本接口使用的站点保持一致。例如本接口使用的站点是德国,即接口域名为“ops-server-dre.agcstorage.link/v0”,则调用获取Token接口也必须使用德国站点,其接口域名需为“connect-api-dre.cloud.huawei.com”。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17667171510253" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "client_id", + "String", + "M", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "productId", + "String", + "M", + "项目ID,查询方法可参见查询项目ID。" + ], + [ + "Authorization", + "String", + "M", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "X-Agc-File-Size", + "String", + "O", + "文件大小,断点续传时为必选。" + ], + [ + "X-Agc-File-Offset", + "String", + "O", + "文件偏移量,断点续传的起始位置非零时为必选。" + ], + [ + "X-Agc-Sha256", + "String", + "O", + "文件的SHA256值,断点续传时为必选。" + ], + [ + "X-Agc-Content-Type", + "String", + "O", + "文件类型。 默认值:application/octet-stream" + ], + [ + "X-Agc-Content-Disposition", + "String", + "O", + "文件打开方式。" + ], + [ + "X-Agc-Content-Encoding", + "String", + "O", + "HTTP标准头部Content-Encoding。" + ], + [ + "X-Agc-Cache-Control", + "String", + "O", + "HTTP标准头部Cache-Control。" + ], + [ + "X-Agc-Content-Language", + "String", + "O", + "HTTP标准头部Content-Language。" + ], + [ + "X-Agc-meta-*", + "String", + "O", + "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头部出现。 X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。例如,您传入的是“X-Agc-meta-test: test metadata”,保存的数据实例为“test: test metadata”。 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169" + }, + { + "location": "header", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "status", + "Integer", + "M", + "HTTP响应码,200表示成功。" + ], + [ + "X-Agc-Trace-Id", + "String", + "O", + "单个文件请求的Traceid,与请求参数X-Agc-Trace-Id保持一致。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section052915616139" + }, + { + "location": "body", + "rows": [ + [ + "参数", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "uploadStatus", + "String", + "M", + "上传状态。 resumable:断点续传 finalize:上传完成" + ], + [ + "receiveBytes", + "Long", + "O", + "已上传字节。从0开始,仅支持顺序上传。文件未上传完毕时返回该字段。" + ], + [ + "fileInfo", + "FileInfo", + "O", + "文件的详细信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section20105181721319" + } + ], + "title": "上传文件", + "updatedAt": "2026-10-22 14:56", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/storage/upload-file.parameters.json b/pkg/domain/reference/storage/upload-file.parameters.json new file mode 100644 index 0000000..d122cff --- /dev/null +++ b/pkg/domain/reference/storage/upload-file.parameters.json @@ -0,0 +1,129 @@ +[ + { + "name": "object_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457" + }, + { + "name": "bucket_name", + "in": "path", + "type": "string", + "required": true, + "description": "Storage instance or object path; percent-encoded exactly once.", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457" + }, + { + "name": "client_id", + "type": "string", + "required": false, + "description": "客户端ID,获取方法参考创建API客户端。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "productId", + "type": "string", + "required": true, + "description": "项目ID,查询方法可参见查询项目ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "Authorization", + "type": "string", + "required": false, + "description": "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-File-Size", + "type": "string", + "required": false, + "description": "文件大小,断点续传时为必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-File-Offset", + "type": "string", + "required": false, + "description": "文件偏移量,断点续传的起始位置非零时为必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Sha256", + "type": "string", + "required": false, + "description": "文件的SHA256值,断点续传时为必选。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Type", + "type": "string", + "required": false, + "description": "文件类型。 默认值:application/octet-stream", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Disposition", + "type": "string", + "required": false, + "description": "文件打开方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Encoding", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Encoding。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Cache-Control", + "type": "string", + "required": false, + "description": "HTTP标准头部Cache-Control。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Content-Language", + "type": "string", + "required": false, + "description": "HTTP标准头部Content-Language。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-meta-*", + "type": "string", + "required": false, + "description": "可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头部出现。 X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。例如,您传入的是“X-Agc-meta-test: test metadata”,保存的数据实例为“test: test metadata”。 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "X-Agc-Trace-Id", + "type": "string", + "required": false, + "description": "单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457#section17216134314169", + "in": "header" + }, + { + "name": "file", + "in": "file", + "type": "string", + "required": true, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457" + } +] diff --git a/pkg/domain/reference/storage/upload-file.rules.json b/pkg/domain/reference/storage/upload-file.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/storage/upload-file.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/supplemental/acl-apply-permission-info.json b/pkg/domain/reference/supplemental/acl-apply-permission-info.json new file mode 100644 index 0000000..def3f0f --- /dev/null +++ b/pkg/domain/reference/supplemental/acl-apply-permission-info.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-0000002271160637", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-deviceinfo-0000002271000697", + "title": "DeviceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissionstatus-0000002502126131", + "title": "OpenApplyPermissionStatusInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "name", + "M", + "String(256)", + "受限ACL权限名称。" + ], + [ + "reason", + "M", + "String(256)", + "受限ACL权限的申请理由。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-applypermissioninfo-0000002469038756" + } + ], + "title": "OpenApplyPermissionInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T03:47:57.909Z" +} diff --git a/pkg/domain/reference/supplemental/add-device-info.json b/pkg/domain/reference/supplemental/add-device-info.json new file mode 100644 index 0000000..327b97f --- /dev/null +++ b/pkg/domain/reference/supplemental/add-device-info.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-reference-0000002236041494", + "title": "Provisioning API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-0000002271160637", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-0000002271160637", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceresult-0000002271160641", + "title": "AddDeviceResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceName", + "M", + "String(100)", + "设备名称。" + ], + [ + "udid", + "M", + "String(64)", + "设备UDID。" + ], + [ + "deviceType", + "M", + "Integer(32)", + "设备类型。 取值范围: 1:运动手表 2:智能手表 4:手机 5:平板 8:智慧屏 19:PC/2in1" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-data-adddeviceinfo-0000002236201314" + } + ], + "title": "AddDeviceInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T03:47:56.701Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-adsinfo-0000002295005298.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-adsinfo-0000002295005298.json new file mode 100644 index 0000000..60f7e38 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-adsinfo-0000002295005298.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-user-0000002271160613", + "title": "Agreement(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "sceneItems", + "O", + "List", + "收集的数据信息。 数组长度不超过200。" + ], + [ + "pushContent", + "O", + "String(500)", + "推送内容。" + ], + [ + "closeSetting", + "O", + "String(500)", + "关闭设置。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298" + } + ], + "title": "AdsInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:16.680Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreement-privacy-0000002295005286.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreement-privacy-0000002295005286.json new file mode 100644 index 0000000..b73053a --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreement-privacy-0000002295005286.json @@ -0,0 +1,144 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "title": "AgreementInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-subagreement-0000002328805241", + "title": "SubAgreement" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-user-0000002271160613", + "title": "Agreement(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "title": "AgreementBaseInfo(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-privacy-0000002295005286", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "O", + "String", + "隐私政策协议ID。" + ], + [ + "templateId", + "O", + "String", + "隐私政策协议模板ID。" + ], + [ + "layoutType", + "O", + "Integer(32)", + "页面排版类型。" + ], + [ + "templateType", + "O", + "Integer(32)", + "隐私政策协议模板类型。 取值范围: 空 1:元服务模板 2:HarmonyOS应用模板" + ], + [ + "type", + "O", + "Integer(32)", + "协议类型。 取值范围: 1:隐私政策协议" + ], + [ + "agreementInfos", + "O", + "List", + "隐私政策协议列表。 数组长度不超过100。" + ], + [ + "versionCode", + "O", + "Integer(64)", + "隐私政策协议版本号。" + ], + [ + "status", + "O", + "Integer", + "隐私政策协议状态。 取值范围: 1:草稿 2:已完成 3:已删除 不传值:默认查未删除的记录" + ], + [ + "defaultLang", + "O", + "String(20)", + "隐私政策协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + ], + [ + "urls", + "O", + "List", + "url列表,多语言的后面对应拼接不同的语言,从隐私政策协议模板中获取对应的url,进行拼接。 数组长度为1~100。" + ], + [ + "createTime", + "O", + "Integer(64)", + "隐私政策协议创建时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1733555215000" + ], + [ + "updateTime", + "O", + "Integer(64)", + "隐私政策协议最近更新时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1733555215000" + ], + [ + "subAgreementInfo", + "O", + "SubAgreement", + "子隐私政策协议信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-privacy-0000002295005286" + } + ], + "title": "Agreement(隐私政策协议)", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:16.253Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreement-user-0000002271160613.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreement-user-0000002271160613.json new file mode 100644 index 0000000..03288c5 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreement-user-0000002271160613.json @@ -0,0 +1,110 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "title": "AgreementInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "title": "AdsInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-privacy-0000002295005286", + "title": "Agreement(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-user-0000002271160613", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "O", + "String", + "用户协议ID。" + ], + [ + "type", + "O", + "Integer(32)", + "协议类型。 取值范围: 2:用户协议" + ], + [ + "agreementInfos", + "O", + "List", + "用户协议列表。 数组长度不超过100。" + ], + [ + "versionCode", + "O", + "Integer(64)", + "用户协议版本号。" + ], + [ + "status", + "O", + "Integer", + "用户协议状态。 取值范围: 2:已完成 3:已删除" + ], + [ + "defaultLang", + "O", + "String(20)", + "用户协议默认语言。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + ], + [ + "createTime", + "O", + "Integer(64)", + "用户协议创建时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1733555215000" + ], + [ + "updateTime", + "O", + "Integer(64)", + "用户协议最近更新时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1733555215000" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-user-0000002271160613" + } + ], + "title": "Agreement(用户协议)", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:14.755Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290.json new file mode 100644 index 0000000..e76c4eb --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-privacy-0000002295005286", + "title": "Agreement(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "title": "AgreementBaseInfo(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "name", + "M", + "String(100)", + "用户协议名称。" + ], + [ + "agreementTitle", + "O", + "String(100)", + "用户协议标题。" + ], + [ + "userAgreementUrl", + "O", + "String(512)", + "用户协议URL。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290" + } + ], + "title": "AgreementBaseInfo(用户协议)", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:17.832Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630.json new file mode 100644 index 0000000..8bb5b59 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630.json @@ -0,0 +1,124 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "title": "AgreementBaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "title": "PersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "title": "DevicePermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "title": "ThirdSdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "title": "ThirdSharedInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "title": "ExtendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "title": "AgreementInfo(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-allpermission-0000002295046904", + "title": "AllPermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(20)", + "语种。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + ], + [ + "baseInfo", + "O", + "AgreementBaseInfo", + "隐私政策协议基础信息列表。" + ], + [ + "personalInfo", + "O", + "PersonalInfo", + "个人信息详情。" + ], + [ + "devicePermissions", + "O", + "List", + "设备权限信息。 数组长度不超过200。" + ], + [ + "thirdSdkInfo", + "O", + "ThirdSdkInfo", + "三方SDK信息。" + ], + [ + "thirdSharedInfos", + "O", + "List", + "三方共享信息。 数组长度不超过200。" + ], + [ + "extInfo", + "O", + "ExtendInfo", + "扩展信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630" + } + ], + "title": "AgreementInfo(隐私政策协议)", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:06:46.319Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementinfo-user-0000002236041482.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementinfo-user-0000002236041482.json new file mode 100644 index 0000000..4838a8d --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-agreementinfo-user-0000002236041482.json @@ -0,0 +1,74 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "title": "AgreementBaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "title": "AgreementBaseInfo(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "title": "AgreementInfo(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(20)", + "语种。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)" + ], + [ + "baseInfo", + "O", + "AgreementBaseInfo", + "用户协议基础信息列表。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482" + } + ], + "title": "AgreementInfo(用户协议)", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:29.074Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-allpermission-0000002295046904.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-allpermission-0000002295046904.json new file mode 100644 index 0000000..ec4341f --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-allpermission-0000002295046904.json @@ -0,0 +1,74 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-devicemultipermissionreason-0000002294885664", + "title": "DeviceMultiPermissionReason" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "title": "AgreementInfo(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454", + "title": "AppInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-allpermission-0000002295046904", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "O", + "String(100)", + "ACL权限ID。" + ], + [ + "deviceMultiReasons", + "O", + "List", + "权限多语言信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-allpermission-0000002295046904" + } + ], + "title": "AllPermission", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:18.789Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-appinfo-0000002236041454.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-appinfo-0000002236041454.json new file mode 100644 index 0000000..c8a32bd --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-appinfo-0000002236041454.json @@ -0,0 +1,460 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-application-status-0000002240477940#section1637119146108", + "title": "全网发布的应用状态流转说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-application-status-0000002240477940#section994894212109", + "title": "测试发布的应用状态流转说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689", + "title": "应用游戏分类" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "title": "CustInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "title": "VersionVoc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-allpermission-0000002295046904", + "title": "AllPermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "releaseState", + "O", + "Integer", + "应用状态。 releaseType为1时,状态含义如下。 说明 各状态间的转换请参见全网发布的应用状态流转说明。 0:已上架 1:上架审核不通过 2:已下架(含强制下架) 3:待上架,预约上架 4:审核中 5:升级审核中 6:申请下架 7:草稿 8:升级审核不通过 9:下架审核不通过 10:应用被开发者下架 11:撤销上架 12:预审中 13:预审不通过 releaseType为6时,状态含义如下。 说明 各状态间的转换请参见测试发布的应用状态流转说明。 0:正在测试 1:审核不通过 2:已失效(运营停止测试) 3:待生效 4:正在审核 7:准备提交 10:已失效(开发者停止测试) 11:撤销审核 12:预审中 13:预审不通过" + ], + [ + "defaultLang", + "O", + "String(16)", + "应用的默认语言。 说明 取值参见语言类型。" + ], + [ + "parentType", + "M", + "Integer", + "应用的一级分类。 固定ID。 说明 取值参见应用游戏分类。" + ], + [ + "harmonyChildType", + "O", + "Integer", + "HarmonyOS应用/元服务的二级分类。 固定ID。 说明 取值参见应用游戏分类。" + ], + [ + "kindMainTag", + "O", + "Integer", + "HarmonyOS应用/元服务主标签。 固定ID。 说明 取值参见应用游戏分类的“标签”列。" + ], + [ + "kindSubTags", + "O", + "List", + "HarmonyOS应用/元服务附属标签。 固定ID。最多可选4个附属标签。 说明 取值参见应用游戏分类的“标签”列。" + ], + [ + "privacyPolicy", + "M", + "String(255)", + "隐私政策声明的网页地址。 该网址会在应用的详情页面添加隐私政策跳转,可帮助用户清楚地了解您如何处理敏感的用户数据和设备数据。 隐私政策必须完整说明您的应用如何收集、使用和分享用户数据,包含但不限于如下情况建议提供: 面向儿童的App。 包含账户注册或需要访问用户的现有账户,或由法律另行规定。 对于收集用户或设备相关数据的App。" + ], + [ + "appNetType", + "O", + "Integer", + "应用联网类型。 取值范围: 1:单机 2:网游 默认值:1 说明 此参数只支持游戏类应用。" + ], + [ + "publishCountry", + "O", + "String(2048)", + "应用发布国家的国家码。 多个国家以英文逗号分隔。 示例:CN,DE,MC" + ], + [ + "contentRate", + "O", + "String(256)", + "应用分级。 Json格式。 示例:{\"HW\":\"3+\"}。" + ], + [ + "appTariffType", + "O", + "String(16)", + "应用内付费道具类型。 取值范围: 1:激活收费 2:道具收费 3:关卡收费 4:购买虚拟币 5:部分章节收费(图书阅读类) 6:其他的 7:课程收费 8:会员收费 返回多个表示具备多个类型,例如“1,2,3”。" + ], + [ + "publicationNumber", + "O", + "String(50)", + "版号信息。" + ], + [ + "developerNameCn", + "O", + "String(64)", + "开发者中文名称。 HarmonyOS应用和元服务此字段不支持修改。" + ], + [ + "developerNameEn", + "O", + "String(64)", + "开发者英文名称。 HarmonyOS应用和元服务此字段不支持修改。" + ], + [ + "developerWebsite", + "O", + "String(255)", + "开发者官网。" + ], + [ + "customInfo", + "O", + "CustInfo", + "客服信息。" + ], + [ + "elecCertificateUrl", + "O", + "String(256)", + "电子版权证书PDF地址。" + ], + [ + "certificateURLs", + "M", + "String(1024)", + "应用版权证书或代理证书图片地址列表。 逗号分隔,最多5个。" + ], + [ + "publicationURLs", + "O", + "String(1024)", + "版号证明。 逗号分隔的地址,可以为图片或者PDF,最多3个。" + ], + [ + "updateTime", + "O", + "String(32)", + "更新时间。 UTC时间格式:yyyy-mm-dd hh:mm:ss" + ], + [ + "versionNumber", + "O", + "String(32)", + "版本号。" + ], + [ + "versionCode", + "O", + "Integer(64)", + "对应软件包中的versionCode。" + ], + [ + "buildVersion", + "O", + "String", + "构建版本号,用于区分同一主版本下的不同测试子版本。" + ], + [ + "versionId", + "O", + "String(32)", + "版本ID。" + ], + [ + "onShelfVersionNumber", + "O", + "String(32)", + "在架版本版本号。" + ], + [ + "onShelfVersionCode", + "O", + "Integer(64)", + "在架版本versionCode,对应软件包中的versionCode。" + ], + [ + "onShelfVersionId", + "O", + "String(32)", + "在架版本版本ID。" + ], + [ + "shareLink", + "O", + "String(1024)", + "分享链接。 仅查询场景返回。" + ], + [ + "sensitivePermissionDesc", + "O", + "String(2048)", + "敏感权限说明。 此字段仅用于查询。 格式为JSON格式的字符串。 格式:{\"权限名称1\":\"权限描述1\",\"权限名称2\":\"权限描述2\"...}" + ], + [ + "familyShareTag", + "O", + "Integer", + "是否可以家庭共享。 取值范围: 0:不可以 1:可以 只有分发区域包含中国大陆的应用返回1。" + ], + [ + "deviceTypes", + "M", + "List", + "应用的设备类型信息。 数组长度不超过6。" + ], + [ + "restrictedPermissionVideo", + "O", + "String", + "HarmonyOS应用受限权限使用说明视频在文件服务器中的对象ID。 此字段仅用于查询。" + ], + [ + "privacyRightsUrl", + "O", + "String(256)", + "隐私权利网址。 即关于您的用户实施其权利的网站地址,例如用户删除、修改、导出其个人数据的入口。" + ], + [ + "projectId", + "O", + "String", + "项目ID。" + ], + [ + "registeredDclType", + "O", + "Integer(32)", + "APP类型信息。 取值范围: -1:清空APP类型信息 0:APP服务器在中国大陆 1:APP服务器不在中国大陆 2:APP为单机APP" + ], + [ + "registeredIdType", + "O", + "Integer(32)", + "主办单位类型。 取值范围: -1:清空数据(会联动清空registeredIdNumber的内容) 1:企业(社会信用代码) 2:个人(身份证号码) 3:机构(机构代码)" + ], + [ + "registeredIdNumber", + "O", + "String(64)", + "主办单位证件号。 取值范围: registeredIdType为1时,对应统一社会信用代码 registeredIdType为2时,对应身份证号码 registeredIdType为3时,对应组织机构代码" + ], + [ + "registeredEntity", + "O", + "Integer(32)", + "主办单位。 取值范围: 1:与开发者账号主体一致 2:与开发者账号主体不一致" + ], + [ + "registeredEntityName", + "O", + "String(1024)", + "主办单位名称。" + ], + [ + "privacyAgreementId", + "O", + "String(32)", + "隐私协议ID。" + ], + [ + "userAgreementUrl", + "O", + "String(512)", + "用户协议URL。" + ], + [ + "userAgreementIds", + "O", + "List", + "用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。" + ], + [ + "encrypted", + "O", + "Integer(32)", + "包是否加密。 取值范围: 0:不加密 1:加密 默认值:1" + ], + [ + "invitationCount", + "O", + "Integer", + "邀请量。 如果是邀请测试,返回的是参与测试的用户数。 如果是公开测试,返回的是下载安装次数。" + ], + [ + "downloadCount", + "O", + "Integer", + "下载量。 该版本启动下载的累计次数。" + ], + [ + "installCount", + "O", + "Integer", + "安装量。 该版本启动安装的累计次数。" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网 3:分阶段 4:分阶段转全网" + ], + [ + "isAiGenerate", + "O", + "Integer(32)", + "是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。" + ], + [ + "aiTypes", + "O", + "List", + "涉及的AI生成合成服务类型。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景" + ], + [ + "testUserName", + "O", + "String(128)", + "应用审核信息的测试账号用户名。" + ], + [ + "testUserPassword", + "O", + "String(128)", + "应用审核信息的测试账号密码。" + ], + [ + "appRemark", + "O", + "String(300)", + "应用审核信息的备注。" + ], + [ + "selfTestVideos", + "O", + "String(2000)", + "应用审核信息的自测文件。 格式为JSON字符串,示例:{\"objectId1\":\"文件名1\",\"objectId2\":\"文件名2\"...} 说明 此字段只支持元服务。" + ], + [ + "appReviewPhoneInfo", + "O", + "AppReviewContact", + "应用负责人的手机号信息。" + ], + [ + "appReviewEmailInfo", + "O", + "AppReviewContact", + "应用负责人的邮箱账号信息。" + ], + [ + "appReviewName", + "O", + "String(256)", + "应用负责人的姓名。" + ], + [ + "versionVocs", + "O", + "List", + "应用版本已解决问题。 数组长度不超过1000。" + ], + [ + "reviewState", + "O", + "Integer", + "审核状态。 取值范围: 1:等待审核 2:正在审核" + ], + [ + "releaseTime", + "O", + "String(32)", + "上架时间。 UTC时间格式:yyyy-mm-dd hh:mm:ss 说明 应用存在上架版本时,该参数才有返回值。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454" + } + ], + "title": "AppInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:20.854Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-appreviewcontact-0000002505438989.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-appreviewcontact-0000002505438989.json new file mode 100644 index 0000000..5902024 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-appreviewcontact-0000002505438989.json @@ -0,0 +1,64 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454", + "title": "AppInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-auditinfo-0000002271000649", + "title": "AuditInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "account", + "O", + "String(500)", + "应用负责人的手机号码或者邮箱账号。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989" + } + ], + "title": "AppReviewContact", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:23.546Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-auditinfo-0000002271000649.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-auditinfo-0000002271000649.json new file mode 100644 index 0000000..40033f5 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-auditinfo-0000002271000649.json @@ -0,0 +1,64 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefpackageinfo-0000002236041470", + "title": "BriefPackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-auditinfo-0000002271000649", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "auditOpinion", + "M", + "String(1024)", + "应用整体审核意见。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-auditinfo-0000002271000649" + } + ], + "title": "AuditInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:27.394Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-briefpackageinfo-0000002236041470.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-briefpackageinfo-0000002236041470.json new file mode 100644 index 0000000..8e7a2ff --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-briefpackageinfo-0000002236041470.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-auditinfo-0000002271000649", + "title": "AuditInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefversioninfo-0000002271000657", + "title": "BriefVersionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefpackageinfo-0000002236041470", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "packageId", + "O", + "String", + "软件包ID。" + ], + [ + "versionName", + "O", + "String", + "版本描述。 对应软件包中的versionName。" + ], + [ + "versionCode", + "O", + "Integer(64)", + "版本号。 对应软件包中的versionCode。" + ], + [ + "buildVersion", + "O", + "String", + "构建版本号,用于区分同一主版本下的不同测试子版本。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefpackageinfo-0000002236041470" + } + ], + "title": "BriefPackageInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:29.386Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-briefversioninfo-0000002271000657.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-briefversioninfo-0000002271000657.json new file mode 100644 index 0000000..938e2fe --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-briefversioninfo-0000002271000657.json @@ -0,0 +1,114 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454#ZH-CN_TOPIC_0000002236041454__zh-cn_topic_0000002093216050_zh-cn_topic_0000001057964443_p38168214", + "title": "releaseState" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefpackageinfo-0000002236041470", + "title": "BriefPackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefpackageinfo-0000002236041470", + "title": "BriefPackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefversioninfo-0000002271000657", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "O", + "String", + "版本ID。" + ], + [ + "state", + "O", + "Integer", + "版本状态。 说明 state字段的取值请参考AppInfo中的releaseState参数。" + ], + [ + "lastVersionId", + "O", + "String", + "应用的上一个上架版本ID。" + ], + [ + "releaseType", + "O", + "Integer(32)", + "应用发布方式。 取值范围: 1:全网 6:HarmonyOS测试发布方式(API>=10) 默认值:1" + ], + [ + "releasePhase", + "O", + "Integer(32)", + "分阶段发布标识。 取值范围: 0:全网 3:分阶段 4:分阶段转全网" + ], + [ + "updateTime", + "O", + "Integer(64)", + "最近更新时间。 此时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1675992294335" + ], + [ + "testType", + "O", + "Integer", + "测试类型。 取值范围: 3:HarmonyOS邀请测试 4:HarmonyOS公开测试" + ], + [ + "packageList", + "O", + "List", + "软件包信息列表。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefversioninfo-0000002271000657" + } + ], + "title": "BriefVersionInfo", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:40:44.643Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-connectret-0000002271160589.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-connectret-0000002271160589.json new file mode 100644 index 0000000..e4e7d7b --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-connectret-0000002271160589.json @@ -0,0 +1,78 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-errorcode-0000002271000673", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-commonerror-0000002553016832", + "title": "公共错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefversioninfo-0000002271000657", + "title": "BriefVersionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "title": "ContactInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Integer", + "返回码,请参见错误码和公共错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589" + } + ], + "title": "ConnectRet", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:47.323Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-contactinfo-0000002328805225.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-contactinfo-0000002328805225.json new file mode 100644 index 0000000..f409f47 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-contactinfo-0000002328805225.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "title": "ContractObligationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "email", + "O", + "List", + "商业邮箱。 数组长度不超过10。" + ], + [ + "phoneNum", + "O", + "List", + "商业手机号码。 数组长度不超过10。" + ], + [ + "companyAddress", + "O", + "String(512)", + "商业公司地址。" + ], + [ + "customContactInfo", + "O", + "String(500)", + "自定义联系方式。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225" + } + ], + "title": "ContactInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:49.203Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-contractobligationmode-0000002328924941.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-contractobligationmode-0000002328924941.json new file mode 100644 index 0000000..9762406 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-contractobligationmode-0000002328924941.json @@ -0,0 +1,80 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "title": "ServiceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "title": "ContactInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "title": "CustInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "serviceType", + "O", + "String(500)", + "产品功能。" + ], + [ + "personalCollectReason", + "O", + "String(500)", + "个人信息采集用途。" + ], + [ + "serviceTypeInfos", + "O", + "List", + "产品提供的功能。 数组长度不超过100。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941" + } + ], + "title": "ContractObligationMode", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:51.119Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-custinfo-0000002504067925.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-custinfo-0000002504067925.json new file mode 100644 index 0000000..13298f1 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-custinfo-0000002504067925.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "title": "ContractObligationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "title": "CustomChapter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "phone", + "O", + "String(50)", + "客服电话号码。使用“国际区号/国内区号-电话号码”的格式,例如:0086-137xxxxxxxx、0755-xxxxxxxx。" + ], + [ + "email", + "O", + "String(50)", + "客服邮箱。" + ], + [ + "qqNum", + "O", + "String(50)", + "客服QQ。" + ], + [ + "internalPath", + "O", + "String(100)", + "App内问题反馈路径。例如:华为应用市场 > 我的 > 帮助与客服" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925" + } + ], + "title": "CustInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:53.019Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-customchapter-0000002294845694.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-customchapter-0000002294845694.json new file mode 100644 index 0000000..48360ed --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-customchapter-0000002294845694.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "title": "CustInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "title": "CustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "title", + "O", + "String(100)", + "额外的自定义章节标题。" + ], + [ + "customInfoDesc", + "O", + "String(3000)", + "额外的自定义章节内容。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694" + } + ], + "title": "CustomChapter", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:55.294Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-custominfo-0000002295005358.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-custominfo-0000002295005358.json new file mode 100644 index 0000000..e46dc5a --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-custominfo-0000002295005358.json @@ -0,0 +1,80 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "title": "CustomChapter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "title": "CustomChapter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "title": "DataItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "title", + "O", + "String(100)", + "自定义章节标题。" + ], + [ + "customInfoDesc", + "O", + "String(5000)", + "自定义章节内容。" + ], + [ + "customInfos", + "O", + "List", + "额外的自定义章节详情。 数组长度不超过5。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358" + } + ], + "title": "CustomInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:40:58.337Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-dataitem-0000002328924933.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-dataitem-0000002328924933.json new file mode 100644 index 0000000..8770f64 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-dataitem-0000002328924933.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "title": "CustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentqual-0000002271160605", + "title": "DependentQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "itemId", + "O", + "String(64)", + "数据ID。" + ], + [ + "itemDesc", + "O", + "String(500)", + "数据描述。" + ], + [ + "sensitiveData", + "O", + "Integer(32)", + "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933" + } + ], + "title": "DataItem", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:32.015Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-dependentqual-0000002271160605.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-dependentqual-0000002271160605.json new file mode 100644 index 0000000..0b6c62d --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-dependentqual-0000002271160605.json @@ -0,0 +1,90 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-qualificationcode-0000002422741790", + "title": "资质编码与资质文件对照表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentquallang-0000002271000661", + "title": "DependentQualLang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "title": "DataItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentquallang-0000002271000661", + "title": "DependentQualLang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentqual-0000002271160605", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "qualCodes", + "O", + "String", + "资质编码列表,具体请参见资质编码与资质文件对照表。 多个以英文逗号分隔。" + ], + [ + "required", + "O", + "Integer(32)", + "资质是否必选。 取值范围: 1:必选 0:非必选" + ], + [ + "sort", + "O", + "Integer(32)", + "资质的排序号。 示例:1" + ], + [ + "qualLangInfos", + "O", + "List", + "资质的多语言描述信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentqual-0000002271160605" + } + ], + "title": "DependentQual", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:41:00.525Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-dependentquallang-0000002271000661.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-dependentquallang-0000002271000661.json new file mode 100644 index 0000000..1ff7640 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-dependentquallang-0000002271000661.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentqual-0000002271160605", + "title": "DependentQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicematerial-0000002236201274", + "title": "DeviceMaterial" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentquallang-0000002271000661", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "O", + "String", + "资质的语言类型。 取值范围: zh_CN:中文 en_US:英文 ru_RU:俄语" + ], + [ + "description", + "O", + "String", + "资质的描述信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentquallang-0000002271000661" + } + ], + "title": "DependentQualLang", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:41:02.527Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-developerinfo-0000002649369326.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-developerinfo-0000002649369326.json new file mode 100644 index 0000000..861fd6e --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-developerinfo-0000002649369326.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "title": "ExtendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-developerinfo-0000002649369326", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "hwAccount", + "O", + "String", + "华为账号。" + ], + [ + "teamId", + "O", + "String", + "团队账号ID。" + ], + [ + "realName", + "O", + "String", + "开发者名称。" + ], + [ + "realNameEn", + "O", + "String", + "开发者英文名称。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-developerinfo-0000002649369326" + } + ], + "title": "DeveloperInfo", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:42:16.417Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicematerial-0000002236201274.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicematerial-0000002236201274.json new file mode 100644 index 0000000..cbf42a5 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicematerial-0000002236201274.json @@ -0,0 +1,118 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentquallang-0000002271000661", + "title": "DependentQualLang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-devicemultipermissionreason-0000002294885664", + "title": "DeviceMultiPermissionReason" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicematerial-0000002236201274", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 取值范围: 4:手机 5:平板 8:智慧屏 12:智能手表 14:运动手表 19:PC/2in1" + ], + [ + "appIcon", + "O", + "String(300)", + "应用图标下载地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + ], + [ + "screenShots", + "O", + "List", + "应用截屏地址。 多个地址以英文逗号隔开,最多不超过10个地址,最少不少于3个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + ], + [ + "banner", + "O", + "String(300)", + "高清大图地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + ], + [ + "showType", + "O", + "Integer", + "截图展现方式。 取值范围: 0:竖屏 1:横屏" + ], + [ + "introVideos", + "O", + "List", + "介绍视频。 Json字符串格式,含有videoUrl、frameUrl两个字段,数组长度最多5个。 示例:\"introVideos\": [\"{\\\"frameUrl\\\":\\\"https://**.cn:18445/FileServer/D11.jpeg\\\",\\\"videoUrl\\\":\\\"https://*.*.cn:18445/82C.mp4\\\"}\" ]" + ], + [ + "rcmdVideos", + "O", + "List", + "推荐视频。 Json字符串格式,含有videoUrl、frameUrl两个字段。数组长度最多5个。 示例:\"rcmdVideos\": [\"{\\\"frameUrl\\\":\\\"https://*.*.cn:18445/5D7.jpeg\\\",\\\"videoUrl\\\":\\\"https://*.*.cn:18445/97A.mp4\\\"}\"" + ], + [ + "promoGraphics", + "O", + "List", + "宣传图片地址。 多个地址以英文逗号隔开,最多不超过10个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + ], + [ + "rcmdPics", + "O", + "String(2560)", + "推荐图片地址。 多个地址以英文逗号隔开,最多不超过10个地址。" + ], + [ + "videoShowType", + "O", + "Integer", + "视频展现方式。 取值范围: 0:竖屏 1:横屏" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicematerial-0000002236201274" + } + ], + "title": "DeviceMaterial", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:41:07.839Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicepermission-0000002294845674.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicepermission-0000002294845674.json new file mode 100644 index 0000000..1a83db6 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicepermission-0000002294845674.json @@ -0,0 +1,92 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "title": "Permission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-devicemultipermissionreason-0000002294885664", + "title": "DeviceMultiPermissionReason" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "permissions", + "O", + "List", + "权限详情。 数组长度为1~200。" + ], + [ + "reasonId", + "O", + "String(64)", + "权限理由ID。" + ], + [ + "reason", + "O", + "String(500)", + "权限理由描述。" + ], + [ + "groupId", + "O", + "String(100)", + "权限groupId。" + ], + [ + "groupName", + "O", + "String(256)", + "权限groupName。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674" + } + ], + "title": "DevicePermission", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:41:35.385Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicetypeinfo-0000002236201270.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicetypeinfo-0000002236201270.json new file mode 100644 index 0000000..6517277 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-devicetypeinfo-0000002236201270.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "title": "DevicePermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-developerinfo-0000002649369326", + "title": "DeveloperInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer(32)", + "设备类型。 取值范围: 4:手机 5:平板 8:智慧屏 12:智能手表 14:运动手表 19:PC/2in1" + ], + [ + "appAdapters", + "O", + "String(32)", + "适配设备类型。 取值范围: 5:平板 说明 当deviceType为4(手机)时,系统会默认兼容分发到平板设备,即给appAdapters赋值5。 19:PC/2in1" + ], + [ + "remoteControl", + "O", + "String(16)", + "遥控设备。 取值范围: 1:遥控器 说明 当设备类型为智慧屏,即deviceType为8时,此字段才需填写。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270" + } + ], + "title": "DeviceTypeInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:41:38.627Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-extendinfo-0000002328924981.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-extendinfo-0000002328924981.json new file mode 100644 index 0000000..4ae5aac --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-extendinfo-0000002328924981.json @@ -0,0 +1,136 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "title": "ContactInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "title": "StorageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "title": "VersionChangeDesc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "title": "ManagePersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "title": "CustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "title": "ExtFieldCustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-developerinfo-0000002649369326", + "title": "DeveloperInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "title": "ExtFieldCustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "contactInfo", + "O", + "ContactInfo", + "联系方式详情。" + ], + [ + "storageInfo", + "O", + "StorageInfo", + "存储信息。" + ], + [ + "childPrivacyUrl", + "O", + "String(512)", + "未成年人隐私保护url。" + ], + [ + "versionChangeDescs", + "O", + "List", + "版本变更说明。" + ], + [ + "abstracts", + "O", + "String(300)", + "摘要信息。" + ], + [ + "managePersonalInfo", + "O", + "ManagePersonalInfo", + "个人信息管理详情。" + ], + [ + "customInfo", + "O", + "CustomInfo", + "自定义章节详情。" + ], + [ + "extField", + "O", + "String(8192)", + "扩展字段。 说明 扩展字段的value不允许为空字符串,空字符串表示删除此扩展字段。" + ], + [ + "extFieldCustomInfo", + "O", + "ExtFieldCustomInfo", + "儿童隐私详情。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981" + } + ], + "title": "ExtendInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:42:21.397Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-extfieldcustominfo-0000002328924997.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-extfieldcustominfo-0000002328924997.json new file mode 100644 index 0000000..b1027f0 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-extfieldcustominfo-0000002328924997.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "title": "ExtendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "childPrivacyTitle", + "O", + "String(512)", + "儿童隐私自定义标题。" + ], + [ + "childPrivacyCustomInfoDesc", + "O", + "String(5000)", + "儿童隐私自定义内容。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997" + } + ], + "title": "ExtFieldCustomInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:42:24.917Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-fileinfo-0000002236041466.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-fileinfo-0000002236041466.json new file mode 100644 index 0000000..40a5c83 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-fileinfo-0000002236041466.json @@ -0,0 +1,88 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "title": "ExtFieldCustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "title": "FullServiceMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer(32)", + "设备类型。 取值范围: 4:手机 5:平板 8:智慧屏 12:智能手表 14:运动手表 19:PC/2in1" + ], + [ + "objectIdList", + "M", + "List", + "文件在OBS上的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 数组长度不超过10。 说明 如果是应用介绍视频,最多3个视频以及对应海报。files中必须先传视频再传海报,且视频和海报必须交替上传,即先传第1组的视频再传对应的海报,再传下一组视频和海报。 如果是推荐视频,1个推荐视频以及对应海报。files中必须先传视频再传海报。" + ], + [ + "showType", + "O", + "Integer", + "当前语言的截图展现方式。 取值范围: 0:竖屏 1:横屏" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466" + } + ], + "title": "FileInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:42:34.631Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-fullservicemode-0000002294845638.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-fullservicemode-0000002294845638.json new file mode 100644 index 0000000..b5843f7 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-fullservicemode-0000002294845638.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-groupinfo-0000002678290865", + "title": "GroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "selectPath", + "O", + "String(500)", + "选择路径。" + ], + [ + "personalCollectType", + "O", + "String(500)", + "个人信息采集类型。" + ], + [ + "basicServiceType", + "O", + "String(500)", + "提供的基本功能。" + ], + [ + "extraServiceType", + "O", + "String(500)", + "提供的附加功能。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638" + } + ], + "title": "FullServiceMode", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:42:38.344Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-groupinfo-0000002678290865.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-groupinfo-0000002678290865.json new file mode 100644 index 0000000..7f10cd7 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-groupinfo-0000002678290865.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "title": "FullServiceMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "title": "InfoAccess" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-groupinfo-0000002678290865", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "O", + "String(32)", + "测试群组ID。" + ], + [ + "groupName", + "O", + "String(50)", + "测试群组名称。" + ], + [ + "addedTesterNum", + "O", + "Integer", + "已添加测试群组成员的数量。" + ], + [ + "bind", + "O", + "Integer", + "是否绑定该测试群组。 取值范围: 1:已绑定 0:未绑定" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-groupinfo-0000002678290865" + } + ], + "title": "GroupInfo", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:42:43.745Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-infoaccess-0000002328805233.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infoaccess-0000002328805233.json new file mode 100644 index 0000000..e999361 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infoaccess-0000002328805233.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-groupinfo-0000002678290865", + "title": "GroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "title": "InfoCancel" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "personalSettingPath", + "O", + "String(500)", + "访问路径。" + ], + [ + "personalType", + "O", + "String(500)", + "涉及个人信息种类。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233" + } + ], + "title": "InfoAccess", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:42:47.904Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-infocancel-0000002328924989.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infocancel-0000002328924989.json new file mode 100644 index 0000000..69add91 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infocancel-0000002328924989.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "title": "InfoAccess" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "title": "InfoDelete" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "personalSettingPath", + "O", + "String(500)", + "访问路径。" + ], + [ + "serviceType", + "O", + "String(200)", + "业务功能,业务类型。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989" + } + ], + "title": "InfoCancel", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:42:51.629Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-infodelete-0000002294845690.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infodelete-0000002294845690.json new file mode 100644 index 0000000..377bb25 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infodelete-0000002294845690.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "title": "InfoCancel" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "title": "InfoModify" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "personalSettingPath", + "O", + "String(500)", + "访问路径。" + ], + [ + "personalType", + "O", + "String(500)", + "涉及个人信息种类。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690" + } + ], + "title": "InfoDelete", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:42:57.654Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-infomodify-0000002295005354.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infomodify-0000002295005354.json new file mode 100644 index 0000000..b02ed9c --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-infomodify-0000002295005354.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "title": "InfoDelete" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lang-0000002649209416", + "title": "Lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "personalSettingPath", + "O", + "String(500)", + "访问路径。" + ], + [ + "personalType", + "O", + "String(500)", + "涉及个人信息种类。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354" + } + ], + "title": "InfoModify", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:45:19.125Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-lang-0000002649209416.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-lang-0000002649209416.json new file mode 100644 index 0000000..873840b --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-lang-0000002649209416.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "title": "InfoModify" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lang-0000002649209416", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "O", + "String", + "当前语言种类。 取值范围: zh_cn:中文 en_us:英文 ru_ru:俄语" + ], + [ + "value", + "O", + "String", + "当前语言对应的角色名称。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lang-0000002649209416" + } + ], + "title": "Lang", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:45:41.135Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-langfileinfo-0000002271000653.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-langfileinfo-0000002271000653.json new file mode 100644 index 0000000..97fe36f --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-langfileinfo-0000002271000653.json @@ -0,0 +1,78 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lang-0000002649209416", + "title": "Lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-languageinfo-0000002236041462", + "title": "LanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(8)", + "语言种类。 说明 取值参见语言类型。 更新图片、视频时此参数必选。" + ], + [ + "fileInfoList", + "M", + "List", + "文件信息。 数组长度不超过20。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653" + } + ], + "title": "LangFileInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:45:43.488Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-languageinfo-0000002236041462.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-languageinfo-0000002236041462.json new file mode 100644 index 0000000..1a9b654 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-languageinfo-0000002236041462.json @@ -0,0 +1,144 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicematerial-0000002236201274", + "title": "DeviceMaterial" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342", + "title": "LawRegulationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-languageinfo-0000002236041462", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "O", + "String(8)", + "当前语言。 说明 取值参见语言类型。" + ], + [ + "appName", + "O", + "String(64)", + "当前语言的应用名称。" + ], + [ + "appDesc", + "O", + "String(8000)", + "当前语言的应用描述。" + ], + [ + "briefInfo", + "O", + "String(80)", + "当前语言的一句话简介。" + ], + [ + "newFeatures", + "O", + "String(500)", + "当前语言的新版本简介。" + ], + [ + "icon", + "O", + "String(256)", + "当前语言的图标地址。" + ], + [ + "showType", + "O", + "Integer", + "当前语言的截图展现方式。 取值范围: 0:竖屏 1:横屏" + ], + [ + "videoShowType", + "O", + "Integer", + "当前语言的视频展现方式。 取值范围: 0:竖屏 1:横屏" + ], + [ + "introPic", + "O", + "String(4096)", + "应用介绍的截图地址。 多个地址以逗号隔开,最多不超过10个地址。" + ], + [ + "introVideo", + "O", + "String(4096)", + "应用的介绍视频地址和视频截图地址。 最多5个视频,每个视频必须对应截图。 示例:[{\"videoUrl\":\"XXX/app/000/000/375/20160512143416.mp4\",\"frameUrl\":\"XXX/app/000/000/375/20160512143416.68439491.jpg\"},{\"videoUrl\":\"/app/000/000/376/20160512143416.mp4\",\"frameUrl\":\"/app/000/000/376/20160512143416.68439491.jpg\"}]" + ], + [ + "rcmdPic", + "O", + "String(4096)", + "应用的推荐截图地址。 多个地址以逗号隔开,最多不超过10个地址。" + ], + [ + "rcmdVideo", + "O", + "String(4096)", + "应用的推荐视频地址以及视频截图地址。 最多5个视频,每个视频必须对应截图。 示例:[{\"videoUrl\":\"XXX/app/000/000/375/20160512143416.mp4\",\"frameUrl\":\"XXX/app/000/000/375/20160512143416.68439491.jpg\"},{\"videoUrl\":\"/app/000/000/376/20160512143416.mp4\",\"frameUrl\":\"/app/000/000/376/20160512143416.68439491.jpg\"}]" + ], + [ + "deviceMaterials", + "O", + "List", + "设备相关的素材,包括图片、视频。 数组长度不超过6。 应用为多设备时,只显示手机的相关素材信息。 应用为单设备时,显示对应设备相关的素材信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-languageinfo-0000002236041462" + } + ], + "title": "LanguageInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:45:46.467Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-lawregulationmode-0000002295005342.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-lawregulationmode-0000002295005342.json new file mode 100644 index 0000000..6a64136 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-lawregulationmode-0000002295005342.json @@ -0,0 +1,68 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "title": "ServiceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-languageinfo-0000002236041462", + "title": "LanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "title": "ManagePersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "serviceTypeInfos", + "O", + "List", + "产品提供的功能。 数组长度不超过100。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342" + } + ], + "title": "LawRegulationMode", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:45:49.281Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-managepersionalinfo-0000002328924985.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-managepersionalinfo-0000002328924985.json new file mode 100644 index 0000000..00886f9 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-managepersionalinfo-0000002328924985.json @@ -0,0 +1,108 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "title": "InfoAccess" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "title": "InfoModify" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "title": "InfoDelete" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "title": "InfoCancel" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237", + "title": "ServiceStop" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342", + "title": "LawRegulationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-memberrolelist-0000002679449001", + "title": "MemberRoleList" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "infoAccess", + "O", + "InfoAccess", + "访问记录。" + ], + [ + "infoModify", + "O", + "InfoModify", + "修改记录。" + ], + [ + "infoDelete", + "O", + "InfoDelete", + "删除记录。" + ], + [ + "infoCancel", + "O", + "InfoCancel", + "撤销记录。" + ], + [ + "serviceStop", + "O", + "ServiceStop", + "服务暂停记录。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985" + } + ], + "title": "ManagePersonalInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:33.598Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-memberrolelist-0000002679449001.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-memberrolelist-0000002679449001.json new file mode 100644 index 0000000..1b9ef91 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-memberrolelist-0000002679449001.json @@ -0,0 +1,92 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-role-0000002679289169", + "title": "Role" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "title": "ManagePersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-opentestinfo-0000002678282119", + "title": "OpenTestInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-memberrolelist-0000002679449001", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "uid", + "O", + "String", + "团队成员的账号ID。" + ], + [ + "huaweiAccountName", + "O", + "String", + "团队成员的华为账号名称。" + ], + [ + "memberNickName", + "O", + "String", + "团队成员的昵称。" + ], + [ + "memberState", + "O", + "Integer", + "团队成员的状态。 取值范围: 1:邀请中 2:邀请过期 3:生效中 4:过期" + ], + [ + "roles", + "O", + "List", + "团队成员的角色。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-memberrolelist-0000002679449001" + } + ], + "title": "MemberRoleList", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:45:52.006Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-opentestinfo-0000002678282119.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-opentestinfo-0000002678282119.json new file mode 100644 index 0000000..3825948 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-opentestinfo-0000002678282119.json @@ -0,0 +1,86 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-publish-api-data-testtaskinfo-0000002648371004", + "title": "TestTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-memberrolelist-0000002679449001", + "title": "MemberRoleList" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-otherratingresult-0000002621935699", + "title": "OtherRatingResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-opentestinfo-0000002678282119", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "startTime", + "M", + "Integer(64)", + "测试版本开始时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + ], + [ + "endTime", + "M", + "Integer(64)", + "测试版本结束时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + ], + [ + "testDesc", + "O", + "String(50)", + "测试版本描述。" + ], + [ + "testTaskInfo", + "O", + "TestTaskInfo", + "测试发布信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-opentestinfo-0000002678282119" + } + ], + "title": "OpenTestInfo", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:45:54.353Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-otherratingresult-0000002621935699.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-otherratingresult-0000002621935699.json new file mode 100644 index 0000000..c54e330 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-otherratingresult-0000002621935699.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-opentestinfo-0000002678282119", + "title": "OpenTestInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packageinfo-0000002328964965", + "title": "PackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-otherratingresult-0000002621935699", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "gradeTypeId", + "O", + "Integer(32)", + "年龄分级标准ID。 取值范围: 7:巴西分级" + ], + [ + "gradeTypeName", + "O", + "String(32)", + "年龄分级标准。 取值范围: ClassInd:巴西分级" + ], + [ + "ratingResult", + "O", + "Integer(32)", + "年龄分级结果。 取值范围: 1:所有年龄段 2:年满6周岁 3:年满10周岁 4:年满12周岁 5:年满14周岁 6:年满16周岁 7:年满18周岁" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-otherratingresult-0000002621935699" + } + ], + "title": "OtherRatingResult", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:46:12.540Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-packageinfo-0000002328964965.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-packageinfo-0000002328964965.json new file mode 100644 index 0000000..d38a448 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-packageinfo-0000002328964965.json @@ -0,0 +1,98 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-allpermission-0000002295046904", + "title": "AllPermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-otherratingresult-0000002621935699", + "title": "OtherRatingResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "title": "PackagePermissionIntroVideo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packageinfo-0000002328964965", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "packageId", + "O", + "String", + "软件包ID。" + ], + [ + "fileName", + "O", + "String", + "软件包文件名称。" + ], + [ + "versionCode", + "O", + "Integer(64)", + "版本号,对应软件包中的versionCode。" + ], + [ + "versionName", + "O", + "String", + "版本描述,对应软件包中的versionName。" + ], + [ + "buildVersion", + "O", + "String", + "构建版本号,用于区分同一主版本下的不同测试子版本。" + ], + [ + "allPermissions", + "O", + "List", + "所有权限信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packageinfo-0000002328964965" + } + ], + "title": "PackageInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:46:15.456Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-packagestates-0000002271160601.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-packagestates-0000002271160601.json new file mode 100644 index 0000000..bf75fbb --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-packagestates-0000002271160601.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "title": "PackagePermissionIntroVideo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-pair-0000002271000645", + "title": "Pair" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packagestates-0000002271160601", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "pkgId", + "M", + "String(64)", + "软件包ID。" + ], + [ + "successStatus", + "M", + "Integer(32)", + "软件包状态汇总结果。 取值范围: 0:正常 1:解析中 2:失败,表示软件包不可用。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packagestates-0000002271160601" + } + ], + "title": "PackageStates", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:46:21.245Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-pair-0000002271000645.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-pair-0000002271000645.json new file mode 100644 index 0000000..722f477 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-pair-0000002271000645.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packagestates-0000002271160601", + "title": "PackageStates" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "title": "Permission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-pair-0000002271000645", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "key", + "O", + "String(128)", + "应用名称。" + ], + [ + "value", + "O", + "String(128)", + "应用包名对应的应用ID。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-pair-0000002271000645" + } + ], + "title": "Pair", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:46:24.292Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-permission-0000002328924977.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-permission-0000002328924977.json new file mode 100644 index 0000000..fe2f626 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-permission-0000002328924977.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-pair-0000002271000645", + "title": "Pair" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "title": "PersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "permissionName", + "O", + "String(100)", + "权限名称。" + ], + [ + "permissionDesc", + "O", + "String(500)", + "权限描述。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977" + } + ], + "title": "Permission", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:52:31.289Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-personalinfo-0000002328805173.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-personalinfo-0000002328805173.json new file mode 100644 index 0000000..8c664a1 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-personalinfo-0000002328805173.json @@ -0,0 +1,118 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294", + "title": "RequiredInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "title": "RecommendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "title": "AdsInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "title": "FullServiceMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "title": "ContractObligationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342", + "title": "LawRegulationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "title": "Permission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597", + "title": "PhasedReleaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "requiredInfo", + "O", + "RequiredInfo", + "请求信息。" + ], + [ + "recommendInfo", + "O", + "RecommendInfo", + "推荐信息。" + ], + [ + "adsInfo", + "O", + "AdsInfo", + "广告信息。" + ], + [ + "fullServiceMode", + "O", + "FullServiceMode", + "服务方式。" + ], + [ + "contractObligationMode", + "O", + "ContractObligationMode", + "合同义务模式。" + ], + [ + "lawRegulationMode", + "O", + "LawRegulationMode", + "法律规则模式。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173" + } + ], + "title": "PersonalInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:35.130Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597.json new file mode 100644 index 0000000..3095172 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597.json @@ -0,0 +1,94 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "title": "PersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "title": "QualificationFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "state", + "O", + "String(32)", + "分阶段发布状态。 取值范围: DRAFT:草稿 SUSPEND:暂停 RELEASE:发布中 CANCEL:取消 更新分阶段发布信息时,此字段不可更改;更改分阶段发布状态时,此字段可更改。" + ], + [ + "description", + "O", + "String(500)", + "分阶段发布说明。" + ], + [ + "releaseTime", + "O", + "Integer(64)", + "分阶段发布时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1675992294335" + ], + [ + "latestSuspendTime", + "O", + "Integer(64)", + "分阶段发布最近暂停时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1675992294335" + ], + [ + "totalSuspendDays", + "O", + "Integer(32)", + "分阶段发布累计暂停天数。" + ], + [ + "currentPhaseDay", + "O", + "Integer(32)", + "当前分阶段天数,第N天。 取值范围1、2、3、4、5、6、7,对应分阶段发布百分比为1%、2%、5%、10%、20%、50%、100%。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597" + } + ], + "title": "PhasedReleaseInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:52:37.294Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualificationfileinfo-0000002271160609.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualificationfileinfo-0000002271160609.json new file mode 100644 index 0000000..8c16d46 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualificationfileinfo-0000002271160609.json @@ -0,0 +1,94 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597", + "title": "PhasedReleaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "title": "QualificationInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "objectId", + "M", + "String(128)", + "资质上传的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ], + [ + "fileName", + "M", + "String(128)", + "资质文件名称。" + ], + [ + "fileSize", + "M", + "Integer(64)", + "资质文件大小。 单位:字节" + ], + [ + "sha256", + "M", + "String(128)", + "资质文件SHA256值。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609" + } + ], + "title": "QualificationFileInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:52:46.850Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualificationinfo-0000002236201286.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualificationinfo-0000002236201286.json new file mode 100644 index 0000000..75072fa --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualificationinfo-0000002236201286.json @@ -0,0 +1,96 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-qualificationcode-0000002422741790", + "title": "资质编码与资质文件对照表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "title": "QualificationFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "title": "QualificationFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665", + "title": "QualReviewTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "qualificationCode", + "M", + "String(32)", + "资质编码,具体请参见资质编码与资质文件对照表。" + ], + [ + "qualificationFileInfos", + "M", + "List", + "资质文件信息列表。 数组长度不超过10。" + ], + [ + "validityType", + "M", + "Integer(32)", + "资质有效期类型。 取值类型: 0:自定义有效期 1:永久有效 默认值:0" + ], + [ + "startTime", + "O", + "String(20)", + "资质有效期开始时间。 UTC时间格式:yyyy-MM-dd 示例:2024-05-10" + ], + [ + "expireTime", + "O", + "String(20)", + "资质有效期结束时间。 UTC时间格式:yyyy-MM-dd 示例:2024-05-10 说明 请保证剩余有效期大于30天。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286" + } + ], + "title": "QualificationInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:18:23.787Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665.json new file mode 100644 index 0000000..4888f0a --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665.json @@ -0,0 +1,116 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "title": "QualificationInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "title": "QualificationInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "title": "RecommendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "O", + "String(32)", + "应用ID。" + ], + [ + "tagId", + "O", + "String(64)", + "标签ID。" + ], + [ + "taskId", + "O", + "String(32)", + "资质审核任务ID。" + ], + [ + "isMainTag", + "O", + "Integer(32)", + "是否为主标签。 取值范围: 0:否 1:是" + ], + [ + "state", + "O", + "Integer(32)", + "资质审核任务状态。 取值范围: 0:待提交 1:待审核 2:已通过 3:未通过 4:已过期 5:已失效" + ], + [ + "qualificationInfos", + "O", + "List", + "标签对应的资质信息列表。 数组长度不超过10。" + ], + [ + "lastAuditResult", + "O", + "String(10000)", + "资质审核意见。" + ], + [ + "createTime", + "O", + "Integer(64)", + "资质审核提交时间。" + ], + [ + "updateTime", + "O", + "Integer(64)", + "资质审核状态更新时间。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665" + } + ], + "title": "QualReviewTaskInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:53:23.370Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-recommendinfo-0000002328805177.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-recommendinfo-0000002328805177.json new file mode 100644 index 0000000..27fe382 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-recommendinfo-0000002328805177.json @@ -0,0 +1,74 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665", + "title": "QualReviewTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294", + "title": "RequiredInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "sceneItems", + "O", + "List", + "收集的数据信息。 数组长度不超过200。" + ], + [ + "closeSetting", + "O", + "String(500)", + "关闭设置。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177" + } + ], + "title": "RecommendInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:53:27.734Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-requiredinfo-0000002295005294.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-requiredinfo-0000002295005294.json new file mode 100644 index 0000000..d795687 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-requiredinfo-0000002295005294.json @@ -0,0 +1,68 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "title": "RecommendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-role-0000002679289169", + "title": "Role" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "sceneItems", + "O", + "List", + "收集的请求信息。 数组长度不超过200。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294" + } + ], + "title": "RequiredInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:36.673Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-role-0000002679289169.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-role-0000002679289169.json new file mode 100644 index 0000000..9bb2cb4 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-role-0000002679289169.json @@ -0,0 +1,80 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lang-0000002649209416", + "title": "Lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294", + "title": "RequiredInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-role-0000002679289169", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "name", + "O", + "List", + "角色名称。" + ], + [ + "createTime", + "O", + "String", + "角色创建时间。 UTC格式:yyyy-MM-dd'T'HH:mm:ss 示例:2026-07-21 11:55:28" + ], + [ + "updateTime", + "O", + "String", + "角色最近更新时间。 UTC格式:yyyy-MM-dd'T'HH:mm:ss 示例:2026-07-21 11:55:28" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-role-0000002679289169" + } + ], + "title": "Role", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:53:49.903Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-sceneitem-0000002294845634.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-sceneitem-0000002294845634.json new file mode 100644 index 0000000..8a970d9 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-sceneitem-0000002294845634.json @@ -0,0 +1,110 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "title": "DataItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-role-0000002679289169", + "title": "Role" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "title": "SdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "dataItems", + "O", + "List", + "数据信息。 数组长度不超过200。" + ], + [ + "sceneId", + "O", + "String(64)", + "收集项用途ID。" + ], + [ + "sceneReason", + "O", + "String(500)", + "收集项用途描述。" + ], + [ + "collectModeId", + "O", + "String(64)", + "收集方式ID。" + ], + [ + "collectMode", + "O", + "String(500)", + "收集方式描述。" + ], + [ + "legalBasisId", + "O", + "String(64)", + "法律基础ID。" + ], + [ + "legalBasis", + "O", + "String(500)", + "法律基础描述。" + ], + [ + "remark", + "O", + "String(500)", + "补充说明。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634" + } + ], + "title": "SceneItem", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:53:56.907Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-sdkinfo-0000002295005346.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-sdkinfo-0000002295005346.json new file mode 100644 index 0000000..77ffa80 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-sdkinfo-0000002295005346.json @@ -0,0 +1,110 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237", + "title": "ServiceStop" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "name", + "O", + "String(100)", + "SDK名称。" + ], + [ + "providerName", + "O", + "String(100)", + "SDK提供方名称。" + ], + [ + "version", + "O", + "String(100)", + "SDK版本号。" + ], + [ + "privacyDeclare", + "O", + "String(512)", + "SDK隐私声明。" + ], + [ + "privacyLabels", + "O", + "List", + "SDK收集的信息。 数组长度不超过200。" + ], + [ + "scene", + "O", + "String(200)", + "使用场景。" + ], + [ + "collectType", + "O", + "String(100)", + "收集方式。" + ], + [ + "purpose", + "O", + "String(500)", + "使用目的。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346" + } + ], + "title": "SdkInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:00.224Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-servicestop-0000002328805237.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-servicestop-0000002328805237.json new file mode 100644 index 0000000..f345fe6 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-servicestop-0000002328805237.json @@ -0,0 +1,64 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "title": "SdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "title": "ServiceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "personalSettingPath", + "O", + "String(500)", + "访问路径。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237" + } + ], + "title": "ServiceStop", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:11.056Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-servicetypeinfo-0000002328805213.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-servicetypeinfo-0000002328805213.json new file mode 100644 index 0000000..d1998c6 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-servicetypeinfo-0000002328805213.json @@ -0,0 +1,74 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237", + "title": "ServiceStop" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "title": "StorageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "serviceType", + "O", + "String(100)", + "产品功能。" + ], + [ + "sceneItems", + "O", + "List", + "产品收集的信息。 数组长度不超过200。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213" + } + ], + "title": "ServiceTypeInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:13.071Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-storageinfo-0000002295005350.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-storageinfo-0000002295005350.json new file mode 100644 index 0000000..61d53c5 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-storageinfo-0000002295005350.json @@ -0,0 +1,104 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "title": "ServiceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-subagreement-0000002328805241", + "title": "SubAgreement" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "storagePeriod", + "O", + "String(512)", + "开发者对信息的存储期限。 取值范围: -1:表示最短期限。 其他取值表示由开发者填写。" + ], + [ + "country", + "O", + "String(100)", + "服务器所在国家。 示例:中国境内" + ], + [ + "isCrossBorder", + "O", + "boolean", + "是否跨境。 取值范围: true:表示跨境 false:表示未跨境" + ], + [ + "crossBorderReason", + "O", + "String(500)", + "跨境处理原因。" + ], + [ + "crossBorderReceiveName", + "O", + "String(100)", + "跨境接收方名称/姓名。" + ], + [ + "crossBorderDeclarations", + "O", + "List", + "跨境收集的信息。 数组长度不超过200。" + ], + [ + "crossBorderCountry", + "O", + "String(100)", + "跨境之后存储的国家/地区。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350" + } + ], + "title": "StorageInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:15.365Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-subagreement-0000002328805241.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-subagreement-0000002328805241.json new file mode 100644 index 0000000..92f89a7 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-subagreement-0000002328805241.json @@ -0,0 +1,134 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "title": "AgreementInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "title": "StorageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqual-0000002236201282", + "title": "TagQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-subagreement-0000002328805241", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "id", + "O", + "String", + "隐私政策协议ID。" + ], + [ + "srcAgreementId", + "O", + "String", + "源隐私政策协议ID。" + ], + [ + "templateId", + "O", + "String", + "隐私政策协议模板ID。" + ], + [ + "templateType", + "O", + "Integer(32)", + "隐私政策协议模板类型。 取值范围: 空 1:元服务模板 2:HarmonyOS应用模板" + ], + [ + "type", + "O", + "Integer(32)", + "协议类型。 取值范围: 1:隐私政策协议" + ], + [ + "agreementInfos", + "O", + "List", + "隐私政策协议列表。 数组长度不超过100。" + ], + [ + "versionCode", + "O", + "Integer(64)", + "隐私政策协议版本号。" + ], + [ + "status", + "O", + "Integer", + "隐私政策协议状态。 取值范围: 1:草稿 2:已完成 3:已删除 不传值:默认查未删除的记录" + ], + [ + "lastAuditResult", + "O", + "String", + "CMS审核结果。 说明 若隐私政策协议被在架版本关联,编辑后需要提交华为运营审核,待协议审核通过后,更新的内容方可生效。 若结果为“审核中”,或隐私政策协议被状态为“审核中”的应用关联,将不支持编辑。" + ], + [ + "urls", + "O", + "List", + "url列表,多语言的后面对应拼接不同的语言,从隐私政策协议模板中获取对应的url,进行拼接。 数组长度为1~100。" + ], + [ + "createTime", + "O", + "Integer(64)", + "隐私政策协议创建时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1733555215000" + ], + [ + "updateTime", + "O", + "Integer(64)", + "隐私政策协议最近更新时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1733555215000" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-subagreement-0000002328805241" + } + ], + "title": "SubAgreement", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:38.330Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-tagqual-0000002236201282.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-tagqual-0000002236201282.json new file mode 100644 index 0000000..ed64bdd --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-tagqual-0000002236201282.json @@ -0,0 +1,78 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-apptype-0000002271160689#section06007445916", + "title": "元服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentqual-0000002271160605", + "title": "DependentQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-subagreement-0000002328805241", + "title": "SubAgreement" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "title": "TagQualInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqual-0000002236201282", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "tagId", + "O", + "String", + "标签ID。 说明 具体取值请参见元服务的“标签ID”列。" + ], + [ + "dependentQuals", + "O", + "List", + "标签所依赖的资质信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqual-0000002236201282" + } + ], + "title": "TagQual", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:29.675Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-tagqualinfo-0000002236041478.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-tagqualinfo-0000002236041478.json new file mode 100644 index 0000000..a85e5f1 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-tagqualinfo-0000002236041478.json @@ -0,0 +1,84 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-put-qualification-review-0000002422530746", + "title": "修改资质审核任务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "title": "QualificationInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqual-0000002236201282", + "title": "TagQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-publish-api-data-testtaskinfo-0000002648371004", + "title": "TestTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "tagId", + "M", + "String(64)", + "标签ID。" + ], + [ + "taskId", + "O", + "String(32)", + "资质审核任务ID。 说明 修改资质审核任务时,此参数必传。" + ], + [ + "qualificationInfos", + "O", + "List", + "标签对应的资质信息列表。 数组长度不超过10。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478" + } + ], + "title": "TagQualInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:31.433Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-thirdsdkinfo-0000002328805217.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-thirdsdkinfo-0000002328805217.json new file mode 100644 index 0000000..592c721 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-thirdsdkinfo-0000002328805217.json @@ -0,0 +1,68 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "title": "SdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-publish-api-data-testtaskinfo-0000002648371004", + "title": "TestTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "title": "ThirdSharedInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "sdkInfos", + "O", + "List", + "SDK详细信息。 数组长度不超过50。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217" + } + ], + "title": "ThirdSdkInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:46.745Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-thirdsharedinfo-0000002294845678.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-thirdsharedinfo-0000002294845678.json new file mode 100644 index 0000000..906b95b --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-thirdsharedinfo-0000002294845678.json @@ -0,0 +1,110 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "title": "DataItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "title": "ThirdSdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "title": "VersionChangeDesc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "name", + "O", + "String(100)", + "第三方名称。" + ], + [ + "purpose", + "O", + "String(500)", + "使用目的。" + ], + [ + "personalType", + "O", + "String(500)", + "涉及个人信息的种类。" + ], + [ + "officialPrivacyUrl", + "O", + "String(1024)", + "第三方的官网链接和隐私政策链接。" + ], + [ + "serviceType", + "O", + "String(100)", + "共享信息的服务类型。" + ], + [ + "scene", + "O", + "String(200)", + "使用场景。" + ], + [ + "shareType", + "O", + "String(100)", + "共享方式。" + ], + [ + "dataItems", + "O", + "List", + "第三方数据信息。 数组长度不超过200。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678" + } + ], + "title": "ThirdSharedInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:48.263Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-versionchangedesc-0000002294845686.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-versionchangedesc-0000002294845686.json new file mode 100644 index 0000000..c62b026 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-versionchangedesc-0000002294845686.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "title": "ThirdSharedInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "title": "VersionVoc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "chapter", + "O", + "String(50)", + "版本变更章节。" + ], + [ + "desc", + "O", + "String(500)", + "版本变更说明。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686" + } + ], + "title": "VersionChangeDesc", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:50.080Z" +} diff --git a/pkg/domain/reference/supplemental/agc-help-publish-api-data-versionvoc-0000002495156924.json b/pkg/domain/reference/supplemental/agc-help-publish-api-data-versionvoc-0000002495156924.json new file mode 100644 index 0000000..e7827f8 --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-help-publish-api-data-versionvoc-0000002495156924.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "title": "VersionChangeDesc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-errorcode-0000002271000673", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "版本号。" + ], + [ + "packageId", + "M", + "String(32)", + "软件包ID。" + ], + [ + "vocId", + "M", + "String(32)", + "问题工单ID。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924" + } + ], + "title": "VersionVoc", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:54:51.580Z" +} diff --git a/pkg/domain/reference/supplemental/agc-publish-api-data-testtaskinfo-0000002648371004.json b/pkg/domain/reference/supplemental/agc-publish-api-data-testtaskinfo-0000002648371004.json new file mode 100644 index 0000000..071983d --- /dev/null +++ b/pkg/domain/reference/supplemental/agc-publish-api-data-testtaskinfo-0000002648371004.json @@ -0,0 +1,92 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-groupinfo-0000002678290865", + "title": "GroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "title": "TagQualInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "title": "ThirdSdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-publish-api-data-testtaskinfo-0000002648371004", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupInfos", + "M", + "List", + "测试用户信息。 注意 公开测试不支持修改。" + ], + [ + "needShareLink", + "O", + "Integer", + "是否需要生成分享链接。 取值范围: 0:不需要。 1:需要。" + ], + [ + "publicTestInstallLimit", + "O", + "Integer", + "公开测试安装次数上限。 默认值:10万次 注意 仅公开测试支持填写此字段。" + ], + [ + "displayArea", + "O", + "String(32)", + "展示区域。 取值范围: 1:AppGallery客户端测试专区 说明 邀请测试该字段必填。 公开测试该字段选填。" + ], + [ + "needNotify", + "O", + "Integer(32)", + "是否向用户发送测试通知。 取值范围: 0:不需要 1:需要 默认值:1" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-publish-api-data-testtaskinfo-0000002648371004" + } + ], + "title": "TestTaskInfo", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:54:33.306Z" +} diff --git a/pkg/domain/reference/supplemental/application-file-requirements.json b/pkg/domain/reference/supplemental/application-file-requirements.json new file mode 100644 index 0000000..ed0975b --- /dev/null +++ b/pkg/domain/reference/supplemental/application-file-requirements.json @@ -0,0 +1,335 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-0000002271000741", + "title": "附录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-pi-appendix-pricechange-0000002236201366", + "title": "价格换算规则" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-application-status-0000002240477940", + "title": "应用状态说明" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-requirement-0000002271160693#section105771837135714", + "title": "HarmonyOS应用" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-requirement-0000002271160693#section14145104111518", + "title": "元服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-requirement-0000002271160693", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "文件类型", + "说明", + "支持设备", + "文件大小", + "分辨率", + "支持格式" + ], + [ + "应用图标", + "只能1个图标", + "手机", + "PNG最大3MB,WEBP最大100KB", + "216*216或1024*1024", + "PNG/WEBP" + ], + [ + "应用图标", + "只能1个图标", + "平板", + "PNG最大3MB,WEBP最大100KB", + "216*216或1024*1024", + "PNG/WEBP" + ], + [ + "应用图标", + "只能1个图标", + "PC/2in1", + "最大3MB", + "216*216或1024*1024", + "PNG" + ], + [ + "应用图标", + "只能1个图标", + "智慧屏", + "PNG/JPG/JPEG最大3MB,WEBP最大100KB", + "1024*1024", + "JPG/JPEG/PNG/WEBP" + ], + [ + "应用图标", + "只能1个图标", + "手表", + "PNG最大3MB,WEBP最大100KB", + "216*216或1024*1024", + "PNG/WEBP" + ], + [ + "应用介绍视频", + "最多3个视频", + "手机", + "最大500MB,视频时长15秒-2分钟", + "竖屏:720*1280或1080*1920 横屏:1280*720或1920*1080", + "MOV/MP4" + ], + [ + "应用介绍视频", + "最多3个视频", + "平板", + "最大500MB,视频时长15秒-2分钟", + "竖屏:1280*1920 横屏:1920*1280", + "MOV/MP4" + ], + [ + "应用介绍视频", + "最多3个视频", + "PC/2in1、智慧屏、手表", + "不支持", + "不支持", + "不支持" + ], + [ + "应用介绍视频对应海报", + "视频海报与应用介绍视频的数量需要一致,且必须按照xx1.mp4,xx1.png,xx2.mp4,xx2.png这样的顺序才能成功上传", + "手机、平板", + "PNG/JPG/JPEG最大2MB,WEBP最大100KB", + "竖屏:450*800 横屏:800*450", + "JPG/JPEG/PNG/WEBP" + ], + [ + "应用介绍视频对应海报", + "视频海报与应用介绍视频的数量需要一致,且必须按照xx1.mp4,xx1.png,xx2.mp4,xx2.png这样的顺序才能成功上传", + "PC/2in1、智慧屏、手表", + "不支持", + "不支持", + "不支持" + ], + [ + "应用介绍截图", + "应用介绍截图", + "手机", + "PNG/JPG/JPEG最大5MB,WEBP最大200KB,3-10张", + "竖屏:1080*1920 横屏:1920*1080", + "JPG/JPEG/PNG/WEBP" + ], + [ + "应用介绍截图", + "应用介绍截图", + "平板", + "PNG/JPG/JPEG最大5MB,WEBP最大200KB,3-10张", + "竖屏:1280*1920 横屏:1920*1280", + "JPG/JPEG/PNG/WEBP" + ], + [ + "应用介绍截图", + "应用介绍截图", + "PC/2in1", + "最大5MB,3-10张", + "1920*1280", + "JPG/JPEG/PNG" + ], + [ + "应用介绍截图", + "应用介绍截图", + "智慧屏", + "PNG/JPG/JPEG最大2MB,WEBP最大100KB,5-8张", + "1920*1080", + "JPG/JPEG/PNG/WEBP" + ], + [ + "应用介绍截图", + "应用介绍截图", + "手表", + "PNG/JPG/JPEG最大2MB,WEBP最大100KB,4-8张", + "840*840", + "JPG/JPEG/PNG/WEBP" + ], + [ + "推荐视频", + "推荐视频将展示在应用详情页的顶部,仅开放给联运等项目开发者使用", + "手机、平板", + "最大500MB,视频时长15秒-2分钟", + "1600*1200或1200*900", + "MOV/MP4" + ], + [ + "推荐视频", + "推荐视频将展示在应用详情页的顶部,仅开放给联运等项目开发者使用", + "PC/2in1、智慧屏、手表", + "不支持", + "不支持", + "不支持" + ], + [ + "推荐视频对应的海报", + "推荐视频对应的海报,海报个数与视频个数一致", + "手机、平板", + "PNG/JPG/JPEG最大2MB,WEBP最大100KB", + "不小于960*720,宽高比为4:3", + "JPG/JPEG/PNG/WEBP" + ], + [ + "推荐视频对应的海报", + "推荐视频对应的海报,海报个数与视频个数一致", + "PC/2in1、智慧屏、手表", + "不支持", + "不支持", + "不支持" + ], + [ + "推荐图片", + "应用的推荐图片", + "智慧屏", + "PNG/JPG/JPEG最大2MB,WEBP最大100KB,4张", + "分辨率必须按照396*223、414*573、1920*1080、880*494的顺序更新", + "JPG/JPEG/PNG/WEBP" + ], + [ + "推荐图片", + "应用的推荐图片", + "手机、平板、PC/2in1、手表", + "不支持", + "不支持", + "不支持" + ], + [ + "更新截图", + "截图将在应用详情页最近更新模块展示", + "手机、平板、PC/2in1", + "PNG/JPG/JPEG最大5MB,WEBP最大200KB", + "1920*1080", + "JPG/JPEG/PNG/WEBP" + ], + [ + "更新截图", + "截图将在应用详情页最近更新模块展示", + "智慧屏、手表", + "不支持", + "不支持", + "不支持" + ], + [ + "更新视频", + "视频将在应用详情页最近更新模块展示", + "手机、平板、PC/2in1", + "最大500MB,视频时长15秒-2分钟", + "1920*1080", + "MOV/MP4" + ], + [ + "更新视频", + "视频将在应用详情页最近更新模块展示", + "智慧屏、手表", + "不支持", + "不支持", + "不支持" + ], + [ + "软件包", + "应用软件包", + "所有", + "APP最大4GB。", + "不涉及", + "APP" + ], + [ + "应用版权证书或代理证书", + "《免责函》、《计算机软件著作权证书》和其他资质文件,最多10张", + "手机、平板、PC/2in1、智慧屏、手表", + "最大15MB", + "无要求", + "JPG/PNG/BMP" + ], + [ + "电子证书PDF文件", + "包含电子版权证书", + "所有", + "最大5MB", + "不涉及", + "PDF" + ], + [ + "文化部版号截图", + "游戏版号信息、版号证明,最多5张", + "手机、平板、PC/2in1、智慧屏、手表", + "最大4MB", + "无要求", + "JPG/JPEG/PNG/PDF" + ], + [ + "HarmonyOS应用受限权限使用说明视频", + "1个", + "手机、平板、PC/2in1、智慧屏、手表", + "最大500MB", + "不涉及", + "MOV/MP4" + ] + ], + "section": "HarmonyOS应用", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-requirement-0000002271160693#section105771837135714" + }, + { + "location": "", + "rows": [ + [ + "文件类型", + "说明", + "支持设备", + "文件大小", + "分辨率", + "支持格式" + ], + [ + "应用图标", + "只能1个图标", + "手机、平板、PC/2in1、手表", + "最大500KB", + "216*216", + "PNG" + ], + [ + "应用图标", + "只能1个图标", + "智慧屏", + "最大3MB", + "1024*1024", + "JPG/JPEG/PNG" + ] + ], + "section": "元服务", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-requirement-0000002271160693#section14145104111518" + } + ], + "title": "应用文件要求", + "updatedAt": "2026-07-09 10:15", + "checkedAt": "2026-10-07T03:08:01.011Z" +} diff --git a/pkg/domain/reference/supplemental/defaultproductpriceinfo-android.json b/pkg/domain/reference/supplemental/defaultproductpriceinfo-android.json new file mode 100644 index 0000000..fe38e67 --- /dev/null +++ b/pkg/domain/reference/supplemental/defaultproductpriceinfo-android.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-android-0000002135929332", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-cpriceinfo-android-0000002136087424", + "title": "CountryPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-android-0000002171288633", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "country", + "M", + "String", + "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。" + ], + [ + "price", + "O", + "String", + "商品原始价格,如果商品为上线状态,则此字段不能为空。" + ], + [ + "currency", + "M", + "String", + "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033" + } + ], + "title": "DefaultProductPriceInfo", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:15:18.395Z" +} diff --git a/pkg/domain/reference/supplemental/defaultproductpriceinfo-harmonyosnext.json b/pkg/domain/reference/supplemental/defaultproductpriceinfo-harmonyosnext.json new file mode 100644 index 0000000..671ab75 --- /dev/null +++ b/pkg/domain/reference/supplemental/defaultproductpriceinfo-harmonyosnext.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-harmonyosnext-0000002166748621", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-cpriceinfo-harmonyosnext-0000002166670153", + "title": "CountryPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-errorresult-harmonyosnext-0000002131350724", + "title": "ErrorResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "country", + "M", + "String", + "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。" + ], + [ + "price", + "O", + "String", + "商品原始价格,如果商品为上线状态,则此字段不能为空。" + ], + [ + "currency", + "M", + "String", + "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864" + } + ], + "title": "DefaultProductPriceInfo", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:14:39.084Z" +} diff --git a/pkg/domain/reference/supplemental/developer-project-id-guide.json b/pkg/domain/reference/supplemental/developer-project-id-guide.json new file mode 100644 index 0000000..4bea397 --- /dev/null +++ b/pkg/domain/reference/supplemental/developer-project-id-guide.json @@ -0,0 +1,32 @@ +{ + "title": "Querying Your Developer ID and Project ID", + "sourceUrl": "https://developer.huawei.com/consumer/jp/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "status": "browser-read", + "tables": [], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/jp/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "text": "To find you developer ID and project ID, perform the following steps:" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/jp/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "text": "Sign in to AppGallery Connect and click Development and services." + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/jp/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "text": "Find your project from the project list and choose the app for which you need to query the developer ID or project ID." + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/jp/doc/AppGallery-connect-Guides/agc-get-developerid-projectid-0000001166543063", + "text": "Go to Project settings > General information and check the Developer ID and Project ID parameters." + } + ], + "examples": [], + "links": [], + "checkedAt": "2026-10-07T05:03:26.126Z", + "renderedText": "Querying Your Developer ID and Project ID\nLast updated: 2026-04-09 17:57\n\nTo find you developer ID and project ID, perform the following steps:\n\nSign in to AppGallery Connect and click Development and services.\nFind your project from the project list and choose the app for which you need to query the developer ID or project ID.\nGo to Project settings > General information and check the Developer ID and Project ID parameters.\n\nSend feedback\nWas this page helpful?\nSend feedback\nReach out to us through the community for any other questions.\nCommunity Q&AIntelligent Assistant\n©2025 HUAWEI Developers. All rights reserved.\n利用規約 \nHUAWEI Developerおよび個人情報保護に関する声明\nCookie\nCookieの設定\nOpen-Source Software Notice" +} diff --git a/pkg/domain/reference/supplemental/domain-info-business.json b/pkg/domain/reference/supplemental/domain-info-business.json new file mode 100644 index 0000000..38d54ac --- /dev/null +++ b/pkg/domain/reference/supplemental/domain-info-business.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-0000002237343328", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-connectret-0000002272462489", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "title": "DomainInfo2" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "type", + "M", + "String(32)", + "域名类型。 取值范围: httpRequest:httpRequest服务器域名 upload:upload服务器域名 download:download服务器域名 webSocket:webSocket服务器域名 webView:webView业务域名" + ], + [ + "value", + "M", + "String(128)", + "完整的域名。例如: https://huawei.com:8080" + ], + [ + "errorCode", + "O", + "Integer(32)", + "非法原因错误码。 新增、修改域名时如果域名不合法,返回失败原因,调用接口新增修改域名配置时无需传入。" + ], + [ + "errorMsg", + "O", + "String(128)", + "非法原因错误描述。 新增、修改域名时如果域名不合法,返回失败原因,调用接口新增修改域名配置时无需传入。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405" + } + ], + "title": "DomainInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T03:40:11.191Z" +} diff --git a/pkg/domain/reference/supplemental/domain-info-server.json b/pkg/domain/reference/supplemental/domain-info-server.json new file mode 100644 index 0000000..91b8d05 --- /dev/null +++ b/pkg/domain/reference/supplemental/domain-info-server.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-reference-0000002271160649", + "title": "Domain Management API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-0000002237343328", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo-0000002272582405", + "title": "DomainInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-errorcode-0000002362050933", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "type", + "M", + "String(32)", + "域名类型。 取值范围: httpRequest:httpRequest服务器域名 upload:upload服务器域名 download:download服务器域名 webSocket:webSocket服务器域名 webView:webView业务域名" + ], + [ + "value", + "M", + "String(128)", + "完整的域名。例如: https://huawei.com:8080" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-domain-api-data-domaininfo2-0000002273216801" + } + ], + "title": "DomainInfo2", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T03:40:04.336Z" +} diff --git a/pkg/domain/reference/supplemental/file-info.json b/pkg/domain/reference/supplemental/file-info.json new file mode 100644 index 0000000..0333d2f --- /dev/null +++ b/pkg/domain/reference/supplemental/file-info.json @@ -0,0 +1,88 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "title": "ExtFieldCustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "title": "FullServiceMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer(32)", + "设备类型。 取值范围: 4:手机 5:平板 8:智慧屏 12:智能手表 14:运动手表 19:PC/2in1" + ], + [ + "objectIdList", + "M", + "List", + "文件在OBS上的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。 数组长度不超过10。 说明 如果是应用介绍视频,最多3个视频以及对应海报。files中必须先传视频再传海报,且视频和海报必须交替上传,即先传第1组的视频再传对应的海报,再传下一组视频和海报。 如果是推荐视频,1个推荐视频以及对应海报。files中必须先传视频再传海报。" + ], + [ + "showType", + "O", + "Integer", + "当前语言的截图展现方式。 取值范围: 0:竖屏 1:横屏" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466" + } + ], + "title": "FileInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T03:08:59.060Z" +} diff --git a/pkg/domain/reference/supplemental/lang-file-info.json b/pkg/domain/reference/supplemental/lang-file-info.json new file mode 100644 index 0000000..3b78717 --- /dev/null +++ b/pkg/domain/reference/supplemental/lang-file-info.json @@ -0,0 +1,78 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lang-0000002649209416", + "title": "Lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-languageinfo-0000002236041462", + "title": "LanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(8)", + "语言种类。 说明 取值参见语言类型。 更新图片、视频时此参数必选。" + ], + [ + "fileInfoList", + "M", + "List", + "文件信息。 数组长度不超过20。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653" + } + ], + "title": "LangFileInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T03:08:48.118Z" +} diff --git a/pkg/domain/reference/supplemental/package-permission-intro-video.json b/pkg/domain/reference/supplemental/package-permission-intro-video.json new file mode 100644 index 0000000..8a323da --- /dev/null +++ b/pkg/domain/reference/supplemental/package-permission-intro-video.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(8)", + "语言种类。 说明 取值参见语言类型。" + ], + [ + "permissionName", + "M", + "String(512)", + "权限标记字符串。" + ], + [ + "deviceType", + "M", + "Integer(32)", + "设备类型。 取值范围: 4:手机 5:平板 8:智慧屏 12:智能手表 14:运动手表 19:PC/2in1" + ], + [ + "objectId", + "M", + "String(512)", + "文件在OBS上的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278" + } + ], + "title": "PackagePermissionIntroVideo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:34:59.562Z" +} diff --git a/pkg/domain/reference/supplemental/privacy-agreement-info.contract.json b/pkg/domain/reference/supplemental/privacy-agreement-info.contract.json new file mode 100644 index 0000000..1a5d26f --- /dev/null +++ b/pkg/domain/reference/supplemental/privacy-agreement-info.contract.json @@ -0,0 +1,1775 @@ +{ + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "parameters": [ + { + "name": "lang", + "in": "body", + "required": true, + "description": "语种。 取值范围: zh:简体中文 en:英语 ug:维吾尔语 bo:藏语 zh-Hant-HK:繁体中文(中国香港特别行政区) zh-Hant-TW:繁体中文(中国台湾)", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "maxLength": 20, + "type": "string", + "enum": [ + "zh", + "en", + "ug", + "bo", + "zh-Hant-HK", + "zh-Hant-TW" + ] + }, + { + "name": "baseInfo", + "in": "body", + "required": false, + "description": "隐私政策协议基础信息列表。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "properties": [ + { + "name": "name", + "in": "body", + "required": true, + "description": "隐私政策协议名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 100, + "type": "string" + }, + { + "name": "appName", + "in": "body", + "required": false, + "description": "应用名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 255, + "type": "string" + }, + { + "name": "companyName", + "in": "body", + "required": false, + "description": "公司名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 1024, + "type": "string" + }, + { + "name": "briefDesc", + "in": "body", + "required": false, + "description": "产品简介。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "maxLength": 500, + "type": "string" + }, + { + "name": "effectiveTime", + "in": "body", + "required": false, + "description": "隐私政策协议生效时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1733555215000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "type": "integer" + } + ], + "type": "object" + }, + { + "name": "personalInfo", + "in": "body", + "required": false, + "description": "个人信息详情。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "properties": [ + { + "name": "requiredInfo", + "in": "body", + "required": false, + "description": "请求信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "properties": [ + { + "name": "sceneItems", + "in": "body", + "required": false, + "description": "收集的请求信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294", + "itemsProperties": [ + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "sceneId", + "in": "body", + "required": false, + "description": "收集项用途ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "sceneReason", + "in": "body", + "required": false, + "description": "收集项用途描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "collectModeId", + "in": "body", + "required": false, + "description": "收集方式ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "collectMode", + "in": "body", + "required": false, + "description": "收集方式描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "legalBasisId", + "in": "body", + "required": false, + "description": "法律基础ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "legalBasis", + "in": "body", + "required": false, + "description": "法律基础描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "remark", + "in": "body", + "required": false, + "description": "补充说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + } + ], + "type": "object" + }, + { + "name": "recommendInfo", + "in": "body", + "required": false, + "description": "推荐信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "properties": [ + { + "name": "sceneItems", + "in": "body", + "required": false, + "description": "收集的数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "itemsProperties": [ + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "sceneId", + "in": "body", + "required": false, + "description": "收集项用途ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "sceneReason", + "in": "body", + "required": false, + "description": "收集项用途描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "collectModeId", + "in": "body", + "required": false, + "description": "收集方式ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "collectMode", + "in": "body", + "required": false, + "description": "收集方式描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "legalBasisId", + "in": "body", + "required": false, + "description": "法律基础ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "legalBasis", + "in": "body", + "required": false, + "description": "法律基础描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "remark", + "in": "body", + "required": false, + "description": "补充说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "closeSetting", + "in": "body", + "required": false, + "description": "关闭设置。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "adsInfo", + "in": "body", + "required": false, + "description": "广告信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "properties": [ + { + "name": "sceneItems", + "in": "body", + "required": false, + "description": "收集的数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "itemsProperties": [ + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "sceneId", + "in": "body", + "required": false, + "description": "收集项用途ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "sceneReason", + "in": "body", + "required": false, + "description": "收集项用途描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "collectModeId", + "in": "body", + "required": false, + "description": "收集方式ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "collectMode", + "in": "body", + "required": false, + "description": "收集方式描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "legalBasisId", + "in": "body", + "required": false, + "description": "法律基础ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "legalBasis", + "in": "body", + "required": false, + "description": "法律基础描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "remark", + "in": "body", + "required": false, + "description": "补充说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "pushContent", + "in": "body", + "required": false, + "description": "推送内容。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "maxLength": 500, + "type": "string" + }, + { + "name": "closeSetting", + "in": "body", + "required": false, + "description": "关闭设置。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "fullServiceMode", + "in": "body", + "required": false, + "description": "服务方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "properties": [ + { + "name": "selectPath", + "in": "body", + "required": false, + "description": "选择路径。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string" + }, + { + "name": "personalCollectType", + "in": "body", + "required": false, + "description": "个人信息采集类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string" + }, + { + "name": "basicServiceType", + "in": "body", + "required": false, + "description": "提供的基本功能。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string" + }, + { + "name": "extraServiceType", + "in": "body", + "required": false, + "description": "提供的附加功能。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "contractObligationMode", + "in": "body", + "required": false, + "description": "合同义务模式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "properties": [ + { + "name": "serviceType", + "in": "body", + "required": false, + "description": "产品功能。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "maxLength": 500, + "type": "string" + }, + { + "name": "personalCollectReason", + "in": "body", + "required": false, + "description": "个人信息采集用途。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "maxLength": 500, + "type": "string" + }, + { + "name": "serviceTypeInfos", + "in": "body", + "required": false, + "description": "产品提供的功能。 数组长度不超过100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "itemsProperties": [ + { + "name": "serviceType", + "in": "body", + "required": false, + "description": "产品功能。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "maxLength": 100, + "type": "string" + }, + { + "name": "sceneItems", + "in": "body", + "required": false, + "description": "产品收集的信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "itemsProperties": [ + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "sceneId", + "in": "body", + "required": false, + "description": "收集项用途ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "sceneReason", + "in": "body", + "required": false, + "description": "收集项用途描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "collectModeId", + "in": "body", + "required": false, + "description": "收集方式ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "collectMode", + "in": "body", + "required": false, + "description": "收集方式描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "legalBasisId", + "in": "body", + "required": false, + "description": "法律基础ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "legalBasis", + "in": "body", + "required": false, + "description": "法律基础描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "remark", + "in": "body", + "required": false, + "description": "补充说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 100 + } + ], + "type": "object" + }, + { + "name": "lawRegulationMode", + "in": "body", + "required": false, + "description": "法律规则模式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "properties": [ + { + "name": "serviceTypeInfos", + "in": "body", + "required": false, + "description": "产品提供的功能。 数组长度不超过100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342", + "itemsProperties": [ + { + "name": "serviceType", + "in": "body", + "required": false, + "description": "产品功能。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "maxLength": 100, + "type": "string" + }, + { + "name": "sceneItems", + "in": "body", + "required": false, + "description": "产品收集的信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "itemsProperties": [ + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "sceneId", + "in": "body", + "required": false, + "description": "收集项用途ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "sceneReason", + "in": "body", + "required": false, + "description": "收集项用途描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "collectModeId", + "in": "body", + "required": false, + "description": "收集方式ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "collectMode", + "in": "body", + "required": false, + "description": "收集方式描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "legalBasisId", + "in": "body", + "required": false, + "description": "法律基础ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "legalBasis", + "in": "body", + "required": false, + "description": "法律基础描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "remark", + "in": "body", + "required": false, + "description": "补充说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 100 + } + ], + "type": "object" + } + ], + "type": "object" + }, + { + "name": "devicePermissions", + "in": "body", + "required": false, + "description": "设备权限信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "itemsProperties": [ + { + "name": "permissions", + "in": "body", + "required": false, + "description": "权限详情。 数组长度为1~200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "itemsProperties": [ + { + "name": "permissionName", + "in": "body", + "required": false, + "description": "权限名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "maxLength": 100, + "type": "string" + }, + { + "name": "permissionDesc", + "in": "body", + "required": false, + "description": "权限描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "minItems": 1, + "maxItems": 200 + }, + { + "name": "reasonId", + "in": "body", + "required": false, + "description": "权限理由ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 64, + "type": "string" + }, + { + "name": "reason", + "in": "body", + "required": false, + "description": "权限理由描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 500, + "type": "string" + }, + { + "name": "groupId", + "in": "body", + "required": false, + "description": "权限groupId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 100, + "type": "string" + }, + { + "name": "groupName", + "in": "body", + "required": false, + "description": "权限groupName。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "maxLength": 256, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "thirdSdkInfo", + "in": "body", + "required": false, + "description": "三方SDK信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "properties": [ + { + "name": "sdkInfos", + "in": "body", + "required": false, + "description": "SDK详细信息。 数组长度不超过50。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "required": false, + "description": "SDK名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string" + }, + { + "name": "providerName", + "in": "body", + "required": false, + "description": "SDK提供方名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string" + }, + { + "name": "version", + "in": "body", + "required": false, + "description": "SDK版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string" + }, + { + "name": "privacyDeclare", + "in": "body", + "required": false, + "description": "SDK隐私声明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 512, + "type": "string" + }, + { + "name": "privacyLabels", + "in": "body", + "required": false, + "description": "SDK收集的信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "itemsProperties": [ + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "sceneId", + "in": "body", + "required": false, + "description": "收集项用途ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "sceneReason", + "in": "body", + "required": false, + "description": "收集项用途描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "collectModeId", + "in": "body", + "required": false, + "description": "收集方式ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "collectMode", + "in": "body", + "required": false, + "description": "收集方式描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "legalBasisId", + "in": "body", + "required": false, + "description": "法律基础ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "legalBasis", + "in": "body", + "required": false, + "description": "法律基础描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "remark", + "in": "body", + "required": false, + "description": "补充说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "scene", + "in": "body", + "required": false, + "description": "使用场景。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 200, + "type": "string" + }, + { + "name": "collectType", + "in": "body", + "required": false, + "description": "收集方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 100, + "type": "string" + }, + { + "name": "purpose", + "in": "body", + "required": false, + "description": "使用目的。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 50 + } + ], + "type": "object" + }, + { + "name": "thirdSharedInfos", + "in": "body", + "required": false, + "description": "三方共享信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "itemsProperties": [ + { + "name": "name", + "in": "body", + "required": false, + "description": "第三方名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 100, + "type": "string" + }, + { + "name": "purpose", + "in": "body", + "required": false, + "description": "使用目的。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 500, + "type": "string" + }, + { + "name": "personalType", + "in": "body", + "required": false, + "description": "涉及个人信息的种类。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 500, + "type": "string" + }, + { + "name": "officialPrivacyUrl", + "in": "body", + "required": false, + "description": "第三方的官网链接和隐私政策链接。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 1024, + "type": "string" + }, + { + "name": "serviceType", + "in": "body", + "required": false, + "description": "共享信息的服务类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 100, + "type": "string" + }, + { + "name": "scene", + "in": "body", + "required": false, + "description": "使用场景。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 200, + "type": "string" + }, + { + "name": "shareType", + "in": "body", + "required": false, + "description": "共享方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "maxLength": 100, + "type": "string" + }, + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "第三方数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "extInfo", + "in": "body", + "required": false, + "description": "扩展信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "properties": [ + { + "name": "contactInfo", + "in": "body", + "required": false, + "description": "联系方式详情。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "properties": [ + { + "name": "email", + "in": "body", + "required": false, + "description": "商业邮箱。 数组长度不超过10。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "itemsMaxLength": 100, + "type": "array", + "itemsType": "string", + "maxItems": 10 + }, + { + "name": "phoneNum", + "in": "body", + "required": false, + "description": "商业手机号码。 数组长度不超过10。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "itemsMaxLength": 31, + "type": "array", + "itemsType": "string", + "maxItems": 10 + }, + { + "name": "companyAddress", + "in": "body", + "required": false, + "description": "商业公司地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "maxLength": 512, + "type": "string" + }, + { + "name": "customContactInfo", + "in": "body", + "required": false, + "description": "自定义联系方式。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "storageInfo", + "in": "body", + "required": false, + "description": "存储信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "properties": [ + { + "name": "storagePeriod", + "in": "body", + "required": false, + "description": "开发者对信息的存储期限。 取值范围: -1:表示最短期限。 其他取值表示由开发者填写。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 512, + "type": "string" + }, + { + "name": "country", + "in": "body", + "required": false, + "description": "服务器所在国家。 示例:中国境内", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 100, + "type": "string" + }, + { + "name": "isCrossBorder", + "in": "body", + "required": false, + "description": "是否跨境。 取值范围: true:表示跨境 false:表示未跨境", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "type": "boolean" + }, + { + "name": "crossBorderReason", + "in": "body", + "required": false, + "description": "跨境处理原因。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 500, + "type": "string" + }, + { + "name": "crossBorderReceiveName", + "in": "body", + "required": false, + "description": "跨境接收方名称/姓名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 100, + "type": "string" + }, + { + "name": "crossBorderDeclarations", + "in": "body", + "required": false, + "description": "跨境收集的信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "itemsProperties": [ + { + "name": "dataItems", + "in": "body", + "required": false, + "description": "数据信息。 数组长度不超过200。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "itemsProperties": [ + { + "name": "itemId", + "in": "body", + "required": false, + "description": "数据ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 64, + "type": "string" + }, + { + "name": "itemDesc", + "in": "body", + "required": false, + "description": "数据描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "maxLength": 500, + "type": "string" + }, + { + "name": "sensitiveData", + "in": "body", + "required": false, + "description": "是否为敏感数据。 取值范围: 0:非敏感数据 1:敏感数据 默认值:0", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "type": "integer", + "enum": [ + "0", + "1" + ] + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "sceneId", + "in": "body", + "required": false, + "description": "收集项用途ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "sceneReason", + "in": "body", + "required": false, + "description": "收集项用途描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "collectModeId", + "in": "body", + "required": false, + "description": "收集方式ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "collectMode", + "in": "body", + "required": false, + "description": "收集方式描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "legalBasisId", + "in": "body", + "required": false, + "description": "法律基础ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 64, + "type": "string" + }, + { + "name": "legalBasis", + "in": "body", + "required": false, + "description": "法律基础描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + }, + { + "name": "remark", + "in": "body", + "required": false, + "description": "补充说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 200 + }, + { + "name": "crossBorderCountry", + "in": "body", + "required": false, + "description": "跨境之后存储的国家/地区。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "maxLength": 100, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "childPrivacyUrl", + "in": "body", + "required": false, + "description": "未成年人隐私保护url。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "maxLength": 512, + "type": "string" + }, + { + "name": "versionChangeDescs", + "in": "body", + "required": false, + "description": "版本变更说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "itemsProperties": [ + { + "name": "chapter", + "in": "body", + "required": false, + "description": "版本变更章节。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "maxLength": 50, + "type": "string" + }, + { + "name": "desc", + "in": "body", + "required": false, + "description": "版本变更说明。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "maxLength": 500, + "type": "string" + } + ], + "type": "array", + "itemsType": "object" + }, + { + "name": "abstracts", + "in": "body", + "required": false, + "description": "摘要信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "maxLength": 300, + "type": "string" + }, + { + "name": "managePersonalInfo", + "in": "body", + "required": false, + "description": "个人信息管理详情。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "properties": [ + { + "name": "infoAccess", + "in": "body", + "required": false, + "description": "访问记录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "properties": [ + { + "name": "personalSettingPath", + "in": "body", + "required": false, + "description": "访问路径。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "maxLength": 500, + "type": "string" + }, + { + "name": "personalType", + "in": "body", + "required": false, + "description": "涉及个人信息种类。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "infoModify", + "in": "body", + "required": false, + "description": "修改记录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "properties": [ + { + "name": "personalSettingPath", + "in": "body", + "required": false, + "description": "访问路径。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "maxLength": 500, + "type": "string" + }, + { + "name": "personalType", + "in": "body", + "required": false, + "description": "涉及个人信息种类。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "infoDelete", + "in": "body", + "required": false, + "description": "删除记录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "properties": [ + { + "name": "personalSettingPath", + "in": "body", + "required": false, + "description": "访问路径。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "maxLength": 500, + "type": "string" + }, + { + "name": "personalType", + "in": "body", + "required": false, + "description": "涉及个人信息种类。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "infoCancel", + "in": "body", + "required": false, + "description": "撤销记录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "properties": [ + { + "name": "personalSettingPath", + "in": "body", + "required": false, + "description": "访问路径。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "maxLength": 500, + "type": "string" + }, + { + "name": "serviceType", + "in": "body", + "required": false, + "description": "业务功能,业务类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "maxLength": 200, + "type": "string" + } + ], + "type": "object" + }, + { + "name": "serviceStop", + "in": "body", + "required": false, + "description": "服务暂停记录。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "properties": [ + { + "name": "personalSettingPath", + "in": "body", + "required": false, + "description": "访问路径。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237", + "maxLength": 500, + "type": "string" + } + ], + "type": "object" + } + ], + "type": "object" + }, + { + "name": "customInfo", + "in": "body", + "required": false, + "description": "自定义章节详情。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "properties": [ + { + "name": "title", + "in": "body", + "required": false, + "description": "自定义章节标题。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "maxLength": 100, + "type": "string" + }, + { + "name": "customInfoDesc", + "in": "body", + "required": false, + "description": "自定义章节内容。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "maxLength": 5000, + "type": "string" + }, + { + "name": "customInfos", + "in": "body", + "required": false, + "description": "额外的自定义章节详情。 数组长度不超过5。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "itemsProperties": [ + { + "name": "title", + "in": "body", + "required": false, + "description": "额外的自定义章节标题。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "maxLength": 100, + "type": "string" + }, + { + "name": "customInfoDesc", + "in": "body", + "required": false, + "description": "额外的自定义章节内容。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "maxLength": 3000, + "type": "string" + } + ], + "type": "array", + "itemsType": "object", + "maxItems": 5 + } + ], + "type": "object" + }, + { + "name": "extField", + "in": "body", + "required": false, + "description": "扩展字段。 说明 扩展字段的value不允许为空字符串,空字符串表示删除此扩展字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "maxLength": 8192, + "type": "string" + }, + { + "name": "extFieldCustomInfo", + "in": "body", + "required": false, + "description": "儿童隐私详情。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "properties": [ + { + "name": "childPrivacyTitle", + "in": "body", + "required": false, + "description": "儿童隐私自定义标题。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "maxLength": 512, + "type": "string" + }, + { + "name": "childPrivacyCustomInfoDesc", + "in": "body", + "required": false, + "description": "儿童隐私自定义内容。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "maxLength": 5000, + "type": "string" + } + ], + "type": "object" + } + ], + "type": "object" + } + ] +} diff --git a/pkg/domain/reference/supplemental/product-import-android.contract.json b/pkg/domain/reference/supplemental/product-import-android.contract.json new file mode 100644 index 0000000..b751556 --- /dev/null +++ b/pkg/domain/reference/supplemental/product-import-android.contract.json @@ -0,0 +1,362 @@ +{ + "parameters": [ + { + "name": "productNo", + "in": "body", + "type": "string", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344" + }, + { + "name": "status", + "in": "body", + "type": "string", + "required": false, + "description": "商品状态,支持创建active和inactive状态的商品默认值:inactive。取值如下: active:上线 inactive:下线", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "active", + "inactive" + ] + }, + { + "name": "productName", + "in": "body", + "type": "string", + "required": true, + "description": "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "maxLength": 55 + }, + { + "name": "productDesc", + "in": "body", + "type": "string", + "required": true, + "description": "默认商品描述信息。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "maxLength": 100 + }, + { + "name": "purchaseType", + "in": "body", + "type": "string", + "required": true, + "description": "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "consumable", + "auto_subscription", + "non_consumable" + ] + }, + { + "name": "subGroupId", + "in": "body", + "type": "string", + "required": false, + "description": "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344" + }, + { + "name": "subPeriod", + "in": "body", + "type": "string", + "required": false, + "description": "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344" + }, + { + "name": "subPeriodUnit", + "in": "body", + "type": "string", + "required": false, + "description": "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "D", + "W", + "M", + "Y" + ] + }, + { + "name": "force", + "in": "body", + "type": "integer", + "required": false, + "description": "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "0", + "1" + ] + }, + { + "name": "defaultLocale", + "in": "body", + "type": "string", + "required": true, + "description": "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344" + }, + { + "name": "defaultPriceInfo", + "in": "body", + "type": "object", + "required": false, + "description": "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "properties": [ + { + "name": "country", + "in": "body", + "type": "string", + "required": true, + "description": "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033" + }, + { + "name": "price", + "in": "body", + "type": "string", + "required": false, + "description": "商品原始价格,如果商品为上线状态,则此字段不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033" + }, + { + "name": "currency", + "in": "body", + "type": "string", + "required": true, + "description": "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033" + } + ] + }, + { + "name": "languages", + "in": "body", + "type": "array", + "required": false, + "description": "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "object", + "itemsProperties": [ + { + "name": "locale", + "in": "body", + "type": "string", + "required": true, + "description": "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041" + }, + { + "name": "productName", + "in": "body", + "type": "string", + "required": true, + "description": "商品名称。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "maxLength": 55 + }, + { + "name": "productDesc", + "in": "body", + "type": "string", + "required": true, + "description": "商品描述。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "maxLength": 100 + } + ] + }, + { + "name": "prices", + "in": "body", + "type": "array", + "required": false, + "description": "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "object", + "itemsProperties": [ + { + "name": "country", + "in": "body", + "type": "string", + "required": true, + "description": "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645" + }, + { + "name": "price", + "in": "body", + "type": "string", + "required": true, + "description": "定价,单位为分。 例如:1.99元此参数需要传入199。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645" + } + ] + }, + { + "name": "promotion", + "in": "body", + "type": "object", + "required": false, + "description": "促销信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "properties": [ + { + "name": "promotionId", + "in": "body", + "type": "string", + "required": false, + "description": "优惠唯一ID,批量创建时不需要传入,更新时必传。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "promotionTitle", + "in": "body", + "type": "string", + "required": true, + "description": "促销名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "startDate", + "in": "body", + "type": "integer", + "required": true, + "description": "开始优惠时间,格式为毫秒单位的时间戳。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "endDate", + "in": "body", + "type": "integer", + "required": false, + "description": "结束优惠时间,格式为毫秒单位的时间戳。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "status", + "in": "body", + "type": "string", + "required": false, + "description": "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "strategy", + "in": "body", + "type": "string", + "required": true, + "description": "促销策略类型: trial:免费试用 说明 仅当关联商品的purchaseType为auto_subscription类型时支持配置trial。 introductory:按周期扣费", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "price", + "in": "body", + "type": "string", + "required": false, + "description": "默认促销价格,单位为分,strategy取值为introductory时,必须传入。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "numberOfUnits", + "in": "body", + "type": "integer", + "required": false, + "description": "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "periodUnit", + "in": "body", + "type": "string", + "required": false, + "description": "优惠周期单位: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + }, + { + "name": "languages", + "in": "body", + "type": "array", + "required": false, + "description": "各个国家的语言信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "itemsType": "object" + }, + { + "name": "promotionPrice", + "in": "body", + "type": "array", + "required": true, + "description": "各个国家的自定义价格信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "itemsType": "object" + } + ] + }, + { + "name": "salesCountry", + "in": "body", + "type": "array", + "required": false, + "description": "销售国家/地区。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "itemsType": "string" + }, + { + "name": "autoAddSaleCountry", + "in": "body", + "type": "integer", + "required": false, + "description": "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "enum": [ + "0", + "1" + ] + } + ], + "rules": [ + { + "id": "subscription-subGroupId", + "kind": "required_if", + "field": "body.subGroupId", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subGroupId is required for auto_subscription", + "suggestion": "Supply subGroupId using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriod", + "kind": "required_if", + "field": "body.subPeriod", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subPeriod is required for auto_subscription", + "suggestion": "Supply subPeriod using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriodUnit", + "kind": "required_if", + "field": "body.subPeriodUnit", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "message": "subPeriodUnit is required for auto_subscription", + "suggestion": "Supply subPeriodUnit using the subscription group and period documented by ProductImportInfo." + } + ] +} diff --git a/pkg/domain/reference/supplemental/product-import-android.json b/pkg/domain/reference/supplemental/product-import-android.json new file mode 100644 index 0000000..262e89a --- /dev/null +++ b/pkg/domain/reference/supplemental/product-import-android.json @@ -0,0 +1,178 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-android-0000002135929332", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-android-0000002135929308", + "title": "创建商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "title": "DefaultProductPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "title": "ProductLanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "title": "ProductLanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645", + "title": "ProductPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-android-0000002171407033", + "title": "DefaultProductPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "title": "PromotionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-productinfo-android-0000002171288637", + "title": "ProductInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-android-0000002136087432", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productNo", + "M", + "String", + "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。" + ], + [ + "status", + "O", + "String", + "商品状态,支持创建active和inactive状态的商品默认值:inactive。取值如下: active:上线 inactive:下线" + ], + [ + "productName", + "M", + "String(55)", + "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。" + ], + [ + "productDesc", + "M", + "String(100)", + "默认商品描述信息。不支持特殊字符|。" + ], + [ + "purchaseType", + "M", + "String", + "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 更新时不能修改。" + ], + [ + "subGroupId", + "O", + "String", + "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。" + ], + [ + "subPeriod", + "O", + "String", + "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。" + ], + [ + "subPeriodUnit", + "O", + "String", + "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + ], + [ + "force", + "O", + "Integer", + "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制" + ], + [ + "defaultLocale", + "M", + "String", + "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + ], + [ + "defaultPriceInfo", + "O", + "DefaultProductPriceInfo", + "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。" + ], + [ + "languages", + "O", + "List", + "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。" + ], + [ + "prices", + "O", + "List", + "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。" + ], + [ + "promotion", + "O", + "PromotionInfo", + "促销信息。" + ], + [ + "salesCountry", + "O", + "List", + "销售国家/地区。" + ], + [ + "autoAddSaleCountry", + "O", + "Integer", + "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-android-0000002135929344" + } + ], + "title": "ProductImportInfo", + "updatedAt": "2025-08-15 09:52", + "checkedAt": "2026-10-07T03:13:20.140Z" +} diff --git a/pkg/domain/reference/supplemental/product-import-harmonyosnext.contract.json b/pkg/domain/reference/supplemental/product-import-harmonyosnext.contract.json new file mode 100644 index 0000000..9de212c --- /dev/null +++ b/pkg/domain/reference/supplemental/product-import-harmonyosnext.contract.json @@ -0,0 +1,410 @@ +{ + "parameters": [ + { + "name": "productNo", + "in": "body", + "type": "string", + "required": true, + "description": "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + }, + { + "name": "status", + "in": "body", + "type": "string", + "required": false, + "description": "商品状态,取值如下: drafts: 草稿,仅在批量创建时支持。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "drafts" + ] + }, + { + "name": "productName", + "in": "body", + "type": "string", + "required": true, + "description": "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "maxLength": 55 + }, + { + "name": "productDesc", + "in": "body", + "type": "string", + "required": true, + "description": "默认商品描述信息。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "maxLength": 100 + }, + { + "name": "purchaseType", + "in": "body", + "type": "string", + "required": true, + "description": "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non-renewing-subscription:非续期订阅型 更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "consumable", + "auto_subscription", + "non_consumable", + "non-renewing-subscription" + ] + }, + { + "name": "subGroupId", + "in": "body", + "type": "string", + "required": false, + "description": "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + }, + { + "name": "subPeriod", + "in": "body", + "type": "string", + "required": false, + "description": "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + }, + { + "name": "subPeriodUnit", + "in": "body", + "type": "string", + "required": false, + "description": "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "D", + "W", + "M", + "Y" + ] + }, + { + "name": "force", + "in": "body", + "type": "integer", + "required": false, + "description": "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "0", + "1" + ] + }, + { + "name": "defaultLocale", + "in": "body", + "type": "string", + "required": true, + "description": "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + }, + { + "name": "defaultPriceInfo", + "in": "body", + "type": "object", + "required": false, + "description": "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "properties": [ + { + "name": "country", + "in": "body", + "type": "string", + "required": true, + "description": "国家码,具体请参见国家/地区、语言、币种列表,默认值CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864" + }, + { + "name": "price", + "in": "body", + "type": "string", + "required": false, + "description": "商品原始价格,如果商品为上线状态,则此字段不能为空。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864" + }, + { + "name": "currency", + "in": "body", + "type": "string", + "required": true, + "description": "用于支付的币种,请参见国家/地区、语言、币种列表。 例如:USD、CNY、MYR。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864" + } + ] + }, + { + "name": "languages", + "in": "body", + "type": "array", + "required": false, + "description": "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "object", + "itemsProperties": [ + { + "name": "locale", + "in": "body", + "type": "string", + "required": true, + "description": "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872" + }, + { + "name": "productName", + "in": "body", + "type": "string", + "required": true, + "description": "商品名称。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "maxLength": 55 + }, + { + "name": "productDesc", + "in": "body", + "type": "string", + "required": true, + "description": "商品描述。不支持特殊字符|。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "maxLength": 100 + } + ] + }, + { + "name": "prices", + "in": "body", + "type": "array", + "required": false, + "description": "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "object", + "itemsProperties": [ + { + "name": "country", + "in": "body", + "type": "string", + "required": true, + "description": "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736" + }, + { + "name": "price", + "in": "body", + "type": "string", + "required": true, + "description": "定价,单位为分。 例如:1.99元此参数需要传入199。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736" + }, + { + "name": "startDate", + "in": "body", + "type": "integer", + "required": true, + "description": "价格调整开始时间。默认值:当前时间。 说明 价格调整计划必须连续,开始时间必须等于上一个调整计划的结束时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736" + }, + { + "name": "endDate", + "in": "body", + "type": "integer", + "required": false, + "description": "价格调整结束时间。若不填写结束时间,则默认值:永久。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736" + }, + { + "name": "tag", + "in": "body", + "type": "string", + "required": true, + "description": "价格调整标识。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736" + } + ] + }, + { + "name": "promotion", + "in": "body", + "type": "object", + "required": false, + "description": "促销信息。 说明 消耗型、非消耗型、非续期订阅型商品不支持传入该字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "properties": [ + { + "name": "promotionId", + "in": "body", + "type": "string", + "required": false, + "description": "优惠唯一ID,批量创建时不需要传入,更新时必传。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "promotionTitle", + "in": "body", + "type": "string", + "required": true, + "description": "促销名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "startDate", + "in": "body", + "type": "integer", + "required": true, + "description": "开始优惠时间,格式为毫秒单位的时间戳。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "endDate", + "in": "body", + "type": "integer", + "required": false, + "description": "结束优惠时间,格式为毫秒单位的时间戳。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "status", + "in": "body", + "type": "string", + "required": false, + "description": "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "strategy", + "in": "body", + "type": "string", + "required": true, + "description": "促销策略类型: trial:免费试用(仅自动续期型商品支持) introductory:按周期扣费(仅自动续期型商品支持) pay-up-front:提前支付(仅自动续期型商品支持) single-promotion:单商品优惠(仅消耗型,非消耗型,非续期型商品支持) 商品类型与策略类型映射关系请参见商品类型与促销类型、策略类型关系映射表。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "price", + "in": "body", + "type": "string", + "required": false, + "description": "默认促销价格,单位为分,strategy取值为introductory、pay-up-front时,必须传入。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "numberOfUnits", + "in": "body", + "type": "integer", + "required": false, + "description": "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "periodUnit", + "in": "body", + "type": "string", + "required": false, + "description": "优惠周期单位,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + }, + { + "name": "languages", + "in": "body", + "type": "array", + "required": false, + "description": "各个国家的语言信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "itemsType": "object" + }, + { + "name": "promotionPrice", + "in": "body", + "type": "array", + "required": true, + "description": "各个国家的自定义价格信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "itemsType": "object" + } + ] + }, + { + "name": "reviewResourceId", + "in": "body", + "type": "string", + "required": false, + "description": "资源ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + }, + { + "name": "reviewNote", + "in": "body", + "type": "string", + "required": false, + "description": "审核文本。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + }, + { + "name": "reviewPath", + "in": "body", + "type": "string", + "required": false, + "description": "资源内路径。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + }, + { + "name": "salesCountry", + "in": "body", + "type": "array", + "required": false, + "description": "销售国家/地区。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "itemsType": "string" + }, + { + "name": "autoAddSaleCountry", + "in": "body", + "type": "integer", + "required": false, + "description": "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "enum": [ + "0", + "1" + ] + } + ], + "rules": [ + { + "id": "subscription-subGroupId", + "kind": "required_if", + "field": "body.subGroupId", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subGroupId is required for auto_subscription", + "suggestion": "Supply subGroupId using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriod", + "kind": "required_if", + "field": "body.subPeriod", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subPeriod is required for auto_subscription", + "suggestion": "Supply subPeriod using the subscription group and period documented by ProductImportInfo." + }, + { + "id": "subscription-subPeriodUnit", + "kind": "required_if", + "field": "body.subPeriodUnit", + "when": { + "field": "body.purchaseType", + "equals": "auto_subscription" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "message": "subPeriodUnit is required for auto_subscription", + "suggestion": "Supply subPeriodUnit using the subscription group and period documented by ProductImportInfo." + } + ] +} diff --git a/pkg/domain/reference/supplemental/product-import-harmonyosnext.json b/pkg/domain/reference/supplemental/product-import-harmonyosnext.json new file mode 100644 index 0000000..ab56b40 --- /dev/null +++ b/pkg/domain/reference/supplemental/product-import-harmonyosnext.json @@ -0,0 +1,196 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-harmonyosnext-0000002166748621", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-addproductgroup-harmonyosnext-0000002166748605", + "title": "创建商品订阅分组信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "title": "DefaultProductPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "title": "ProductLanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "title": "ProductLanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "title": "ProductPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-dppriceinfo-harmonyosnext-0000002131508864", + "title": "DefaultProductPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "title": "PromotionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-productinfo-harmonyosnext-0000002131350728", + "title": "ProductInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-harmonyosnext-0000002166670161", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "productNo", + "M", + "String", + "开发者自定义商品标识,和appId唯一确定一个商品。 必须以大小写字母或数字开头,并且只能由大小写字母 (A-Z,a-z)、数字 (0-9)、下划线 (_) 和句点 (.) 组成。同一个应用内商品标识不能重复。 更新时不能修改。" + ], + [ + "status", + "O", + "String", + "商品状态,取值如下: drafts: 草稿,仅在批量创建时支持。" + ], + [ + "productName", + "M", + "String(55)", + "商品名称,支持多语言配置,根据defaultLocale配置此处的商品名称。不支持特殊字符|。" + ], + [ + "productDesc", + "M", + "String(100)", + "默认商品描述信息。不支持特殊字符|。" + ], + [ + "purchaseType", + "M", + "String", + "商品类型,取值范围: consumable:消耗型 auto_subscription:自动续期型 non_consumable:非消耗型 non-renewing-subscription:非续期订阅型 更新时不能修改。" + ], + [ + "subGroupId", + "O", + "String", + "订阅分组ID,purchaseType为auto_subscription时必须传入,依赖于已调用创建商品订阅分组信息接口创建订阅分组。更新时不能修改。" + ], + [ + "subPeriod", + "O", + "String", + "订购周期,purchaseType为auto_subscription时必须传入。更新时不能修改。" + ], + [ + "subPeriodUnit", + "O", + "String", + "订购周期单位,purchaseType为auto_subscription时必须传入。采用ISO 8601格式指定,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 例如:订阅周期为2个月,则subPeriod=2, subPeriodUnit=M。 更新时不能修改。 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + ], + [ + "force", + "O", + "Integer", + "自动续期型商品,价格变更之后,对于已订阅用户是否强制涨价。不传默认值:0。 0:不强制 1:强制" + ], + [ + "defaultLocale", + "M", + "String", + "默认语言环境,请参见国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + ], + [ + "defaultPriceInfo", + "O", + "DefaultProductPriceInfo", + "默认价格信息。如果未传入,则会默认设置此对象中的Country为CN,Currency为CNY。" + ], + [ + "languages", + "O", + "List", + "商品多语言信息。 如果未传值,则通过默认的productName、productDesc和defaultLocale构造。 如果传入了该列表,当列表内某一ProductLanguageInfo对象的locale的值等于当前ProductImportInfo内defaultLocale的值时,需保证该对象内productName和productDesc的值分别与当前ProductImportInfo内productName和productDesc的值一致。" + ], + [ + "prices", + "O", + "List", + "自定义价格。如果传入了该列表,则必须传入DefaultProductPriceInfo对象中的price字段。 说明 更新场景时,仅更新该列表中的价格,不自动刷新其他国家价格。" + ], + [ + "promotion", + "O", + "PromotionInfo", + "促销信息。 说明 消耗型、非消耗型、非续期订阅型商品不支持传入该字段。" + ], + [ + "reviewResourceId", + "O", + "String", + "资源ID。" + ], + [ + "reviewNote", + "O", + "String", + "审核文本。" + ], + [ + "reviewPath", + "O", + "String", + "资源内路径。" + ], + [ + "salesCountry", + "O", + "List", + "销售国家/地区。" + ], + [ + "autoAddSaleCountry", + "O", + "Integer", + "是否启用自动添加销售国家或地区,默认值:0。 1:是 0:否" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pimportinfo-harmonyosnext-0000002166748629" + } + ], + "title": "ProductImportInfo", + "updatedAt": "2025-08-15 09:52", + "checkedAt": "2026-10-07T03:13:08.170Z" +} diff --git a/pkg/domain/reference/supplemental/productlanguageinfo-android.json b/pkg/domain/reference/supplemental/productlanguageinfo-android.json new file mode 100644 index 0000000..ed71d02 --- /dev/null +++ b/pkg/domain/reference/supplemental/productlanguageinfo-android.json @@ -0,0 +1,72 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-android-0000002135929332", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-android-0000002136087432", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppdetailinfo-android-0000002171288641", + "title": "ProductPromotionDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "locale", + "M", + "String", + "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + ], + [ + "productName", + "M", + "String(55)", + "商品名称。不支持特殊字符|。" + ], + [ + "productDesc", + "M", + "String(100)", + "商品描述。不支持特殊字符|。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-android-0000002171407041" + } + ], + "title": "ProductLanguageInfo", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:15:19.904Z" +} diff --git a/pkg/domain/reference/supplemental/productlanguageinfo-harmonyosnext.json b/pkg/domain/reference/supplemental/productlanguageinfo-harmonyosnext.json new file mode 100644 index 0000000..e1ac2ba --- /dev/null +++ b/pkg/domain/reference/supplemental/productlanguageinfo-harmonyosnext.json @@ -0,0 +1,72 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-harmonyosnext-0000002166748621", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pierrorinfo-harmonyosnext-0000002166670161", + "title": "ProductImportErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppdetailinfo-harmonyosnext-0000002131350732", + "title": "ProductPromotionDetailInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "locale", + "M", + "String", + "语言环境,请参考国家/地区、语言、币种列表。 例如:zh_CN、en_US。" + ], + [ + "productName", + "M", + "String(55)", + "商品名称。不支持特殊字符|。" + ], + [ + "productDesc", + "M", + "String(100)", + "商品描述。不支持特殊字符|。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pdlanguageinfo-harmonyosnext-0000002131508872" + } + ], + "title": "ProductLanguageInfo", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:14:40.533Z" +} diff --git a/pkg/domain/reference/supplemental/productpriceinfo-android.json b/pkg/domain/reference/supplemental/productpriceinfo-android.json new file mode 100644 index 0000000..d85aefa --- /dev/null +++ b/pkg/domain/reference/supplemental/productpriceinfo-android.json @@ -0,0 +1,46 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "country", + "M", + "String", + "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。" + ], + [ + "price", + "M", + "String", + "定价,单位为分。 例如:1.99元此参数需要传入199。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-android-0000002171288645" + } + ], + "title": "ProductPriceInfo", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:15:24.308Z" +} diff --git a/pkg/domain/reference/supplemental/productpriceinfo-harmonyosnext.json b/pkg/domain/reference/supplemental/productpriceinfo-harmonyosnext.json new file mode 100644 index 0000000..08e6aa6 --- /dev/null +++ b/pkg/domain/reference/supplemental/productpriceinfo-harmonyosnext.json @@ -0,0 +1,84 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-harmonyosnext-0000002166748621", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-supported-countries-overview-0000001146718725", + "title": "国家/地区、语言、币种列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pqueryinfo-harmonyosnext-0000002131508876", + "title": "ProductsQueryInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-perrorinfo-harmonyosnext-0000002166748637", + "title": "PromotionErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "country", + "M", + "String", + "国家码,请参见国家/地区、语言、币种列表,例如CN。 默认值CN。" + ], + [ + "price", + "M", + "String", + "定价,单位为分。 例如:1.99元此参数需要传入199。" + ], + [ + "startDate", + "M", + "Long", + "价格调整开始时间。默认值:当前时间。 说明 价格调整计划必须连续,开始时间必须等于上一个调整计划的结束时间。" + ], + [ + "endDate", + "O", + "Long", + "价格调整结束时间。若不填写结束时间,则默认值:永久。" + ], + [ + "tag", + "M", + "String", + "价格调整标识。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ppriceinfo-harmonyosnext-0000002131350736" + } + ], + "title": "ProductPriceInfo", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T03:14:41.968Z" +} diff --git a/pkg/domain/reference/supplemental/promotioninfo-android.json b/pkg/domain/reference/supplemental/promotioninfo-android.json new file mode 100644 index 0000000..3ec497e --- /dev/null +++ b/pkg/domain/reference/supplemental/promotioninfo-android.json @@ -0,0 +1,124 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-android-0000002131508240", + "title": "HarmonyOS 3.1/4.0及以下、Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-android-0000002135929332", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ptlanguageinfo-android-0000002171288649", + "title": "PromotionLanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ptpriceinfo-android-0000002135929356", + "title": "PromotionPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-perrorinfo-android-0000002135929352", + "title": "PromotionErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pintroduceinfo-android-0000002171407049", + "title": "PromotionIntroductoryInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "promotionId", + "O", + "String", + "优惠唯一ID,批量创建时不需要传入,更新时必传。" + ], + [ + "promotionTitle", + "M", + "String", + "促销名称。" + ], + [ + "startDate", + "M", + "Integer(64)", + "开始优惠时间,格式为毫秒单位的时间戳。" + ], + [ + "endDate", + "O", + "Integer(64)", + "结束优惠时间,格式为毫秒单位的时间戳。" + ], + [ + "status", + "O", + "String", + "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线" + ], + [ + "strategy", + "M", + "String", + "促销策略类型: trial:免费试用 说明 仅当关联商品的purchaseType为auto_subscription类型时支持配置trial。 introductory:按周期扣费" + ], + [ + "price", + "O", + "String", + "默认促销价格,单位为分,strategy取值为introductory时,必须传入。" + ], + [ + "numberOfUnits", + "O", + "Integer", + "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M" + ], + [ + "periodUnit", + "O", + "String", + "优惠周期单位: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + ], + [ + "languages", + "O", + "List", + "各个国家的语言信息。" + ], + [ + "promotionPrice", + "M", + "List", + "各个国家的自定义价格信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-android-0000002136087440" + } + ], + "title": "PromotionInfo", + "updatedAt": "2025-08-15 09:52", + "checkedAt": "2026-10-07T03:15:25.869Z" +} diff --git a/pkg/domain/reference/supplemental/promotioninfo-harmonyosnext.json b/pkg/domain/reference/supplemental/promotioninfo-harmonyosnext.json new file mode 100644 index 0000000..51dfffb --- /dev/null +++ b/pkg/domain/reference/supplemental/promotioninfo-harmonyosnext.json @@ -0,0 +1,128 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-0000001162548121", + "title": "PMS API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pmsapi-harmonyosnext-0000002166747989", + "title": "HarmonyOS 5.0及以上" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-data-harmonyosnext-0000002166748621", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-faq-0000001304804872#section1333114369335", + "title": "商品类型与促销类型、策略类型关系映射表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ptlanguageinfo-harmonyosnext-0000002131350740", + "title": "PromotionLanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-ptpriceinfo-harmonyosnext-0000002166748641", + "title": "PromotionPriceInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-perrorinfo-harmonyosnext-0000002166748637", + "title": "PromotionErrorInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-pintroduceinfo-harmonyosnext-0000002131508880", + "title": "PromotionIntroductoryInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "promotionId", + "O", + "String", + "优惠唯一ID,批量创建时不需要传入,更新时必传。" + ], + [ + "promotionTitle", + "M", + "String", + "促销名称。" + ], + [ + "startDate", + "M", + "Integer(64)", + "开始优惠时间,格式为毫秒单位的时间戳。" + ], + [ + "endDate", + "O", + "Integer(64)", + "结束优惠时间,格式为毫秒单位的时间戳。" + ], + [ + "status", + "O", + "String", + "促销状态,取值如下,默认值:inactive。 active:上线 inactive:下线" + ], + [ + "strategy", + "M", + "String", + "促销策略类型: trial:免费试用(仅自动续期型商品支持) introductory:按周期扣费(仅自动续期型商品支持) pay-up-front:提前支付(仅自动续期型商品支持) single-promotion:单商品优惠(仅消耗型,非消耗型,非续期型商品支持) 商品类型与策略类型映射关系请参见商品类型与促销类型、策略类型关系映射表。" + ], + [ + "price", + "O", + "String", + "默认促销价格,单位为分,strategy取值为introductory、pay-up-front时,必须传入。" + ], + [ + "numberOfUnits", + "O", + "Integer", + "优惠周期数。如优惠两个月,numberOfUnits=2, periodUnit=M" + ], + [ + "periodUnit", + "O", + "String", + "优惠周期单位,取值范围: D:天 W:周 M:月 Y:年 可选值: 1周 1个月 2个月 3个月 6个月 1年 30天(上次订阅日期+30天) 31天(上次订阅日期+31天) 说明 当前仅purchaseType为\"auto_subscription\"的自动续期型商品需要维护。" + ], + [ + "languages", + "O", + "List", + "各个国家的语言信息。" + ], + [ + "promotionPrice", + "M", + "List", + "各个国家的自定义价格信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-pms-promotioninfo-harmonyosnext-0000002166670169" + } + ], + "title": "PromotionInfo", + "updatedAt": "2025-11-03 09:58", + "checkedAt": "2026-10-07T03:14:44.077Z" +} diff --git a/pkg/domain/reference/supplemental/publish-api-agreementbaseinfo-privacy-0000002328924929.json b/pkg/domain/reference/supplemental/publish-api-agreementbaseinfo-privacy-0000002328924929.json new file mode 100644 index 0000000..e13ac6d --- /dev/null +++ b/pkg/domain/reference/supplemental/publish-api-agreementbaseinfo-privacy-0000002328924929.json @@ -0,0 +1,88 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "title": "AgreementBaseInfo(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "title": "AgreementInfo(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "name", + "M", + "String(100)", + "隐私政策协议名称。" + ], + [ + "appName", + "O", + "String(255)", + "应用名称。" + ], + [ + "companyName", + "O", + "String(1024)", + "公司名称。" + ], + [ + "briefDesc", + "O", + "String(500)", + "产品简介。" + ], + [ + "effectiveTime", + "O", + "Integer(64)", + "隐私政策协议生效时间与1970年1月1日午夜之间的差值,以毫秒为单位。例如:1733555215000。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929" + } + ], + "title": "AgreementBaseInfo(隐私政策协议)", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:39:19.333Z" +} diff --git a/pkg/domain/reference/supplemental/publish-api-devicemultipermissionreason-0000002294885664.json b/pkg/domain/reference/supplemental/publish-api-devicemultipermissionreason-0000002294885664.json new file mode 100644 index 0000000..1a5ad90 --- /dev/null +++ b/pkg/domain/reference/supplemental/publish-api-devicemultipermissionreason-0000002294885664.json @@ -0,0 +1,80 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicematerial-0000002236201274", + "title": "DeviceMaterial" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "title": "DevicePermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-devicemultipermissionreason-0000002294885664", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "O", + "String(20)", + "当前语言,取值参考语言类型。" + ], + [ + "reason", + "O", + "String(500)", + "使用ACL权限的原因。" + ], + [ + "videoUrl", + "O", + "String(256)", + "ACL权限使用场景说明视频的可下载地址。有效期为5分钟。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-devicemultipermissionreason-0000002294885664" + } + ], + "title": "DeviceMultiPermissionReason", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:41:10.831Z" +} diff --git a/pkg/domain/reference/supplemental/publish-api-packagepermissionintrovedio-0000002236201278.json b/pkg/domain/reference/supplemental/publish-api-packagepermissionintrovedio-0000002236201278.json new file mode 100644 index 0000000..3384fa6 --- /dev/null +++ b/pkg/domain/reference/supplemental/publish-api-packagepermissionintrovedio-0000002236201278.json @@ -0,0 +1,98 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packageinfo-0000002328964965", + "title": "PackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packagestates-0000002271160601", + "title": "PackageStates" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(8)", + "语言种类。 说明 取值参见语言类型。" + ], + [ + "permissionName", + "M", + "String(512)", + "权限标记字符串。" + ], + [ + "deviceType", + "M", + "Integer(32)", + "设备类型。 取值范围: 4:手机 5:平板 8:智慧屏 12:智能手表 14:运动手表 19:PC/2in1" + ], + [ + "objectId", + "M", + "String(512)", + "文件在OBS上的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278" + } + ], + "title": "PackagePermissionIntroVideo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:46:18.472Z" +} diff --git a/pkg/domain/reference/supplemental/publishing-error-codes.json b/pkg/domain/reference/supplemental/publishing-error-codes.json new file mode 100644 index 0000000..7d99606 --- /dev/null +++ b/pkg/domain/reference/supplemental/publishing-error-codes.json @@ -0,0 +1,442 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "title": "VersionVoc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-provision-api-guide-0000002271000601", + "title": "Provisioning API指南" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-errorcode-0000002271000673", + "text": "如果返回的错误信息为“unknown error”,可以通过在线工单系统与我们联系。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-errorcode-0000002271000673", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码(errorCode)", + "错误描述(errorMsg)" + ], + [ + "204144647", + "更新服务失败。" + ], + [ + "204144648", + "查询应用服务信息失败。" + ], + [ + "204144649", + "更新应用信息失败。" + ], + [ + "204144650", + "更新语种信息失败,输入语种不存在。" + ], + [ + "204144651", + "应用的默认语言不允许删除。" + ], + [ + "204144652", + "应用语言描述信息为空。" + ], + [ + "204144653", + "需要查询的语言描述信息不存在。" + ], + [ + "204144655", + "下载方式提交发布接口,下载文件失败。" + ], + [ + "204144656", + "下载方式提交发布接口,仅支持中国开发者或分发区域包含中国的应用。" + ], + [ + "204144657", + "下载方式提交发布接口,上传到FileServer失败。" + ], + [ + "204144659", + "下载方式提交发布接口,异步处理队列已满,请稍后重试。" + ], + [ + "204144660", + "提交发布接口,查询应用信息失败。 失败描述中会给出编译失败原因的状态码,状态码范围如下: 80210101:使用了Asset Pack" + ], + [ + "204144664", + "提交审核前预检查失败。" + ], + [ + "204144665", + "鉴权失败、查询用户信息失败。" + ], + [ + "204144670", + "创建应用失败。" + ], + [ + "204144673", + "创建产品失败。" + ], + [ + "204144677", + "更新待上架时间的消息体有误。" + ], + [ + "204144678", + "更新应用上架时间失败。" + ], + [ + "204144680", + "查询价格档失败。" + ], + [ + "204144681", + "更新分级信息失败。" + ], + [ + "204144683", + "获取drmkey信息失败。" + ], + [ + "204144685", + "创建项目失败。" + ], + [ + "204144689", + "获取应用的归属失败。" + ], + [ + "204144690", + "查询应用和最新版本信息失败。" + ], + [ + "204144694", + "获取站点信息失败。" + ], + [ + "204144695", + "通过下载方式关联软件包失败。" + ], + [ + "204144696", + "更新应用信息失败。" + ], + [ + "204144697", + "获取应用详情信息失败。" + ], + [ + "204144698", + "获取图片的相关信息失败。" + ], + [ + "204144709", + "查询应用简略信息失败。" + ], + [ + "204144710", + "删除版本语言失败。" + ], + [ + "204144711", + "查询软件包信息失败。" + ], + [ + "204144712", + "更新应用上架时间失败。" + ], + [ + "204144713", + "获取视频解析结果失败。" + ], + [ + "204144714", + "删除视频文件失败。" + ], + [ + "204144715", + "更新版本分阶段信息失败。" + ], + [ + "204144716", + "获取用户信息失败。" + ], + [ + "204144718", + "查询软件包状态信息失败。" + ], + [ + "204144719", + "软件包正在编译。" + ], + [ + "204144720", + "软件包编译失败,失败描述中会给出编译失败原因的状态码。 状态码范围如下: 991:非法软件包 992:软件包包名不一致 993:hapAppProvision文件非法 994:软件包不存在 995:不支持的软件包类型 996:软件包解析失败 997:包名与应用名不匹配 998:设备类型与应用名不匹配 999:hapAppProvision文件为调试类型 1000:hapAppProvision文件已过期 1001:签名证书与Provision集成证书不一致 1002:开发者证书已失效 1003:开发者证书未生效 1004:包名不唯一 1005:软件包中使用证书已经失效,请重新上传。 1006:软件包的大小超过配置的大小" + ], + [ + "204144721", + "根据packageTypes过滤后,查询到的应用信息为空。" + ], + [ + "204144723", + "软件包的签名与其它版本软件包的签名不一致。" + ], + [ + "204144724", + "解析视频信息失败。" + ], + [ + "204144725", + "查询应用上架版本信息失败。" + ], + [ + "204144726", + "更新HarmonyOS应用软件包信息失败。" + ], + [ + "204144727", + "软件包正在编译中,应用提交审核请3至5分钟之后再试。" + ], + [ + "204144730", + "应用名称含有敏感词。" + ], + [ + "204144731", + "车机应用权限不足。" + ], + [ + "204144732", + "应用名修改次数超过上限,在中国大陆全网上架的应用一个自然年内最多可更名2次。" + ], + [ + "204144743", + "未找到可修改的版本。" + ], + [ + "204144746", + "新建应用失败。" + ], + [ + "204144747", + "删除应用失败。" + ], + [ + "204144748", + "删除应用失败。" + ], + [ + "204144749", + "应用下架失败。" + ], + [ + "204144752", + "获取开发者注册所在地失败。" + ], + [ + "204144753", + "获取授权资源失败。" + ], + [ + "204144754", + "图片等文件素材检查失败。" + ], + [ + "204144756", + "应用不存在。" + ], + [ + "204144757", + "应用分类参数错误,应传入新分类。请在AppGallery Connect页面操作。" + ], + [ + "204144781", + "不能撤销已通过的资质审核任务。" + ], + [ + "204144782", + "调用资质审核任务接口失败。" + ], + [ + "204144783", + "调用资质审核任务提交资质审核失败。" + ], + [ + "204144784", + "撤销资质审核任务失败。" + ], + [ + "204144785", + "不在提交独立资质的允许名单内。" + ], + [ + "204144786", + "资质有效期格式错误。" + ], + [ + "204144787", + "资质文件大小超过上限。" + ], + [ + "204144788", + "资质文件类型错误。" + ], + [ + "204144789", + "未上传所有选定标签所需的资质。" + ], + [ + "204144790", + "不能提交资质审核任务。" + ], + [ + "204144791", + "资质审核任务不存在。" + ], + [ + "204144802", + "调用CMS查询标签资质依赖失败。" + ], + [ + "204144815", + "申请年龄分级失败。" + ], + [ + "204144816", + "确认应用年龄分级结果失败。" + ], + [ + "204144818", + "设置的应用名称和已存在的应用名称相同。" + ], + [ + "204144828", + "此资质审核任务已经存在,不允许创建重复的资质审核任务。" + ], + [ + "204144830", + "资质审核任务不存在。" + ], + [ + "204144831", + "资质审核的状态无法撤销。" + ], + [ + "208151000", + "创建隐私协议失败(可能存在草稿态的隐私协议,所以不再允许创建新的隐私协议)。" + ], + [ + "208151001", + "用户权限不足。" + ], + [ + "208151002", + "协议数量超过限制。" + ], + [ + "208151003", + "没有有效的协议模板。" + ], + [ + "208151004", + "协议语言不能为空。" + ], + [ + "208151005", + "协议模板不存在。" + ], + [ + "208151006", + "协议实例不存在。" + ], + [ + "208151007", + "协议不允许更新(审核中或者被在架版本关联的协议都不允许更新)。" + ], + [ + "208151008", + "协议不允许提交(审核中或者删除的协议都不允许提交)。" + ], + [ + "208151010", + "协议1.0不存在。" + ], + [ + "208151011", + "协议1.0未被在架版本绑定。" + ], + [ + "208151012", + "协议非审核中状态,不允许同步状态。" + ], + [ + "208151013", + "src协议的版本在审核中状态,不允许在线更新。" + ], + [ + "208151014", + "用户协议agreementTitle不能为空。" + ], + [ + "208151015", + "用户协议userAgreementUrl不能为空,并且要以http://或者https://开头。" + ], + [ + "208151016", + "用户协议默认语言不能为空。" + ], + [ + "208151017", + "用户协议默认语言必需包含在语言列表中。" + ], + [ + "208151018", + "childPrivacyUrl要以http://或者https://开头,不能包含@符号。" + ], + [ + "208151019", + "privacyDeclare要以http://或者https://开头,不能包含@符号。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-errorcode-0000002271000673" + } + ], + "title": "错误码", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:58:09.332Z" +} diff --git a/pkg/domain/reference/supplemental/publishing-model-index.json b/pkg/domain/reference/supplemental/publishing-model-index.json new file mode 100644 index 0000000..47b3bce --- /dev/null +++ b/pkg/domain/reference/supplemental/publishing-model-index.json @@ -0,0 +1,316 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-reference-0000002271160565", + "title": "Publishing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-adsinfo-0000002295005298", + "title": "AdsInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-user-0000002271160613", + "title": "Agreement(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreement-privacy-0000002295005286", + "title": "Agreement(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementbaseinfo-user-0000002236201290", + "title": "AgreementBaseInfo(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-agreementbaseinfo-privacy-0000002328924929", + "title": "AgreementBaseInfo(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-user-0000002236041482", + "title": "AgreementInfo(用户协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630", + "title": "AgreementInfo(隐私政策协议)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-allpermission-0000002295046904", + "title": "AllPermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appinfo-0000002236041454", + "title": "AppInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-appreviewcontact-0000002505438989", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-auditinfo-0000002271000649", + "title": "AuditInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefpackageinfo-0000002236041470", + "title": "BriefPackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-briefversioninfo-0000002271000657", + "title": "BriefVersionInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-connectret-0000002271160589", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contactinfo-0000002328805225", + "title": "ContactInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-contractobligationmode-0000002328924941", + "title": "ContractObligationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custinfo-0000002504067925", + "title": "CustInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-customchapter-0000002294845694", + "title": "CustomChapter" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-custominfo-0000002295005358", + "title": "CustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dataitem-0000002328924933", + "title": "DataItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentqual-0000002271160605", + "title": "DependentQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-dependentquallang-0000002271000661", + "title": "DependentQualLang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicematerial-0000002236201274", + "title": "DeviceMaterial" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-devicemultipermissionreason-0000002294885664", + "title": "DeviceMultiPermissionReason" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicepermission-0000002294845674", + "title": "DevicePermission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-devicetypeinfo-0000002236201270", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-developerinfo-0000002649369326", + "title": "DeveloperInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extendinfo-0000002328924981", + "title": "ExtendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-extfieldcustominfo-0000002328924997", + "title": "ExtFieldCustomInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fileinfo-0000002236041466", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-fullservicemode-0000002294845638", + "title": "FullServiceMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-groupinfo-0000002678290865", + "title": "GroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infoaccess-0000002328805233", + "title": "InfoAccess" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infocancel-0000002328924989", + "title": "InfoCancel" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infodelete-0000002294845690", + "title": "InfoDelete" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-infomodify-0000002295005354", + "title": "InfoModify" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lang-0000002649209416", + "title": "Lang" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-langfileinfo-0000002271000653", + "title": "LangFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-languageinfo-0000002236041462", + "title": "LanguageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-lawregulationmode-0000002295005342", + "title": "LawRegulationMode" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-managepersionalinfo-0000002328924985", + "title": "ManagePersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-memberrolelist-0000002679449001", + "title": "MemberRoleList" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-opentestinfo-0000002678282119", + "title": "OpenTestInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-otherratingresult-0000002621935699", + "title": "OtherRatingResult" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packageinfo-0000002328964965", + "title": "PackageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/publish-api-packagepermissionintrovedio-0000002236201278", + "title": "PackagePermissionIntroVideo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-packagestates-0000002271160601", + "title": "PackageStates" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-pair-0000002271000645", + "title": "Pair" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-permission-0000002328924977", + "title": "Permission" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-personalinfo-0000002328805173", + "title": "PersonalInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-phasedreleaseinfo-0000002271160597", + "title": "PhasedReleaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationfileinfo-0000002271160609", + "title": "QualificationFileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualificationinfo-0000002236201286", + "title": "QualificationInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-qualreviewtaskinfo-0000002271000665", + "title": "QualReviewTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-recommendinfo-0000002328805177", + "title": "RecommendInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-requiredinfo-0000002295005294", + "title": "RequiredInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-role-0000002679289169", + "title": "Role" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sceneitem-0000002294845634", + "title": "SceneItem" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-sdkinfo-0000002295005346", + "title": "SdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicestop-0000002328805237", + "title": "ServiceStop" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-servicetypeinfo-0000002328805213", + "title": "ServiceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-storageinfo-0000002295005350", + "title": "StorageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-subagreement-0000002328805241", + "title": "SubAgreement" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqual-0000002236201282", + "title": "TagQual" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-tagqualinfo-0000002236041478", + "title": "TagQualInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-publish-api-data-testtaskinfo-0000002648371004", + "title": "TestTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsdkinfo-0000002328805217", + "title": "ThirdSdkInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-thirdsharedinfo-0000002294845678", + "title": "ThirdSharedInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionchangedesc-0000002294845686", + "title": "VersionChangeDesc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvoc-0000002495156924", + "title": "VersionVoc" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-app-shelf-off-0000002236041450", + "title": "下架应用" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-0000002236201266", + "status": "browser-read", + "tables": [], + "title": "数据模型", + "updatedAt": "2026-07-31 17:44", + "checkedAt": "2026-10-07T04:39:06.640Z" +} diff --git a/pkg/domain/reference/supplemental/serverless-agc-auth-obtain-apiauthorization-0000001374178549.json b/pkg/domain/reference/supplemental/serverless-agc-auth-obtain-apiauthorization-0000001374178549.json new file mode 100644 index 0000000..27eb5bf --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agc-auth-obtain-apiauthorization-0000001374178549.json @@ -0,0 +1,439 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-console-0000001325045601", + "title": "开发者中心配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section172553511916", + "title": "(推荐)Service Account方式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section8100153831815", + "title": "API客户端方式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "title": "创建Service Account" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "title": "获取鉴权令牌" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section628511528139", + "title": "访问API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-team-account-rolepermission-0000002735800564", + "title": "角色与权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/HMSCore-Examples/server-sample-code-0000001057110387", + "title": "服务端示例代码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section206281157202011", + "title": "获取访问API的Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section18775752151812", + "title": "访问API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-team-account-rolepermission-0000002735800564", + "title": "角色与权限" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain-token-project-0000001477336048", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-download-credentials-0000001281251800", + "title": "下载项目级凭证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section172553511916", + "title": "(推荐)Service Account方式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "title": "创建服务账号凭证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "title": "获取鉴权令牌" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section628511528139", + "title": "访问API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section8100153831815", + "title": "API客户端方式" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "title": "创建API客户端凭证(项目级)" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section206281157202011", + "title": "获取访问API的Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section18775752151812", + "title": "访问API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "text": "在向服务端发起REST API请求前,您需要先获得服务端的授权。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "text": "获得授权的方式有如下两种:" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "text": "(推荐)Service Account方式 使用Service Account(服务账号),您可以实现服务器与服务器之间接口的鉴权,相比API客户端方式更安全。 说明 Service Account即将替代API客户端,新创建凭据请您选择Service Account,并请尽快将您使用的API客户端切换到Service Account。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "text": "使用Service Account(服务账号),您可以实现服务器与服务器之间接口的鉴权,相比API客户端方式更安全。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "text": "Service Account即将替代API客户端,新创建凭据请您选择Service Account,并请尽快将您使用的API客户端切换到Service Account。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "text": "API客户端方式 使用API客户端,您可以以应用的身份进行API操作,API访问权限由API客户端的角色来确定。此方式适合开发者自己的IT系统对接HarmonyOS 开发者中心时使用。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "text": "使用API客户端,您可以以应用的身份进行API操作,API访问权限由API客户端的角色来确定。此方式适合开发者自己的IT系统对接HarmonyOS 开发者中心时使用。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section172553511916", + "text": "要发起一个基本的Service Account方式的API调用,您需要在HarmonyOS 开发者中心中管理您的Service Account。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section172553511916", + "text": "基本流程如下:" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section172553511916", + "text": "创建Service Account" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section172553511916", + "text": "获取鉴权令牌" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section172553511916", + "text": "访问API" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "服务账号凭证是用于管理使用Service Account鉴权方式访问API的身份凭据,您可以给不同角色创建不同的服务账号凭证,使不同角色可以访问对应权限的API。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "登录HarmonyOS 开发者中心,进入“开发者管理”页面。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "左侧导航栏选择“ID、证书和Profile > 凭证”,选择“项目级凭证”页签,在“服务账号凭证”栏点击“创建”。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "在“创建服务账号凭证”页面,配置相关信息后,点击“确认”。 参数 说明 凭证名称 输入自定义的服务账号名称。 凭证级别 默认为“项目级凭证”,不可更改。 项目 选择你希望通过创建的项目级凭据访问的项目。 角色 选择的角色决定了该服务账号密钥具有的权限,具体角色对应的权限请参考角色与权限。 描述 填写服务账号描述。 公钥 点击下方“生成公私钥”,平台会为您生成公私钥。公钥信息会填充至“公钥”文本框,私钥将包含在凭证文件中。 注意 如果不点击“生成公私钥”,后续下载的凭证文件中将不包含私钥信息。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "服务账号创建成功,平台将自动下载对应的“******private.json”格式的凭证文件。 凭证文件信息如下,请妥善保存。 { \"project_id\": \"244********17868\", \"key_id\": \"79******b9\", \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n******\\n-----END PRIVATE KEY-----\\n\", \"sub_account\": \"10*****19\", \"auth_uri\": \"https://******\", \"token_uri\": \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\", \"auth_provider_cert_uri\": \"https://******\", \"client_cert_uri\": \"https://******\" }" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "凭证文件信息如下,请妥善保存。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "{ \"project_id\": \"244********17868\", \"key_id\": \"79******b9\", \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n******\\n-----END PRIVATE KEY-----\\n\", \"sub_account\": \"10*****19\", \"auth_uri\": \"https://******\", \"token_uri\": \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\", \"auth_provider_cert_uri\": \"https://******\", \"client_cert_uri\": \"https://******\" }" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126", + "text": "(可选)每个服务账号凭证最多可以添加10对公私钥,可点击服务账号凭证所在行的“添加”增加新的公私钥。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "创建服务账号凭证后,您可以使用凭据文件中返回的key_id和private_key来获取鉴权令牌,从而访问API。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "Service Account鉴权令牌为JWT(JSON Web Token)格式字符串,JWT数据格式包括Header(头部)、Payload(负载)和Signature(签名),示例:eyJraWQiOiIx******.eyJhdWQiOiJodHR******.QRodgXa2xeXSt4Gp******" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "生成JWT Header数据。 根据文件中的key_id字段拼接JSON体,对JSON体进行BASE64编码,生成Header数据,示例:eyJraWQiOiIx******。 { \"kid\": \"79******b9\", \"typ\": \"JWT\", \"alg\": \"PS256\" } 参数 说明 kid 填写JSON凭据文件中的key_id字段的值。 typ 数据类型,固定为:JWT。 alg 算法类型,固定为:PS256。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "根据文件中的key_id字段拼接JSON体,对JSON体进行BASE64编码,生成Header数据,示例:eyJraWQiOiIx******。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "{ \"kid\": \"79******b9\", \"typ\": \"JWT\", \"alg\": \"PS256\" }" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "生成JWT Payload数据。 根据文件中的sub_account字段拼接JSON体,对JSON体进行BASE64编码,生成Payload数据,示例:eyJhdWQiOiJodHR******。 { \"aud\": \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\", \"iss\": \"10*****19\", \"exp\": 1581410664, \"iat\": 1581407064 } 参数 说明 aud 固定为:https://oauth-login.cloud.huawei.com/oauth2/v3/token。 iss JSON凭据文件中sub_account字段的值,标识数据生成者。 exp JWT到期时间,UTC时间戳,比iat晚3600秒。 iat JWT签发时间,UTC时间戳,为自UTC时间1970年1月1日00:00:00的秒数(您的服务器时间需要校准为标准时间)。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "根据文件中的sub_account字段拼接JSON体,对JSON体进行BASE64编码,生成Payload数据,示例:eyJhdWQiOiJodHR******。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "{ \"aud\": \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\", \"iss\": \"10*****19\", \"exp\": 1581410664, \"iat\": 1581407064 }" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "生成JWT Signature数据。 将完成BASE64编码后的Header字符串与Payload字符串,通过“.”进行连接,并在业务应用中,通过密钥JSON文件中的private_key(华为不进行存储,请您妥善保管),使用SHA256withRSA/PSS算法对拼接的字符串签名,生成Signature数据,示例:QRodgXa2xeXSt4Gp******。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "将完成BASE64编码后的Header字符串与Payload字符串,通过“.”进行连接,并在业务应用中,通过密钥JSON文件中的private_key(华为不进行存储,请您妥善保管),使用SHA256withRSA/PSS算法对拼接的字符串签名,生成Signature数据,示例:QRodgXa2xeXSt4Gp******。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "您可以在应用程序中参考如下代码来获取鉴权令牌,完整Demo请参见服务端示例代码。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310", + "text": "public class JWTGenerateDemo { // please replace it with the private_key in your json file // this is the plain text in this demo, please encrypt the private key in your code, only get the string between // '-----BEGIN PRIVATE KEY-----\\n' and '\\n-----END PRIVATE KEY-----\\n' private static final String PRIVATE_KEY = \"******\"; // please replace it with the sub_account in your json file private static final String ISS = \"10*****19\"; // please replace it with the key_id in your json file private static final String KID = \"79******b9\"; private static final String AUD = \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\"; private static final String ALG_PS256 = \"PS256\"; private static final String DOT = \".\"; private static PrivateKey getPrivateKey(String key) throws NoSuchAlgorithmException, InvalidKeySpecException { PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decodeBase64(key)); KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\"); return keyFactory.generatePrivate(keySpec); } private static byte[] decodeBase64(String Base64Str) { return Base64.decodeBase64(Base64Str.getBytes(StandardCharsets.UTF_8)); } private String createJwt() throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException { long iat = System.currentTimeMillis() / 1000; long exp = iat + 3600; // jwt header JSONObject header = new JSONObject(); header.put(\"alg\", ALG_PS256); header.put(\"kid\", KID); header.put(\"typ\", \"JWT\"); // jwt payload JSONObject payload = new JSONObject(); payload.put(\"aud\", AUD); payload.put(\"iss\", ISS); payload.put(\"exp\", exp); payload.put(\"iat\", iat); // jwt signature byte[] encodeHeaderBytes = Base64.encodeBase64URLSafe(header.toString().getBytes(StandardCharsets.UTF_8)); byte[] encodePayloadBytes = Base64.encodeBase64URLSafe(payload.toString().getBytes(StandardCharsets.UTF_8)); String encodeHeader = new String(encodeHeaderBytes, StandardCharsets.UTF_8); String encodePayload = new String(encodePayloadBytes, StandardCharsets.UTF_8); String jwtHeaderAndPayload = encodeHeader + DOT + encodePayload; Signature signatureInstance = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider()); signatureInstance.initSign(getPrivateKey(PRIVATE_KEY)); signatureInstance.update(jwtHeaderAndPayload.getBytes(StandardCharsets.UTF_8)); String signature = new String(Objects.requireNonNull(Base64.encodeBase64URLSafe(signatureInstance.sign())), StandardCharsets.UTF_8); return jwtHeaderAndPayload + DOT + signature; } public static void main(String args[]) throws InvalidKeySpecException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { JWTGenerateDemo JWTGenerateDemo = new JWTGenerateDemo(); System.out.println(JWTGenerateDemo.createJwt()); } }" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section628511528139", + "text": "在调用API时,把已获取的鉴权令牌置于Authorization头部以完成鉴权。" + }, + { + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section628511528139", + "text": "GET /v1/demo/indexes HTTP/1.1 Authorization: Bearer eyJraWQiOiIx******.eyJhdWQiOiJodHR******.QRodgXa2xeXSt4Gp****** Host: connect-api.cloud.huawei.com" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section8100153831815", + "text": "要发起一个基本的API客户端方式的API调用,您需要在HarmonyOS 开发者中心中管理您的API客户端,API只能由您的团队账号所有者管理。" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section8100153831815", + "text": "基本流程具体如下:" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section8100153831815", + "text": "创建API客户端" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section8100153831815", + "text": "获取访问API的Token" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "text": "API客户端凭证是用于管理使用API客户端鉴权方式访问API的身份凭据,您可以给不同角色创建不同的API客户端凭证,使不同角色可以访问对应权限的API。" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "text": "左侧导航栏选择“ID、证书和Profile > 凭证”,选择“项目级凭证”页签,在“API客户端凭证”栏点击“创建”。" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "text": "在“创建API客户端凭证”页面,配置相关信息。 参数 说明 凭证名称 输入自定义的API客户端名称。 项目 选择服务所属的项目。 角色 选择的角色决定了该API客户端具有的权限,具体角色对应的权限请参考角色与权限。" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016", + "text": "API客户端凭证创建成功后,可获取“凭证ID”和“密钥”。后续需要使用凭证ID和密钥获取访问API的Token。" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section206281157202011", + "text": "创建完API客户端后需要到华为HarmonyOS 开发者中心进行鉴权,鉴权通过后将获得Access Token,用户凭借该Access Token即可访问REST API。您可以调用获取Token接口来获取Access Token。" + }, + { + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section18775752151812", + "text": "获取鉴权通过后的Access Token后,您即可以调用对应的服务API来完成相应的功能开发。" + } + ], + "renderedText": "指南\n认证服务\n开发者中心配置\n获取服务端API授权\n获取服务端API授权\n更新时间: 2026-10-22 11:25\n\n在向服务端发起REST API请求前,您需要先获得服务端的授权。\n\n获得授权的方式有如下两种:\n\n(推荐)Service Account方式\n\n使用Service Account(服务账号),您可以实现服务器与服务器之间接口的鉴权,相比API客户端方式更安全。\n\n说明\n\nService Account即将替代API客户端,新创建凭据请您选择Service Account,并请尽快将您使用的API客户端切换到Service Account。\n\nAPI客户端方式\n\n使用API客户端,您可以以应用的身份进行API操作,API访问权限由API客户端的角色来确定。此方式适合开发者自己的IT系统对接HarmonyOS 开发者中心时使用。\n\n(推荐)Service Account方式\n\n要发起一个基本的Service Account方式的API调用,您需要在HarmonyOS 开发者中心中管理您的Service Account。\n\n基本流程如下:\n\n创建Service Account\n获取鉴权令牌\n访问API\n创建服务账号凭证\n\n服务账号凭证是用于管理使用Service Account鉴权方式访问API的身份凭据,您可以给不同角色创建不同的服务账号凭证,使不同角色可以访问对应权限的API。\n\n登录HarmonyOS 开发者中心,进入“开发者管理”页面。\n左侧导航栏选择“ID、证书和Profile > 凭证”,选择“项目级凭证”页签,在“服务账号凭证”栏点击“创建”。\n\n在“创建服务账号凭证”页面,配置相关信息后,点击“确认”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n凭证名称\n\n\t\n\n输入自定义的服务账号名称。\n\n\n\n\n凭证级别\n\n\t\n\n默认为“项目级凭证”,不可更改。\n\n\n\n\n项目\n\n\t\n\n选择你希望通过创建的项目级凭据访问的项目。\n\n\n\n\n角色\n\n\t\n\n选择的角色决定了该服务账号密钥具有的权限,具体角色对应的权限请参考角色与权限。\n\n\n\n\n描述\n\n\t\n\n填写服务账号描述。\n\n\n\n\n公钥\n\n\t\n\n点击下方“生成公私钥”,平台会为您生成公私钥。公钥信息会填充至“公钥”文本框,私钥将包含在凭证文件中。\n\n注意\n\n如果不点击“生成公私钥”,后续下载的凭证文件中将不包含私钥信息。\n\n服务账号创建成功,平台将自动下载对应的“******private.json”格式的凭证文件。\n\n凭证文件信息如下,请妥善保存。\n\n{\n \"project_id\": \"244********17868\",\n \"key_id\": \"79******b9\",\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n******\\n-----END PRIVATE KEY-----\\n\",\n \"sub_account\": \"10*****19\",\n \"auth_uri\": \"https://******\",\n \"token_uri\": \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\",\n \"auth_provider_cert_uri\": \"https://******\",\n \"client_cert_uri\": \"https://******\"\n}\n(可选)每个服务账号凭证最多可以添加10对公私钥,可点击服务账号凭证所在行的“添加”增加新的公私钥。\n\n获取鉴权令牌\n\n创建服务账号凭证后,您可以使用凭据文件中返回的key_id和private_key来获取鉴权令牌,从而访问API。\n\nService Account鉴权令牌为JWT(JSON Web Token)格式字符串,JWT数据格式包括Header(头部)、Payload(负载)和Signature(签名),示例:eyJraWQiOiIx******.eyJhdWQiOiJodHR******.QRodgXa2xeXSt4Gp******\n\n生成JWT Header数据。\n\n根据文件中的key_id字段拼接JSON体,对JSON体进行BASE64编码,生成Header数据,示例:eyJraWQiOiIx******。\n\n{\n \"kid\": \"79******b9\",\n \"typ\": \"JWT\",\n \"alg\": \"PS256\"\n}\n\n参数\n\n\t\n\n说明\n\n\n\n\nkid\n\n\t\n\n填写JSON凭据文件中的key_id字段的值。\n\n\n\n\ntyp\n\n\t\n\n数据类型,固定为:JWT。\n\n\n\n\nalg\n\n\t\n\n算法类型,固定为:PS256。\n\n生成JWT Payload数据。\n\n根据文件中的sub_account字段拼接JSON体,对JSON体进行BASE64编码,生成Payload数据,示例:eyJhdWQiOiJodHR******。\n\n{\n \"aud\": \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\",\n \"iss\": \"10*****19\",\n \"exp\": 1581410664,\n \"iat\": 1581407064\n}\n\n参数\n\n\t\n\n说明\n\n\n\n\naud\n\n\t\n\n固定为:https://oauth-login.cloud.huawei.com/oauth2/v3/token。\n\n\n\n\niss\n\n\t\n\nJSON凭据文件中sub_account字段的值,标识数据生成者。\n\n\n\n\nexp\n\n\t\n\nJWT到期时间,UTC时间戳,比iat晚3600秒。\n\n\n\n\niat\n\n\t\n\nJWT签发时间,UTC时间戳,为自UTC时间1970年1月1日00:00:00的秒数(您的服务器时间需要校准为标准时间)。\n\n生成JWT Signature数据。\n\n将完成BASE64编码后的Header字符串与Payload字符串,通过“.”进行连接,并在业务应用中,通过密钥JSON文件中的private_key(华为不进行存储,请您妥善保管),使用SHA256withRSA/PSS算法对拼接的字符串签名,生成Signature数据,示例:QRodgXa2xeXSt4Gp******。\n\n您可以在应用程序中参考如下代码来获取鉴权令牌,完整Demo请参见服务端示例代码。\n\npublic class JWTGenerateDemo {\n // please replace it with the private_key in your json file\n // this is the plain text in this demo, please encrypt the private key in your code, only get the string between\n // '-----BEGIN PRIVATE KEY-----\\n' and '\\n-----END PRIVATE KEY-----\\n'\n private static final String PRIVATE_KEY = \"******\";\n\n // please replace it with the sub_account in your json file\n private static final String ISS = \"10*****19\";\n\n // please replace it with the key_id in your json file\n private static final String KID = \"79******b9\";\n\n private static final String AUD = \"https://oauth-login.cloud.huawei.com/oauth2/v3/token\";\n\n private static final String ALG_PS256 = \"PS256\";\n\n private static final String DOT = \".\";\n\n private static PrivateKey getPrivateKey(String key) throws NoSuchAlgorithmException, InvalidKeySpecException {\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decodeBase64(key));\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n return keyFactory.generatePrivate(keySpec);\n }\n\n private static byte[] decodeBase64(String Base64Str) {\n return Base64.decodeBase64(Base64Str.getBytes(StandardCharsets.UTF_8));\n }\n\n private String createJwt()\n throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException {\n long iat = System.currentTimeMillis() / 1000;\n long exp = iat + 3600;\n\n // jwt header\n JSONObject header = new JSONObject();\n header.put(\"alg\", ALG_PS256);\n header.put(\"kid\", KID);\n header.put(\"typ\", \"JWT\");\n\n // jwt payload\n JSONObject payload = new JSONObject();\n payload.put(\"aud\", AUD);\n payload.put(\"iss\", ISS);\n payload.put(\"exp\", exp);\n payload.put(\"iat\", iat);\n\n // jwt signature\n byte[] encodeHeaderBytes = Base64.encodeBase64URLSafe(header.toString().getBytes(StandardCharsets.UTF_8));\n byte[] encodePayloadBytes = Base64.encodeBase64URLSafe(payload.toString().getBytes(StandardCharsets.UTF_8));\n String encodeHeader = new String(encodeHeaderBytes, StandardCharsets.UTF_8);\n String encodePayload = new String(encodePayloadBytes, StandardCharsets.UTF_8);\n String jwtHeaderAndPayload = encodeHeader + DOT + encodePayload;\n Signature signatureInstance = Signature.getInstance(\"SHA256withRSA/PSS\", new BouncyCastleProvider());\n signatureInstance.initSign(getPrivateKey(PRIVATE_KEY));\n signatureInstance.update(jwtHeaderAndPayload.getBytes(StandardCharsets.UTF_8));\n String signature =\n new String(Objects.requireNonNull(Base64.encodeBase64URLSafe(signatureInstance.sign())), StandardCharsets.UTF_8);\n\n return jwtHeaderAndPayload + DOT + signature;\n }\n\n public static void main(String args[])\n throws InvalidKeySpecException, NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n JWTGenerateDemo JWTGenerateDemo = new JWTGenerateDemo();\n System.out.println(JWTGenerateDemo.createJwt());\n }\n}\n访问API\n\n在调用API时,把已获取的鉴权令牌置于Authorization头部以完成鉴权。\n\nGET /v1/demo/indexes HTTP/1.1\nAuthorization: Bearer eyJraWQiOiIx******.eyJhdWQiOiJodHR******.QRodgXa2xeXSt4Gp******\nHost: connect-api.cloud.huawei.com\nAPI客户端方式\n\n要发起一个基本的API客户端方式的API调用,您需要在HarmonyOS 开发者中心中管理您的API客户端,API只能由您的团队账号所有者管理。\n\n基本流程具体如下:\n\n创建API客户端\n获取访问API的Token\n访问API\n创建API客户端凭证(项目级)\n\nAPI客户端凭证是用于管理使用API客户端鉴权方式访问API的身份凭据,您可以给不同角色创建不同的API客户端凭证,使不同角色可以访问对应权限的API。\n\n登录HarmonyOS 开发者中心,进入“开发者管理”页面。\n左侧导航栏选择“ID、证书和Profile > 凭证”,选择“项目级凭证”页签,在“API客户端凭证”栏点击“创建”。\n\n在“创建API客户端凭证”页面,配置相关信息。\n\n参数\n\n\t\n\n说明\n\n\n\n\n凭证名称\n\n\t\n\n输入自定义的API客户端名称。\n\n\n\n\n项目\n\n\t\n\n选择服务所属的项目。\n\n\n\n\n角色\n\n\t\n\n选择的角色决定了该API客户端具有的权限,具体角色对应的权限请参考角色与权限。\n\nAPI客户端凭证创建成功后,可获取“凭证ID”和“密钥”。后续需要使用凭证ID和密钥获取访问API的Token。\n\n获取访问API的Token\n\n创建完API客户端后需要到华为HarmonyOS 开发者中心进行鉴权,鉴权通过后将获得Access Token,用户凭借该Access Token即可访问REST API。您可以调用获取Token接口来获取Access Token。\n\n访问API\n\n获取鉴权通过后的Access Token后,您即可以调用对应的服务API来完成相应的功能开发。\n\n下载项目级凭证\n获取客户端API授权\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n(推荐)Service Account方式\n创建服务账号凭证\n获取鉴权令牌\n访问API\nAPI客户端方式\n创建API客户端凭证(项目级)\n获取访问API的Token\n访问API\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "凭证名称", + "输入自定义的服务账号名称。" + ], + [ + "凭证级别", + "默认为“项目级凭证”,不可更改。" + ], + [ + "项目", + "选择你希望通过创建的项目级凭据访问的项目。" + ], + [ + "角色", + "选择的角色决定了该服务账号密钥具有的权限,具体角色对应的权限请参考角色与权限。" + ], + [ + "描述", + "填写服务账号描述。" + ], + [ + "公钥", + "点击下方“生成公私钥”,平台会为您生成公私钥。公钥信息会填充至“公钥”文本框,私钥将包含在凭证文件中。 注意 如果不点击“生成公私钥”,后续下载的凭证文件中将不包含私钥信息。" + ] + ], + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section47096509126" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "kid", + "填写JSON凭据文件中的key_id字段的值。" + ], + [ + "typ", + "数据类型,固定为:JWT。" + ], + [ + "alg", + "算法类型,固定为:PS256。" + ] + ], + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "aud", + "固定为:https://oauth-login.cloud.huawei.com/oauth2/v3/token。" + ], + [ + "iss", + "JSON凭据文件中sub_account字段的值,标识数据生成者。" + ], + [ + "exp", + "JWT到期时间,UTC时间戳,比iat晚3600秒。" + ], + [ + "iat", + "JWT签发时间,UTC时间戳,为自UTC时间1970年1月1日00:00:00的秒数(您的服务器时间需要校准为标准时间)。" + ] + ], + "section": "(推荐)Service Account方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section276512551310" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "凭证名称", + "输入自定义的API客户端名称。" + ], + [ + "项目", + "选择服务所属的项目。" + ], + [ + "角色", + "选择的角色决定了该API客户端具有的权限,具体角色对应的权限请参考角色与权限。" + ] + ], + "section": "API客户端方式", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549#section186371930132016" + } + ], + "title": "获取服务端API授权", + "updatedAt": "2026-10-22 11:25" +} diff --git a/pkg/domain/reference/supplemental/serverless-agc-auth-obtain-client-apiauthorization-0000001453744605.json b/pkg/domain/reference/supplemental/serverless-agc-auth-obtain-client-apiauthorization-0000001453744605.json new file mode 100644 index 0000000..631f62a --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agc-auth-obtain-client-apiauthorization-0000001453744605.json @@ -0,0 +1,63 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-console-0000001325045601", + "title": "开发者中心配置" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605#ZH-CN_TOPIC_0000002769572721__li168721829143617", + "title": "3" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-apiauthorization-0000001374178549", + "title": "获取服务端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-android-0000001053333939", + "title": "Android" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "text": "访问端侧网关的客户端需要具备有效的Client ID以及Client Secret,才能通过端侧网关的鉴权校验并对业务接口发起有效调用。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "text": "登录HarmonyOS 开发者中心,进入“开发者管理”页面。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "text": "左侧导航栏选择“ID、证书和Profile > APP ID”,点击“项目管理”页签。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "text": "在项目管理页面顶部选择您的项目,记录“项目”栏下的“Client ID”和“Client Secret”。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "text": "调用获取Token接口,获取访问客户端REST API的Access Token。您在3中记录的“Client ID”和“Client Secret”将作为请求参数在调用时传入。" + } + ], + "renderedText": "指南\n认证服务\n开发者中心配置\n获取客户端API授权\n获取客户端API授权\n更新时间: 2026-10-21 11:02\n\n访问端侧网关的客户端需要具备有效的Client ID以及Client Secret,才能通过端侧网关的鉴权校验并对业务接口发起有效调用。\n\n登录HarmonyOS 开发者中心,进入“开发者管理”页面。\n左侧导航栏选择“ID、证书和Profile > APP ID”,点击“项目管理”页签。\n在项目管理页面顶部选择您的项目,记录“项目”栏下的“Client ID”和“Client Secret”。\n\n调用获取Token接口,获取访问客户端REST API的Access Token。您在3中记录的“Client ID”和“Client Secret”将作为请求参数在调用时传入。\n获取服务端API授权\nAndroid\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-obtain-client-apiauthorization-0000001453744605", + "status": "browser-read", + "tables": [], + "title": "获取客户端API授权", + "updatedAt": "2026-10-21 11:02" +} diff --git a/pkg/domain/reference/supplemental/serverless-agc-auth-verifycode-langtype-0000002563105507.json b/pkg/domain/reference/supplemental/serverless-agc-auth-verifycode-langtype-0000002563105507.json new file mode 100644 index 0000000..ca577bb --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agc-auth-verifycode-langtype-0000002563105507.json @@ -0,0 +1,349 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-appendix-0000002287765437", + "title": "附录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-adjust-sms-sending-0000002287652381", + "title": "关于认证服务短信发送能力调整的通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "指南\n认证服务\n附录\n认证服务验证码语言类型\n认证服务验证码语言类型\n更新时间: 2026-03-25 10:07\n\n语言代码\n\n\t\n\n语言描述\n\n\n\n\nam_ET\n\n\t\n\n阿姆哈拉语\n\n\n\n\nar_EG\n\n\t\n\n阿拉伯语\n\n\n\n\nas_IN\n\n\t\n\n阿萨姆语\n\n\n\n\naz_AZ\n\n\t\n\n阿塞拜疆语\n\n\n\n\nbe_BY\n\n\t\n\n白俄罗斯语\n\n\n\n\nbg_BG\n\n\t\n\n保加利亚语\n\n\n\n\nbn_BD\n\n\t\n\n孟加拉语\n\n\n\n\nbo_CN\n\n\t\n\n藏语\n\n\n\n\nbs_BA\n\n\t\n\n波斯尼亚语\n\n\n\n\nca_ES\n\n\t\n\n加泰罗尼亚语(西班牙)\n\n\n\n\ncs_CZ\n\n\t\n\n捷克语\n\n\n\n\nda_DK\n\n\t\n\n丹麦语\n\n\n\n\nde_DE\n\n\t\n\n德语\n\n\n\n\nel_GR\n\n\t\n\n希腊语\n\n\n\n\nen_GB\n\n\t\n\n英式英语\n\n\n\n\nen_US\n\n\t\n\n美式英语\n\n\n\n\nes_ES\n\n\t\n\n欧洲西语\n\n\n\n\nes_US\n\n\t\n\n拉美西语\n\n\n\n\net_EE\n\n\t\n\n爱沙尼亚语\n\n\n\n\neu_ES\n\n\t\n\n巴斯克语\n\n\n\n\nfa_IR\n\n\t\n\n波斯语\n\n\n\n\nfi_FI\n\n\t\n\n芬兰语\n\n\n\n\nfr_FR\n\n\t\n\n法语\n\n\n\n\ngl_ES\n\n\t\n\n加利西亚语\n\n\n\n\ngu_IN\n\n\t\n\n古吉拉特语\n\n\n\n\niw_IL\n\n\t\n\n希伯来语\n\n\n\n\nhi_IN\n\n\t\n\n印地语\n\n\n\n\nhr_HR\n\n\t\n\n克罗地亚语\n\n\n\n\nhu_HU\n\n\t\n\n匈牙利语\n\n\n\n\nin_ID\n\n\t\n\n印尼语\n\n\n\n\nit_IT\n\n\t\n\n意大利语\n\n\n\n\nja_JP\n\n\t\n\n日语\n\n\n\n\njv_Latn\n\n\t\n\n爪哇语\n\n\n\n\nka_GE\n\n\t\n\n格鲁吉亚语\n\n\n\n\nkk_KZ\n\n\t\n\n哈萨克语\n\n\n\n\nkm_KH\n\n\t\n\n高棉语\n\n\n\n\nkn_IN\n\n\t\n\n卡纳达语\n\n\n\n\nko_KR\n\n\t\n\n韩语\n\n\n\n\nlo_LA\n\n\t\n\n老挝语\n\n\n\n\nlt_LT\n\n\t\n\n立陶宛语\n\n\n\n\nlv_LV\n\n\t\n\n拉脱维亚语\n\n\n\n\nmai_IN\n\n\t\n\n迈蒂利语\n\n\n\n\nmi_NZ\n\n\t\n\n毛利语\n\n\n\n\nmk_MK\n\n\t\n\n马其顿语\n\n\n\n\nml_IN\n\n\t\n\n马来亚拉姆语\n\n\n\n\nmn_MN\n\n\t\n\n蒙古语(西里尔文)\n\n\n\n\nmr_IN\n\n\t\n\n马拉地语\n\n\n\n\nms_MY\n\n\t\n\n马来西亚语\n\n\n\n\nmy_MM\n\n\t\n\n缅甸语\n\n\n\n\nne_NP\n\n\t\n\n尼泊尔语\n\n\n\n\nnl_NL\n\n\t\n\n荷兰语\n\n\n\n\nnb_NO\n\n\t\n\n挪威语\n\n\n\n\nor_IN\n\n\t\n\n欧里亚语\n\n\n\n\npa_IN\n\n\t\n\n旁遮普语\n\n\n\n\npl_PL\n\n\t\n\n波兰语\n\n\n\n\npt_BR\n\n\t\n\n巴西葡语\n\n\n\n\npt_PT\n\n\t\n\n欧洲葡语\n\n\n\n\nro_RO\n\n\t\n\n罗马尼亚语\n\n\n\n\nru_RU\n\n\t\n\n俄语\n\n\n\n\nsi_LK\n\n\t\n\n僧伽罗语\n\n\n\n\nsk_SK\n\n\t\n\n斯洛伐克语\n\n\n\n\nsl_SI\n\n\t\n\n斯洛文尼亚语\n\n\n\n\nsr_latn\n\n\t\n\n塞尔维亚语\n\n\n\n\nsv_SE\n\n\t\n\n瑞典语\n\n\n\n\nsw_KE\n\n\t\n\n斯瓦西里语\n\n\n\n\nta_IN\n\n\t\n\n泰米尔语\n\n\n\n\nte_IN\n\n\t\n\n泰卢固语\n\n\n\n\nth_TH\n\n\t\n\n泰语\n\n\n\n\ntl_PH\n\n\t\n\n菲律宾语\n\n\n\n\ntr_TR\n\n\t\n\n土耳其语\n\n\n\n\nmy_ZG\n\n\t\n\n维吾尔语\n\n\n\n\nuk_UA\n\n\t\n\n乌克兰语\n\n\n\n\nur_PK\n\n\t\n\n乌尔都语\n\n\n\n\nuz_UZ\n\n\t\n\n乌兹别克语\n\n\n\n\nvi_VN\n\n\t\n\n越南语\n\n\n\n\nzh_CN\n\n\t\n\n简体中文\n\n\n\n\nzh_HK\n\n\t\n\n繁体中文(中国香港特别行政区)\n\n\n\n\nzh_TW\n\n\t\n\n繁体中文(中国台湾)\n\n关于认证服务短信发送能力调整的通知\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-verifycode-langtype-0000002563105507", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "语言代码", + "语言描述" + ], + [ + "am_ET", + "阿姆哈拉语" + ], + [ + "ar_EG", + "阿拉伯语" + ], + [ + "as_IN", + "阿萨姆语" + ], + [ + "az_AZ", + "阿塞拜疆语" + ], + [ + "be_BY", + "白俄罗斯语" + ], + [ + "bg_BG", + "保加利亚语" + ], + [ + "bn_BD", + "孟加拉语" + ], + [ + "bo_CN", + "藏语" + ], + [ + "bs_BA", + "波斯尼亚语" + ], + [ + "ca_ES", + "加泰罗尼亚语(西班牙)" + ], + [ + "cs_CZ", + "捷克语" + ], + [ + "da_DK", + "丹麦语" + ], + [ + "de_DE", + "德语" + ], + [ + "el_GR", + "希腊语" + ], + [ + "en_GB", + "英式英语" + ], + [ + "en_US", + "美式英语" + ], + [ + "es_ES", + "欧洲西语" + ], + [ + "es_US", + "拉美西语" + ], + [ + "et_EE", + "爱沙尼亚语" + ], + [ + "eu_ES", + "巴斯克语" + ], + [ + "fa_IR", + "波斯语" + ], + [ + "fi_FI", + "芬兰语" + ], + [ + "fr_FR", + "法语" + ], + [ + "gl_ES", + "加利西亚语" + ], + [ + "gu_IN", + "古吉拉特语" + ], + [ + "iw_IL", + "希伯来语" + ], + [ + "hi_IN", + "印地语" + ], + [ + "hr_HR", + "克罗地亚语" + ], + [ + "hu_HU", + "匈牙利语" + ], + [ + "in_ID", + "印尼语" + ], + [ + "it_IT", + "意大利语" + ], + [ + "ja_JP", + "日语" + ], + [ + "jv_Latn", + "爪哇语" + ], + [ + "ka_GE", + "格鲁吉亚语" + ], + [ + "kk_KZ", + "哈萨克语" + ], + [ + "km_KH", + "高棉语" + ], + [ + "kn_IN", + "卡纳达语" + ], + [ + "ko_KR", + "韩语" + ], + [ + "lo_LA", + "老挝语" + ], + [ + "lt_LT", + "立陶宛语" + ], + [ + "lv_LV", + "拉脱维亚语" + ], + [ + "mai_IN", + "迈蒂利语" + ], + [ + "mi_NZ", + "毛利语" + ], + [ + "mk_MK", + "马其顿语" + ], + [ + "ml_IN", + "马来亚拉姆语" + ], + [ + "mn_MN", + "蒙古语(西里尔文)" + ], + [ + "mr_IN", + "马拉地语" + ], + [ + "ms_MY", + "马来西亚语" + ], + [ + "my_MM", + "缅甸语" + ], + [ + "ne_NP", + "尼泊尔语" + ], + [ + "nl_NL", + "荷兰语" + ], + [ + "nb_NO", + "挪威语" + ], + [ + "or_IN", + "欧里亚语" + ], + [ + "pa_IN", + "旁遮普语" + ], + [ + "pl_PL", + "波兰语" + ], + [ + "pt_BR", + "巴西葡语" + ], + [ + "pt_PT", + "欧洲葡语" + ], + [ + "ro_RO", + "罗马尼亚语" + ], + [ + "ru_RU", + "俄语" + ], + [ + "si_LK", + "僧伽罗语" + ], + [ + "sk_SK", + "斯洛伐克语" + ], + [ + "sl_SI", + "斯洛文尼亚语" + ], + [ + "sr_latn", + "塞尔维亚语" + ], + [ + "sv_SE", + "瑞典语" + ], + [ + "sw_KE", + "斯瓦西里语" + ], + [ + "ta_IN", + "泰米尔语" + ], + [ + "te_IN", + "泰卢固语" + ], + [ + "th_TH", + "泰语" + ], + [ + "tl_PH", + "菲律宾语" + ], + [ + "tr_TR", + "土耳其语" + ], + [ + "my_ZG", + "维吾尔语" + ], + [ + "uk_UA", + "乌克兰语" + ], + [ + "ur_PK", + "乌尔都语" + ], + [ + "uz_UZ", + "乌兹别克语" + ], + [ + "vi_VN", + "越南语" + ], + [ + "zh_CN", + "简体中文" + ], + [ + "zh_HK", + "繁体中文(中国香港特别行政区)" + ], + [ + "zh_TW", + "繁体中文(中国台湾)" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-verifycode-langtype-0000002563105507" + } + ], + "title": "认证服务验证码语言类型", + "updatedAt": "2026-03-25 10:07" +} diff --git a/pkg/domain/reference/supplemental/serverless-agc-clouddb-agcconsole-objecttypes-0000001127675459.json b/pkg/domain/reference/supplemental/serverless-agc-clouddb-agcconsole-objecttypes-0000001127675459.json new file mode 100644 index 0000000..f2c0364 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agc-clouddb-agcconsole-objecttypes-0000001127675459.json @@ -0,0 +1,523 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-aboutclouddb-0000001080975612#section13972247121", + "title": "权限管理" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-managingclouddb-0000001080815650", + "title": "管理数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-managingdata-0000001080975864", + "title": "管理数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "title": "修改对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "title": "导出对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "title": "导入对象类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "text": "HarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "在对象类型列表中的“操作”列,点击“修改”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "输入“对象类型名”参数后,点击“下一步”。 对象类型名,即对象类型的名称。输入要求具体如下: 对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 对象类型名称必须以字母开头,以字母或者数字结尾。 对象类型名称中不区分字母的大小写。 对象类型名称不允许以“sqlite_”开头。 对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。 修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名,即对象类型的名称。输入要求具体如下:" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "字母(A-Z或a-z)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "数字(0-9)" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "特殊字符:_" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称必须以字母开头,以字母或者数字结尾。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称中不区分字母的大小写。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许以“sqlite_”开头。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改对象类型时,不允许修改对象类型名称。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。 参数 说明 字段 字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。 类型 字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。 主键 设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。 非空 设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。 加密 设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。 敏感 设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 默认值 字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。 参数 说明 索引 索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。 索引详情 索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置各角色的权限,具体角色和权限请参见权限管理。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "设置权限后,点击“确定”。" + }, + { + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413", + "text": "修改完成后返回对象类型列表中,可以查看已创建的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式 您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。 您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下: schemaVersion:对象类型的版本。 permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。 objectTypeName:对象类型名称,创建对象类型时自定义。 objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "schemaVersion:对象类型的版本。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "permissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypeName:对象类型名称,创建对象类型时自定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "objectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式 客户端 您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。 服务端 您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端 您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端 您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式 客户端 您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。 服务端 您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端 您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端 您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式 您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。 导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "具体操作步骤如下:" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "(可选)在“版本”处选择版本号。 未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择版本号时,会默认按照最新的版本导出对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择需要导出的对象类型,点击“导出”。 未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "未选择对象类型时,会默认导出所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择导出文件格式。 json格式 java格式 选择使用场景。 客户端:用于开发Android应用和HarmonyOS(Java)应用。 服务端:用于开发Server端的服务。 输入包名称,即java文件中的package名称。 包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_和. js格式 选择使用场景。 客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。 服务端:用于开发Server端的服务。 Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "json格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "java格式 选择使用场景。 客户端:用于开发Android应用和HarmonyOS(Java)应用。 服务端:用于开发Server端的服务。 输入包名称,即java文件中的package名称。 包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。 客户端:用于开发Android应用和HarmonyOS(Java)应用。 服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Android应用和HarmonyOS(Java)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "输入包名称,即java文件中的package名称。 包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "特殊字符:_和." + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "js格式 选择使用场景。 客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。 服务端:用于开发Server端的服务。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "选择使用场景。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "Objective-C格式" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "点击“导出”。 文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导出对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section1558018208151", + "text": "文件将会导出至本地,其内包含该版本中所有的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "您可以通过导入单个或者多个新增对象类型实现对象类型的创建。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "仅支持导入json格式文件,且导入的json文件需要保证格式完整。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“导入”,选择导入文件。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "点击“确定”。 导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + }, + { + "section": "导入对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section14234233178", + "text": "导入文件后,返回对象类型列表中,可以查看导入后的对象类型。" + } + ], + "renderedText": "指南\n云数据库 for Object\n管理数据库\n管理对象类型\n管理对象类型\n更新时间: 2026-10-22 11:41\n\n您可基于HarmonyOS 开发者中心对云侧存储区中的对象类型进行管理,支持创建、修改、导出和导入对象类型。系统会自动设置对象类型的版本,版本即对象类型的版本信息。通过对象类型的版本管理,您可以实现应用的升级维护和持续迭代,以便给应用用户带来更好的体验。应用正式上线后,及后续应用版本升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引,升级后新版本完全包含老版本的数据。\n\n云数据库提供隐私或者敏感数据的全程加密管理能力,您可以在控制台通过将涉及用户隐私或敏感数据的字段设置为加密字段或敏感字段,即可开启针对该字段数据的全程加密管理。开启全程加密功能后,云数据库SDK会在端侧将该字段的数据进行加密,然后再以密文形式发送并存储到云侧,只有应用用户依据其输入的密码才能获取密钥信息并访问自己的加密数据,从而有效防止用户隐私或敏感信息在云侧被窃取或者被泄露。加密数据仅支持数据的创建者编辑或者查看。\n\nHarmonyOS 开发者中心支持将创建的对象类型按照版本导出成为json格式、java格式、js格式或Objective-C格式文件。然后将该文件添加至本地开发环境中,并通过相应方法实现对象类型的定义和创建。在进行本地应用开发时,无需您再次创建对象类型。\n\n修改对象类型\n\n在HarmonyOS 开发者中心创建应用后,您可基于HarmonyOS 开发者中心创建或者修改对象类型。对象类型是用于存放对象的集合,用于存储应用产生的数据信息。\n\n注意\n由于当前端侧应用升级时,仅支持新增对象类型、在已有对象类型中新增字段或者索引。所以,应用正式上线后,不允许在HarmonyOS 开发者中心删除对象类型、字段或者索引,否则会导致端侧应用升级失败。\n应用正式上线后,不允许在已创建完成的对象类型中新增或者删除加密字段和敏感字段。如果您需要变更,可以重新创建对象类型,并重新设置加密字段和敏感字段。但是,新的对象类型将会无法继承原有对象类型的数据。因此,建议您在应用上线前的调测过程中,确认需要加密或敏感的字段,避免应用上线后加密字段和敏感字段的变更。同时,如果您开启了全程加密数据管理功能,我们建议您在端侧开启本地数据库加密,保障本地数据安全。\n当前仅Android、iOS、Web和快应用支持全程加密数据管理功能,后续会逐步开放其它平台。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n在对象类型列表中的“操作”列,点击“修改”。\n\n输入“对象类型名”参数后,点击“下一步”。\n\n对象类型名,即对象类型的名称。输入要求具体如下:\n\n对象类型的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n对象类型名称必须以字母开头,以字母或者数字结尾。\n对象类型名称中不区分字母的大小写。\n对象类型名称不允许以“sqlite_”开头。\n对象类型名称不允许使用系统保留名称: naturalbase_metadata、objecttypeinfohelper、t_data_upgrade_info、t_index_schema、t_nstore_config、t_schema_negotiate_info、t_metadata_schema、t_nstore_permission、t_system_config。\n修改对象类型时,不允许修改对象类型名称。\n点击“+新增字段”,在该对象类型中添加字段,配置如下参数后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n字段\n\n\t\n\n字段名称。\n\n输入要求具体如下:\n\n字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n字段名称必须以字母开头,以字母或者数字结尾。\n字段名称中不区分字母的大小写。\n每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。\n修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。\n修改对象类型时,支持删除字段。\n字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。\n\n\n\n类型\n\n\t\n\n字段的数据类型。\n\n当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。\n\n\n\n\n主键\n\n\t\n\n设置该字段是否为对象类型的主键。\n\n至少设置一个字段为主键。\n支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。\n数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。\n主键的值不允许更改。\n\n\n\n非空\n\n\t\n\n设置字段值是否为非空。\n\n数据类型为ByteArray和Date的字段不支持设置为非空。\n数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。\n主键默认非空,且不允许更改。\n设置为非空的字段不支持加密和敏感。\n\n\n\n加密\n\n\t\n\n设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。\n\n主键字段不支持加密。\n加密的字段不支持设置为非空。\n加密的字段不支持设置为敏感字段。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n字段设置为加密后,不支持导出该字段的数据值。\n数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。\n对象类型创建成功后,不支持修改加密属性。\n\n\n\n敏感\n\n\t\n\n设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。\n\n敏感字段不支持设置为主键。\n敏感字段不支持设置为非空。\n敏感字段不支持设置为加密。\n敏感字段不支持设置为默认值。\n对象类型创建成功后,不支持修改敏感属性。\n仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。\n敏感字段不支持设置为索引。\n一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。\n\n\n\n默认值\n\n\t\n\n字段为非空时,必须设置默认值。\n\n主键不支持设置默认值。\n加密字段和敏感字段不支持设置默认值。\n数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。\n数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。\n点击“+”新增索引,设置该对象类型的索引和索引详情。设置索引后,点击“下一步”。\n\n参数\n\n\t\n\n说明\n\n\n\n\n索引\n\n\t\n\n索引名称。\n\n输入要求具体如下:\n\n索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_\n索引名称必须以字母开头。\n索引名称中不区分字母的大小写。\n修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。\n每个对象类型可以设置小于或等于16个索引。\n数据类型为ByteArray和Text的字段不支持设置为索引。\n\n\n\n索引详情\n\n\t\n\n索引包含的字段和排序方式。\n\n支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。\n点击“索引详情”列的“+”,可以为索引增加更多的组成字段。\n支持索引按照升序或降序方式排序。\n设置各角色的权限,具体角色和权限请参见权限管理。\n设置权限后,点击“确定”。\n修改完成后返回对象类型列表中,可以查看已创建的对象类型。\n导出对象类型\n\n您可在HarmonyOS 开发者中心通过导出功能按照“版本”导出该版本所包含的对象类型定义。导出文件时,您可选导出文件格式,支持导出json格式、java格式、js格式或者Objective-C格式。\n\njson格式\n\n您可基于导出的json格式文件,在其内新增对象类型定义,但不支持修改原有的对象类型定义,通过导入功能将变更后的文件导入,可实现对象类型的新增,原有对象类型不会做更新处理。如果您在导出文件中既新增对象类型,又同时修改原有对象类型时,会导致导入失败。\n\n您在开发Web应用时,可直接将导出的json格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。导出的json文件中,部分字段含义如下:\n\nschemaVersion:对象类型的版本。\npermissions:对访问用户根据不同的角色进行权限管理,“Role”共包含“Everyone(所有人)”、“Authenticated user(认证用户)”、“Data creator(数据创建者)”和“Administrator(管理员)”;权限共包含“query”、“upsert”和“delete”三种权限,详细请参见权限管理。不同的对象类型可以自定义其访问用户的权限。\nobjectTypeName:对象类型名称,创建对象类型时自定义。\nobjectTypes:该数组中包含创建对象类型时,定义的索引属性和字段属性。\njava格式\n客户端\n\n您在开发Android应用和HarmonyOS(Java)应用时,可直接将导出的java格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和ObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;ObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n服务端\n\n您在使用Java开发服务端的服务时,可直接将导出的java格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\njs格式\n客户端\n\n您在开发Web应用、快应用,小程序、小游戏、快游戏、HarmonyOS(ArkTS API 9及以上)应用时,可直接将导出的js格式文件导入至本地开发环境,并通过相应方法实现对象类型模型的定义。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型的模型文件,其内容是各个对象类型模型的定义,在应用进行对象管理时使用。\n\n服务端\n\n您在使用JavaScript开发服务端的服务时,可直接将导出的js格式文件导入至本地开发环境,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件,其内容是各个对象类型的定义,用于您在开发服务端的服务时实现对象类型的定义和创建。\n\nObjective-C格式\n\n您在开发iOS应用时,可直接将导出的Objective-C格式文件导入至本地开发环境,并通过相应方法实现对象类型的定义和创建,无需再次在本地创建对象类型。\n\n导出的文件为文件压缩包,其内包含该版本下的全部对象类型定义文件和AGCCloudDBObjectTypeInfoHelper文件。对象类型定义文件内容是各个对象类型的定义;AGCCloudDBObjectTypeInfoHelper文件主要包含版本信息和对象类型信息,用于您在开发本地应用时实现对象类型的定义和创建。\n\n导出对象类型时,支持按照历史版本或者最新版本进行导出,即导出指定版本中的指定或所有对象类型。\n\n历史版本,主要用于端侧判断当前应用升级使用的版本。不允许将修改后的历史版本再次导入。\n最新版本,用于升级当前版本中的对象类型,如新增对象类型,字段和索引。将修改后的文件导入,可实现对象类型版本的升级。\n注意\n\n不允许修改导出的js格式和Objective-C格式文件,否则会导致数据同步功能异常。\n\n具体操作步骤如下:\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n(可选)在“版本”处选择版本号。\n\n未选择版本号时,会默认按照最新的版本导出对象类型。\n\n选择需要导出的对象类型,点击“导出”。\n\n未选择对象类型时,会默认导出所有的对象类型。\n\n选择导出文件格式。\njson格式\njava格式\n选择使用场景。\n客户端:用于开发Android应用和HarmonyOS(Java)应用。\n服务端:用于开发Server端的服务。\n输入包名称,即java文件中的package名称。\n包名称长度不超过1024个字符,必须以字母或者下划线开头,只能包含以下3种类型:\n字母(A-Z或a-z)\n数字(0-9)\n特殊字符:_和.\njs格式\n\n选择使用场景。\n\n客户端:用于开发Web应用、快应用、快游戏、小程序、小游戏、HarmonyOS(ArkTS API 9及以上)应用。\n服务端:用于开发Server端的服务。\nObjective-C格式\n点击“导出”。\n\n文件将会导出至本地,其内包含该版本中所有的对象类型。\n\n导入对象类型\n\n您可以通过导入单个或者多个新增对象类型实现对象类型的创建。\n\n注意\n创建或者修改对象类型及其属性参数时,规范要求请参见修改对象类型。\n单个导入文件大小不超过20MB,如超过20MB,需要分成多个文件导入。\n仅支持导入json格式文件,且导入的json文件需要保证格式完整。\n导入对象类型时,仅支持新增对象类型,不支持通过导入功能修改对象类型。\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n点击左上角切换至项目控制台,在项目列表中点击需要配置云数据库的项目。\n\n左侧导航栏选择“开放能力配置 > 云数据库”,进入云数据库页面。\n点击“导入”,选择导入文件。\n\n点击“确定”。\n\n导入文件后,返回对象类型列表中,可以查看导入后的对象类型。\n\n管理数据库\n管理数据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n修改对象类型\n导出对象类型\n导入对象类型\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "字段", + "字段名称。 输入要求具体如下: 字段的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 字段名称必须以字母开头,以字母或者数字结尾。 字段名称中不区分字母的大小写。 每个对象类型,仅支持设置一种自增类型字段:IntAutoIncrement或LongAutoIncrement。 修改对象类型时,不支持新增数据类型为IntAutoIncrement或LongAutoIncrement的字段,支持新增其它数据类型的字段。 修改对象类型时,支持删除字段。 字段名称不允许使用系统保留字段名称: naturalbase_version、naturalbase_deleted、naturalbase_operationtype、naturalbase_creator、naturalbase_accesstime、naturalbase_operationtime、naturalbase_syncstatus、naturalbase_changedfieldsbitmap、naturalbase_lastmodifier、cmin、cmax、xmin、xmax、ctid、oid、tableoid、xc_node_id、tablebucketid、rowid。" + ], + [ + "类型", + "字段的数据类型。 当前支持的数据类型:String、Boolean、Byte、Short、Integer、Long、Float、Double、ByteArray、Text、Date、IntAutoIncrement和LongAutoIncrement。" + ], + [ + "主键", + "设置该字段是否为对象类型的主键。 至少设置一个字段为主键。 支持设置复合主键,由多个字段组合成为主键,一个复合主键包含的字段小于或等于5个,复合主键字段顺序与字段的顺序一致。 数据类型为ByteArray、Text、Date、Double、Float和Boolean的字段不支持设置为主键。 主键的值不允许更改。" + ], + [ + "非空", + "设置字段值是否为非空。 数据类型为ByteArray和Date的字段不支持设置为非空。 数据类型为IntAutoIncrement和LongAutoIncrement的字段默认为非空,且不允许更改。 主键默认非空,且不允许更改。 设置为非空的字段不支持加密和敏感。" + ], + [ + "加密", + "设置字段是否需要加密,开启全程加密数据管理功能。选择加密后,该字段对应的数据会加密存储在存储区中。 主键字段不支持加密。 加密的字段不支持设置为非空。 加密的字段不支持设置为敏感字段。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。 字段设置为加密后,不支持导出该字段的数据值。 数据类型为ByteArray、Text、IntAutoIncrement和LongAutoIncrement的字段不支持加密。 对象类型创建成功后,不支持修改加密属性。" + ], + [ + "敏感", + "设置字段是否为敏感字段,选择敏感后,该字段对应的数据会加密存储在存储区中。 敏感字段不支持设置为主键。 敏感字段不支持设置为非空。 敏感字段不支持设置为加密。 敏感字段不支持设置为默认值。 对象类型创建成功后,不支持修改敏感属性。 仅支持数据类型为Byte、Short、Integer、Long、Float、Double、String和Date的字段设置为敏感字段。 敏感字段不支持设置为索引。 一个对象类型中包含的加密字段和敏感字段的总数需小于或等于5个。" + ], + [ + "默认值", + "字段为非空时,必须设置默认值。 主键不支持设置默认值。 加密字段和敏感字段不支持设置默认值。 数据类型为ByteArray、Date、IntAutoIncrement和LongAutoIncrement的字段不支持为其设置默认值。 数据类型为Text的字段设置默认值时,默认值的长度小于或等于200个字符。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + }, + { + "location": "", + "rows": [ + [ + "参数", + "说明" + ], + [ + "索引", + "索引名称。 输入要求具体如下: 索引的名称长度必须大于或等于1个字符,小于或等于30个字符,只能包含以下3种类型,并且至少包含“字母”类型: 字母(A-Z或a-z) 数字(0-9) 特殊字符:_ 索引名称必须以字母开头。 索引名称中不区分字母的大小写。 修改对象类型时,仅支持新增或者删除索引。当删除索引后,本次提交前不允许新增同名索引。 每个对象类型可以设置小于或等于16个索引。 数据类型为ByteArray和Text的字段不支持设置为索引。" + ], + [ + "索引详情", + "索引包含的字段和排序方式。 支持设置组合索引,由多个字段组合成为索引,一个组合索引包含的字段小于或等于5个。 点击“索引详情”列的“+”,可以为索引增加更多的组成字段。 支持索引按照升序或降序方式排序。" + ] + ], + "section": "修改对象类型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcconsole-objecttypes-0000001127675459#section3873193085413" + } + ], + "title": "管理对象类型", + "updatedAt": "2026-10-22 11:41" +} diff --git a/pkg/domain/reference/supplemental/serverless-agc-clouddb-restapi-0000001518509166.json b/pkg/domain/reference/supplemental/serverless-agc-clouddb-restapi-0000001518509166.json new file mode 100644 index 0000000..9d191dd --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agc-clouddb-restapi-0000001518509166.json @@ -0,0 +1,676 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-auth-enable-service-0000001274125746", + "title": "开通认证服务" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#ZH-CN_TOPIC_0000002764927439__li230415547508", + "title": "3" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "title": "用户登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "title": "查询数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "title": "更新数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "title": "删除数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-agcli-0000001180535238", + "title": "通过命令行使用云数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-app-data-migration-0000001496843917", + "title": "通过Server SDK将三方数据库内容迁移至云数据库" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section129829555317", + "title": "开发前准备" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "title": "获取客户端API授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "title": "用户登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "title": "查询数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "title": "更新数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "title": "删除数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166", + "text": "云数据库提供了REST API接口,您只需要访问相关URL,构造相关请求体即可调用该接口,完成数据管理的操作。" + }, + { + "section": "开发前准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section129829555317", + "text": "使用REST API管理数据,需要完成以下准备工作:" + }, + { + "section": "开发前准备", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section129829555317", + "text": "示例应用使用了认证用户的相关权限,需要开通认证服务中“匿名账号”服务,详细请参见开通认证服务。" + }, + { + "section": "获取客户端API授权", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "text": "访问端侧网关的客户端需要具备有效的Client ID以及Client Secret,才能通过端侧网关的鉴权校验并对业务接口发起有效调用。" + }, + { + "section": "获取客户端API授权", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "text": "登录HarmonyOS 开发者中心,进入“开发者管理”页面。" + }, + { + "section": "获取客户端API授权", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "text": "左侧导航栏选择“ID、证书和Profile > APP ID”,选择“项目管理”页签。" + }, + { + "section": "获取客户端API授权", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "text": "点开“项目”下拉列表,选择目标项目。" + }, + { + "section": "获取客户端API授权", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "text": "记录“项目”栏下的“Client ID”和“Client Secret”。" + }, + { + "section": "获取客户端API授权", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section18502104612500", + "text": "调用获取Token接口,获取访问客户端REST API的Access Token。您在3中记录的“Client ID”和“Client Secret”将作为请求参数在调用时传入。" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "您可使用客户端REST API调用获取Token接口,通过华为开放平台进行鉴权,并获取认证通过后的Token。" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "根据请求参数获取对应参数值,构造获取Token请求体。 POST /agc/apigw/oauth2/v1/token Host: connect-drcn.dbankcloud.cn Content-Type: application/json { \"useJwt\":\"1\", \"grant_type\":\"client_credentials\", \"client_id\":\"26********20\", \"client_secret\":\"************************\" }" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "POST /agc/apigw/oauth2/v1/token Host: connect-drcn.dbankcloud.cn Content-Type: application/json { \"useJwt\":\"1\", \"grant_type\":\"client_credentials\", \"client_id\":\"26********20\", \"client_secret\":\"************************\" }" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "POST /agc/apigw/oauth2/v1/token" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "Host: connect-drcn.dbankcloud.cn" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "Content-Type: application/json" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "{" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "\"useJwt\":\"1\"," + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "\"grant_type\":\"client_credentials\"," + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "\"client_id\":\"26********20\"," + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "\"client_secret\":\"************************\"" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "}" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "发送获取Token请求,收到请求响应体。 HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { \"access_token\": \"eyJhbGciOiJIUzU****************\", \"expires_in\": 172800 }" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { \"access_token\": \"eyJhbGciOiJIUzU****************\", \"expires_in\": 172800 }" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "HTTP/1.1 200 OK" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "Content-Type: application/json; charset=utf-8" + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "\"access_token\": \"eyJhbGciOiJIUzU****************\"," + }, + { + "section": "获取Token", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section61082205110", + "text": "\"expires_in\": 172800" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "您可使用客户端REST API调用用户登录接口,根据客户端认证Token和用户名密码登录,并获取登录通过后的用户认证accessToken。" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "根据请求参数获取对应参数值,构造用户登录请求体。 POST agc/apigw/oauth2/third/v1/user-signin content-type: application/json productId: 99************83 client_id: 680************560 Authorization: Bearer *** host: connect-drcn.dbankcloud.cn { \"provider\": 0, \"token\": \"string\", \"extraData\": \"string\", \"autoCreateUser\": 0, \"useJwt\": 1, \"channelId\": \"string\", \"aaId\": \"string\" }" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "POST agc/apigw/oauth2/third/v1/user-signin content-type: application/json productId: 99************83 client_id: 680************560 Authorization: Bearer *** host: connect-drcn.dbankcloud.cn { \"provider\": 0, \"token\": \"string\", \"extraData\": \"string\", \"autoCreateUser\": 0, \"useJwt\": 1, \"channelId\": \"string\", \"aaId\": \"string\" }" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "POST agc/apigw/oauth2/third/v1/user-signin" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "content-type: application/json" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "productId: 99************83" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "client_id: 680************560" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "Authorization: Bearer ***" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "host: connect-drcn.dbankcloud.cn" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"provider\": 0," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"token\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"extraData\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"autoCreateUser\": 0," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"useJwt\": 1," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"channelId\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"aaId\": \"string\"" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "发送用户登录请求,收到请求响应体。 { \"ret\": { \"code\": 0, \"msg\": \"string\" }, \"accessToken\": { \"token\": \"string\", \"validPeriod\": 0 }, \"refreshToken\": { \"token\": \"string\", \"validPeriod\": 0 }, \"userInfo\": { \"uid\": \"string\", \"importUid\": \"string\", \"displayName\": \"string\", \"photoUrl\": \"string\", \"provider\": 0, \"emailVerified\": 0, \"passwordSetted\": 0, \"email\": \"string\", \"phone\": \"string\" }, \"providers\": [{ \"uid\": \"string\", \"displayName\": \"string\", \"photoUrl\": \"string\", \"provider\": 0, \"openId\": \"string\", \"email\": \"string\", \"phone\": \"string\", \"extId\": \"string\" }] }" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "{ \"ret\": { \"code\": 0, \"msg\": \"string\" }, \"accessToken\": { \"token\": \"string\", \"validPeriod\": 0 }, \"refreshToken\": { \"token\": \"string\", \"validPeriod\": 0 }, \"userInfo\": { \"uid\": \"string\", \"importUid\": \"string\", \"displayName\": \"string\", \"photoUrl\": \"string\", \"provider\": 0, \"emailVerified\": 0, \"passwordSetted\": 0, \"email\": \"string\", \"phone\": \"string\" }, \"providers\": [{ \"uid\": \"string\", \"displayName\": \"string\", \"photoUrl\": \"string\", \"provider\": 0, \"openId\": \"string\", \"email\": \"string\", \"phone\": \"string\", \"extId\": \"string\" }] }" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"ret\": {" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"code\": 0," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"msg\": \"string\"" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "}," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"accessToken\": {" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"validPeriod\": 0" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"refreshToken\": {" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"userInfo\": {" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"uid\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"importUid\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"displayName\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"photoUrl\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"emailVerified\": 0," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"passwordSetted\": 0," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"email\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"phone\": \"string\"" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"providers\": [{" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"openId\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"phone\": \"string\"," + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "\"extId\": \"string\"" + }, + { + "section": "用户登录", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section433263513517", + "text": "}]" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "REST API通过构造HTTP请求的方式查询数据,并提供了丰富的谓词查询,比如equalTo、notEqualTo、in等。通过单个或者多个链式过滤条件,您可以从云侧数据库查询到满足特定条件的对象,也可以通过限定查询返回数量谓词限定查询结果返回的数量,还可以支持聚合查询,例如查询平均值、最大值、最小值等。" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "示例代码:" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/query?_v=4 content-type: application/json client_id: 74************40 Authorization: Bearer *** productId: 24************51 access_token: ****** host: connect-drcn.dbankcloud.cn { \"msgInfo\": { \"type\": 5, \"opStore\": { \"storeName\": \"cloudDBZone\" } }, \"clientInfo\": { \"appVer\": 1 }, \"queryReqMsg\": { \"queryType\" : 0, \"queryTable\" : \"StudentInfo\", \"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"1\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\" } }" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/query?_v=4" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "client_id: 74************40" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "productId: 24************51" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "access_token: ******" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"msgInfo\": {" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"type\": 5," + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"opStore\": {" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"storeName\": \"cloudDBZone\"" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"clientInfo\": {" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"appVer\": 1" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"queryReqMsg\": {" + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"queryType\" : 0," + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"queryTable\" : \"StudentInfo\"," + }, + { + "section": "查询数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section576571165218", + "text": "\"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"1\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\"" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "REST API通过构造HTTP请求的方式更新数据,支持数据的新增和更新。若更新数据时,如果在Cloud DB zone已经存在主键值相同的对象,则更新已有的对象;如果不存在,则写入一个新的对象。" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "构造更新数据请求。在存储区为cloudDBZone,对象类型为StudentInfo中新增一条“id”为1的数据对象。" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4 content-type: application/json client_id: 74************40 Authorization: Bearer *** productId: 99************83 access_token: *** host: connect-drcn.dbankcloud.cn { \"msgInfo\": { \"type\": 3, \"opStore\": { \"storeName\": \"cloudDBZone\" } }, \"clientInfo\": { \"appVer\": 1 }, \"schemas\": [ { \"n\": \"StudentInfo\", \"fs\": [ { \"n\": \"id\", \"t\": \"TYPE_INT32\" }, { \"n\": \"name\", \"t\": \"TYPE_STRING\" }, { \"n\": \"age\", \"t\": \"TYPE_INT32\" }, { \"n\": \"naturalbase_version\", \"t\": \"TYPE_LONG\" }, { \"n\": \"naturalbase_deleted\", \"t\": \"TYPE_BOOLEAN\" } ] } ], \"opData\": [ { \"os\": [ { \"fs\": [ { \"i\": 1 }, { \"s\": \"string\" }, { \"i\": 18 }, { \"l\": null }, { \"bl\": false } ] } ], \"t\": 1 } ] }" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "access_token: ***" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"type\": 3," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"schemas\": [" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"n\": \"StudentInfo\"," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"fs\": [" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"n\": \"id\"," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"t\": \"TYPE_INT32\"" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"n\": \"name\"," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"t\": \"TYPE_STRING\"" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"n\": \"age\"," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"n\": \"naturalbase_version\"," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"t\": \"TYPE_LONG\"" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"n\": \"naturalbase_deleted\"," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"t\": \"TYPE_BOOLEAN\"" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "]" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "]," + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"opData\": [" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"os\": [" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"i\": 1" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"s\": \"string\"" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"i\": 18" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"l\": null" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"bl\": false" + }, + { + "section": "更新数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section19276145625218", + "text": "\"t\": 1" + }, + { + "section": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "text": "REST API通过构造HTTP请求的方式删除数据。删除数据时,请求接口会根据传入对象主键删除相应的数据,不会比对该对象其他属性与存储的数据是否一致。" + }, + { + "section": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "text": "删除数据对象时,该组中的对象必须属于同一个对象类型,否则会导致删除失败。" + }, + { + "section": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "text": "构造删除数据请求。删除存储区为cloudDBZone,对象类型为StudentInfo中的,删除一条“id”为1的数据对象。" + }, + { + "section": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "text": "POST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4 content-type: application/json client_id: 74************40 Authorization: Bearer *** productId: 99************83 access_token: *** host: connect-drcn.dbankcloud.cn { \"msgInfo\": { \"type\": 3, \"opStore\": { \"storeName\": \"cloudDBZone\" } }, \"clientInfo\": { \"appVer\": 1 }, \"schemas\": [ { \"n\": \"StudentInfo\", \"fs\": [ { \"n\": \"id\", \"t\": \"TYPE_INT32\" }, { \"n\": \"naturalbase_version\", \"t\": \"TYPE_LONG\" }, { \"n\": \"naturalbase_deleted\", \"t\": \"TYPE_BOOLEAN\" } ] } ], \"opData\": [ { \"i\": 0, \"os\": [ { \"fs\": [ { \"i\": 1 }, { \"l\": null }, { \"bl\": true } ], \"i\": 0 } ], \"t\": 1 } ] }" + }, + { + "section": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "text": "\"i\": 0," + }, + { + "section": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "text": "\"bl\": true" + }, + { + "section": "删除数据", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166#section11307144411533", + "text": "\"i\": 0" + } + ], + "renderedText": "指南\n云数据库 for Object\n通过REST API接口使用云数据库\n通过REST API接口使用云数据库\n更新时间: 2026-10-21 17:20\n\n云数据库提供了REST API接口,您只需要访问相关URL,构造相关请求体即可调用该接口,完成数据管理的操作。\n\n开发前准备\n\n使用REST API管理数据,需要完成以下准备工作:\n\n示例应用使用了认证用户的相关权限,需要开通认证服务中“匿名账号”服务,详细请参见开通认证服务。\n\n获取客户端API授权\n\n访问端侧网关的客户端需要具备有效的Client ID以及Client Secret,才能通过端侧网关的鉴权校验并对业务接口发起有效调用。\n\n登录HarmonyOS 开发者中心,进入“开发者管理”页面。\n左侧导航栏选择“ID、证书和Profile > APP ID”,选择“项目管理”页签。\n点开“项目”下拉列表,选择目标项目。\n\n记录“项目”栏下的“Client ID”和“Client Secret”。\n\n调用获取Token接口,获取访问客户端REST API的Access Token。您在3中记录的“Client ID”和“Client Secret”将作为请求参数在调用时传入。\n获取Token\n\n您可使用客户端REST API调用获取Token接口,通过华为开放平台进行鉴权,并获取认证通过后的Token。\n\n根据请求参数获取对应参数值,构造获取Token请求体。\nPOST /agc/apigw/oauth2/v1/token\nHost: connect-drcn.dbankcloud.cn\nContent-Type: application/json\n{\n \"useJwt\":\"1\",\n \"grant_type\":\"client_credentials\",\n \"client_id\":\"26********20\",\n \"client_secret\":\"************************\"\n}\n发送获取Token请求,收到请求响应体。\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"access_token\": \"eyJhbGciOiJIUzU****************\",\n \"expires_in\": 172800\n}\n用户登录\n\n您可使用客户端REST API调用用户登录接口,根据客户端认证Token和用户名密码登录,并获取登录通过后的用户认证accessToken。\n\n根据请求参数获取对应参数值,构造用户登录请求体。\nPOST agc/apigw/oauth2/third/v1/user-signin\ncontent-type: application/json\nproductId: 99************83\nclient_id: 680************560\nAuthorization: Bearer ***\nhost: connect-drcn.dbankcloud.cn\n{\n \"provider\": 0,\n \"token\": \"string\",\n \"extraData\": \"string\",\n \"autoCreateUser\": 0,\n \"useJwt\": 1,\n \"channelId\": \"string\",\n \"aaId\": \"string\"\n}\n发送用户登录请求,收到请求响应体。\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"string\"\n },\n \"accessToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"refreshToken\": {\n \"token\": \"string\",\n \"validPeriod\": 0\n },\n \"userInfo\": {\n \"uid\": \"string\",\n \"importUid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"emailVerified\": 0,\n \"passwordSetted\": 0,\n \"email\": \"string\",\n \"phone\": \"string\"\n },\n \"providers\": [{\n \"uid\": \"string\",\n \"displayName\": \"string\",\n \"photoUrl\": \"string\",\n \"provider\": 0,\n \"openId\": \"string\",\n \"email\": \"string\",\n \"phone\": \"string\",\n \"extId\": \"string\"\n }]\n}\n查询数据\n\nREST API通过构造HTTP请求的方式查询数据,并提供了丰富的谓词查询,比如equalTo、notEqualTo、in等。通过单个或者多个链式过滤条件,您可以从云侧数据库查询到满足特定条件的对象,也可以通过限定查询返回数量谓词限定查询结果返回的数量,还可以支持聚合查询,例如查询平均值、最大值、最小值等。\n\n示例代码:\n\n构造查询数据请求。查询存储区为cloudDBZone,对象类型为StudentInfo,“id”为1的数据对象。\nPOST agc/apigw/clouddb/clouddbservice/sync/query?_v=4\ncontent-type: application/json\nclient_id: 74************40\nAuthorization: Bearer ***\nproductId: 24************51\naccess_token: ******\nhost: connect-drcn.dbankcloud.cn\n{\n \"msgInfo\": {\n \"type\": 5,\n \"opStore\": {\n \"storeName\": \"cloudDBZone\"\n }\n },\n \"clientInfo\": {\n \"appVer\": 1\n },\n \"queryReqMsg\": {\n \"queryType\" : 0,\n \"queryTable\" : \"StudentInfo\",\n \"queryCond\" : \"{\\\"queryConditions\\\":[{\\\"conditionType\\\":\\\"EqualTo\\\",\\\"fieldName\\\":\\\"id\\\",\\\"value\\\":\\\"1\\\"},{\\\"conditionType\\\":\\\"Limit\\\",\\\"value\\\":{\\\"number\\\":10,\\\"offset\\\":0}}]}\"\n }\n}\n更新数据\n\nREST API通过构造HTTP请求的方式更新数据,支持数据的新增和更新。若更新数据时,如果在Cloud DB zone已经存在主键值相同的对象,则更新已有的对象;如果不存在,则写入一个新的对象。\n\n示例代码:\n\n构造更新数据请求。在存储区为cloudDBZone,对象类型为StudentInfo中新增一条“id”为1的数据对象。\n\nPOST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4\ncontent-type: application/json\nclient_id: 74************40\nAuthorization: Bearer ***\nproductId: 99************83\naccess_token: ***\nhost: connect-drcn.dbankcloud.cn\n{\n \"msgInfo\": {\n \"type\": 3,\n \"opStore\": {\n \"storeName\": \"cloudDBZone\"\n }\n },\n \"clientInfo\": {\n \"appVer\": 1\n },\n \"schemas\": [\n {\n \"n\": \"StudentInfo\",\n \"fs\": [\n {\n \"n\": \"id\",\n \"t\": \"TYPE_INT32\"\n },\n {\n \"n\": \"name\",\n \"t\": \"TYPE_STRING\"\n },\n {\n \"n\": \"age\",\n \"t\": \"TYPE_INT32\"\n },\n {\n \"n\": \"naturalbase_version\",\n \"t\": \"TYPE_LONG\"\n },\n {\n \"n\": \"naturalbase_deleted\",\n \"t\": \"TYPE_BOOLEAN\"\n }\n ]\n }\n ],\n \"opData\": [\n {\n \"os\": [\n {\n \"fs\": [\n {\n \"i\": 1\n },\n {\n \"s\": \"string\"\n },\n {\n \"i\": 18\n },\n {\n \"l\": null\n },\n {\n \"bl\": false\n }\n ]\n }\n ],\n \"t\": 1\n }\n ]\n}\n删除数据\n\nREST API通过构造HTTP请求的方式删除数据。删除数据时,请求接口会根据传入对象主键删除相应的数据,不会比对该对象其他属性与存储的数据是否一致。\n\n注意\n\n删除数据对象时,该组中的对象必须属于同一个对象类型,否则会导致删除失败。\n\n示例代码:\n\n构造删除数据请求。删除存储区为cloudDBZone,对象类型为StudentInfo中的,删除一条“id”为1的数据对象。\n\nPOST agc/apigw/clouddb/clouddbservice/sync/upsert?_v=4\ncontent-type: application/json\nclient_id: 74************40\nAuthorization: Bearer ***\nproductId: 99************83\naccess_token: ***\nhost: connect-drcn.dbankcloud.cn\n{\n \"msgInfo\": {\n \"type\": 3,\n \"opStore\": {\n \"storeName\": \"cloudDBZone\"\n }\n },\n \"clientInfo\": {\n \"appVer\": 1\n },\n \"schemas\": [\n {\n \"n\": \"StudentInfo\",\n \"fs\": [\n {\n \"n\": \"id\",\n \"t\": \"TYPE_INT32\"\n },\n {\n \"n\": \"naturalbase_version\",\n \"t\": \"TYPE_LONG\"\n },\n {\n \"n\": \"naturalbase_deleted\",\n \"t\": \"TYPE_BOOLEAN\"\n }\n ]\n }\n ],\n \"opData\": [\n {\n \"i\": 0,\n \"os\": [\n {\n \"fs\": [\n {\n \"i\": 1\n },\n {\n \"l\": null\n },\n {\n \"bl\": true\n }\n ],\n \"i\": 0\n }\n ],\n \"t\": 1\n }\n ]\n}\n通过命令行使用云数据库\n通过Server SDK将三方数据库内容迁移至云数据库\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n开发前准备\n获取客户端API授权\n获取Token\n用户登录\n查询数据\n更新数据\n删除数据\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-restapi-0000001518509166", + "status": "browser-read", + "tables": [], + "title": "通过REST API接口使用云数据库", + "updatedAt": "2026-10-21 17:20" +} diff --git a/pkg/domain/reference/supplemental/serverless-agc-serverless-lottery-api-errcode-0000001307372009.json b/pkg/domain/reference/supplemental/serverless-agc-serverless-lottery-api-errcode-0000001307372009.json new file mode 100644 index 0000000..116ad65 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agc-serverless-lottery-api-errcode-0000001307372009.json @@ -0,0 +1,41 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-game-leaderboard-0000001349245017", + "title": "游戏排行榜模板API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\nServerless模板\n抽奖活动模板API\n返回码\n返回码\n更新时间: 2022-07-11 10:50\n\n返回码(errorCode)\n\n\t\n\n错误描述(errorMsg)\n\n\n\n\n200\n\n\t\n\n成功。\n\n\n\n\n403\n\n\t\n\naccessToken无效,鉴权失败。\n\n游戏排行榜模板API\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-lottery-api-errcode-0000001307372009", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "返回码(errorCode)", + "错误描述(errorMsg)" + ], + [ + "200", + "成功。" + ], + [ + "403", + "accessToken无效,鉴权失败。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-lottery-api-errcode-0000001307372009" + } + ], + "title": "返回码", + "updatedAt": "2022-07-11 10:50" +} diff --git a/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-envir-0000001227652710.json b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-envir-0000001227652710.json new file mode 100644 index 0000000..a8ac3bb --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-envir-0000001227652710.json @@ -0,0 +1,57 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720", + "title": "创建站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryenvir-0000001217285680", + "title": "查询站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648", + "title": "删除站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361", + "title": "删除站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createnvir-0000001216965720", + "title": "创建站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "text": "创建站点环境" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "text": "查询站点环境" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "text": "删除站点环境" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理环境\n管理环境\n更新时间: 2026-10-23 16:56\n创建站点环境\n\n查询站点环境\n\n删除站点环境\n\n删除站点\n创建站点环境\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-envir-0000001227652710", + "status": "browser-read", + "tables": [], + "title": "管理环境", + "updatedAt": "2026-10-23 16:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-errorcode-0000001260940301.json b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-errorcode-0000001260940301.json new file mode 100644 index 0000000..743a3c6 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-errorcode-0000001260940301.json @@ -0,0 +1,180 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releasecode-0000001229838565", + "title": "版本发布状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301#section18455681858", + "title": "成功" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301#section18064507518", + "title": "错误" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n云托管\nRESTful API\n状态码\n状态码\n更新时间: 2026-10-23 16:56\n成功\n\n状态码(code)\n\n\t\n\n信息(msg)\n\n\n\n\n0\n\n\t\n\n成功。\n\n错误\n\n错误码(errorCode)\n\n\t\n\n错误信息(errorMsg)\n\n\n\n\nCOMMON.0000\n\n\t\n\n未知错误。\n\n\n\n\nCOMMON.0001\n\n\t\n\n头部productId为空。\n\n\n\n\nCOMMON.0002\n\n\t\n\n头部productId和body中productId不匹配。\n\n\n\n\nSITE.0000\n\n\t\n\n获取上传地址时,站点不存在。\n\n\n\n\nSITE.0001\n\n\t\n\n该站点不属于当前项目。\n\n\n\n\nSITE.0002\n\n\t\n\n站点不是在线状态。\n\n\n\n\nSITE.0003\n\n\t\n\n租户下站点数达到上限。\n\n\n\n\nSITE.0004\n\n\t\n\n站点名称不合法。\n\n\n\n\nSITE.0005\n\n\t\n\n非法的站点类型。\n\n\n\n\nVERSION.0000\n\n\t\n\n该版本不存在。\n\n\n\n\nVERSION.0001\n\n\t\n\n版本数量达到上限。\n\n\n\n\nVERSION.0002\n\n\t\n\n超过一个上线版本。\n\n\n\n\nVERSION.0003\n\n\t\n\n不能克隆当前版本。\n\n\n\n\nVERSION.0005\n\n\t\n\n当前版本状态操作被拒绝。\n\n\n\n\nVERSION.0006\n\n\t\n\n只允许一个创建中状态版本。\n\n\n\n\nVERSION.0007\n\n\t\n\n只允许一个归档中状态版本。\n\n\n\n\nVERSION.0008\n\n\t\n\n只允许一个沙箱发布中状态版本。\n\n\n\n\nVERSION.0009\n\n\t\n\n只允许一个沙箱发布状态版本。\n\n\n\n\nMATERIAL.0000\n\n\t\n\n租户储存容量不足。\n\n\n\n\nMATERIAL.0001\n\n\t\n\n获取上传地址失败。\n\n\n\n\nMATERIAL.0002\n\n\t\n\n该租户无法使用该素材。\n\n\n\n\nMATERIAL.0003\n\n\t\n\n当前版本包上传次数达到上限。\n\n\n\n\nMATERIAL.0004\n\n\t\n\n当前版本包不存在。\n\n\n\n\nVERSION_FILES.0000\n\n\t\n\n当前版本不符合查询条件。\n\n\n\n\nTENANT.0000\n\n\t\n\n超出租户当日操作次数上限。\n\n\n\n\nSITE_ENVIRONMENT.0001\n\n\t\n\n超出最大站点环境数量。\n\n\n\n\nSITE_ENVIRONMENT.0002\n\n\t\n\n站点环境ID存在重复。\n\n\n\n\nSITE_ENVIRONMENT.0003\n\n\t\n\n禁止删除默认环境。\n\n\n\n\nSITE_ENVIRONMENT.0004\n\n\t\n\n禁止删除中状态的环境。\n\n\n\n\nSITE_ENVIRONMENT.0005\n\n\t\n\n站点环境ID不存在。\n\n版本发布状态码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n成功\n错误\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "状态码(code)", + "信息(msg)" + ], + [ + "0", + "成功。" + ] + ], + "section": "成功", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301#section18455681858" + }, + { + "location": "", + "rows": [ + [ + "错误码(errorCode)", + "错误信息(errorMsg)" + ], + [ + "COMMON.0000", + "未知错误。" + ], + [ + "COMMON.0001", + "头部productId为空。" + ], + [ + "COMMON.0002", + "头部productId和body中productId不匹配。" + ], + [ + "SITE.0000", + "获取上传地址时,站点不存在。" + ], + [ + "SITE.0001", + "该站点不属于当前项目。" + ], + [ + "SITE.0002", + "站点不是在线状态。" + ], + [ + "SITE.0003", + "租户下站点数达到上限。" + ], + [ + "SITE.0004", + "站点名称不合法。" + ], + [ + "SITE.0005", + "非法的站点类型。" + ], + [ + "VERSION.0000", + "该版本不存在。" + ], + [ + "VERSION.0001", + "版本数量达到上限。" + ], + [ + "VERSION.0002", + "超过一个上线版本。" + ], + [ + "VERSION.0003", + "不能克隆当前版本。" + ], + [ + "VERSION.0005", + "当前版本状态操作被拒绝。" + ], + [ + "VERSION.0006", + "只允许一个创建中状态版本。" + ], + [ + "VERSION.0007", + "只允许一个归档中状态版本。" + ], + [ + "VERSION.0008", + "只允许一个沙箱发布中状态版本。" + ], + [ + "VERSION.0009", + "只允许一个沙箱发布状态版本。" + ], + [ + "MATERIAL.0000", + "租户储存容量不足。" + ], + [ + "MATERIAL.0001", + "获取上传地址失败。" + ], + [ + "MATERIAL.0002", + "该租户无法使用该素材。" + ], + [ + "MATERIAL.0003", + "当前版本包上传次数达到上限。" + ], + [ + "MATERIAL.0004", + "当前版本包不存在。" + ], + [ + "VERSION_FILES.0000", + "当前版本不符合查询条件。" + ], + [ + "TENANT.0000", + "超出租户当日操作次数上限。" + ], + [ + "SITE_ENVIRONMENT.0001", + "超出最大站点环境数量。" + ], + [ + "SITE_ENVIRONMENT.0002", + "站点环境ID存在重复。" + ], + [ + "SITE_ENVIRONMENT.0003", + "禁止删除默认环境。" + ], + [ + "SITE_ENVIRONMENT.0004", + "禁止删除中状态的环境。" + ], + [ + "SITE_ENVIRONMENT.0005", + "站点环境ID不存在。" + ] + ], + "section": "错误", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301#section18064507518" + } + ], + "title": "状态码", + "updatedAt": "2026-10-23 16:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-releasecode-0000001229838565.json b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-releasecode-0000001229838565.json new file mode 100644 index 0000000..99ab935 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-releasecode-0000001229838565.json @@ -0,0 +1,73 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-errorcode-0000001260940301", + "title": "状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n版本发布状态码\n版本发布状态码\n更新时间: 2026-10-23 16:56\n\n发布状态\n\n\t\n\n状态说明\n\n\n\n\nPRODUCTION_RELEASING\n\n\t\n\n上线中\n\n\n\n\nPRODUCTION_RELEASED\n\n\t\n\n生产\n\n\n\n\nOFFLINING\n\n\t\n\n下线中\n\n\n\n\nOFFLINING_FAILED\n\n\t\n\n下线失败\n\n\n\n\nSANDBOX_RELEASING\n\n\t\n\n沙箱发布中\n\n\n\n\nSANDBOX_RELEASED\n\n\t\n\n沙箱上线\n\n\n\n\nRELEASING_FAILED\n\n\t\n\n发布失败\n\n版本状态码\n状态码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releasecode-0000001229838565", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "发布状态", + "状态说明" + ], + [ + "PRODUCTION_RELEASING", + "上线中" + ], + [ + "PRODUCTION_RELEASED", + "生产" + ], + [ + "OFFLINING", + "下线中" + ], + [ + "OFFLINING_FAILED", + "下线失败" + ], + [ + "SANDBOX_RELEASING", + "沙箱发布中" + ], + [ + "SANDBOX_RELEASED", + "沙箱上线" + ], + [ + "RELEASING_FAILED", + "发布失败" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releasecode-0000001229838565" + } + ], + "title": "版本发布状态码", + "updatedAt": "2026-10-23 16:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-site-0000001260262901.json b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-site-0000001260262901.json new file mode 100644 index 0000000..2391293 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-site-0000001260262901.json @@ -0,0 +1,71 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466", + "title": "创建站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-querysite-0000001166826430", + "title": "查询站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-refreshsite-0000001260949359", + "title": "更新站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletesite-0000001260869361", + "title": "删除站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-createsite-0000001216061466", + "title": "创建站点" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "text": "您可以通过API管理站点(仅支持使用泛域名管理站点)。" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "text": "创建站点" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "text": "查询站点" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "text": "更新站点" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "text": "删除站点" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理站点\n管理站点\n更新时间: 2026-10-23 16:56\n\n您可以通过API管理站点(仅支持使用泛域名管理站点)。\n\n创建站点\n\n查询站点\n\n更新站点\n\n删除站点\n\nRESTful API\n创建站点\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-site-0000001260262901", + "status": "browser-read", + "tables": [], + "title": "管理站点", + "updatedAt": "2026-10-23 16:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-version-0000001260142907.json b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-version-0000001260142907.json new file mode 100644 index 0000000..a08c052 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-version-0000001260142907.json @@ -0,0 +1,129 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196", + "title": "创建版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-modifyversion-0000001211627867", + "title": "修改版本文件列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadurl-0000001166347942", + "title": "获取版本压缩包上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-uploadversion-0000001211707813", + "title": "上传版本压缩包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-archivedversion-0000001211826385", + "title": "归档版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releaseversion-0000001166666484", + "title": "发布版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryversion-0000001166507920", + "title": "查询版本列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-queryfile-0000001211627869", + "title": "查询归档版本文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944", + "title": "删除版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "title": "版本状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releasecode-0000001229838565", + "title": "版本发布状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deletenvir-0000001217445648", + "title": "删除站点环境" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-newapp-0000001111685196", + "title": "创建版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "创建版本" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "修改版本文件列表" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "获取版本压缩包上传地址" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "上传版本压缩包" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "归档版本" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "发布版本" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "查询版本列表" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "查询归档版本文件" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "删除版本" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "版本状态码" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "text": "版本发布状态码" + } + ], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n管理版本\n更新时间: 2026-10-23 16:56\n创建版本\n\n修改版本文件列表\n\n获取版本压缩包上传地址\n\n上传版本压缩包\n\n归档版本\n\n发布版本\n\n查询版本列表\n\n查询归档版本文件\n\n删除版本\n\n版本状态码\n\n版本发布状态码\n\n删除站点环境\n创建版本\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "status": "browser-read", + "tables": [], + "title": "管理版本", + "updatedAt": "2026-10-23 16:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-versioncode-0000001211707815.json b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-versioncode-0000001211707815.json new file mode 100644 index 0000000..2ddd858 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agcapi-cloudhost-versioncode-0000001211707815.json @@ -0,0 +1,77 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-restapi-0000001150409957", + "title": "RESTful API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-version-0000001260142907", + "title": "管理版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-deleteversion-0000001166347944", + "title": "删除版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-releasecode-0000001229838565", + "title": "版本发布状态码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n云托管\nRESTful API\n管理版本\n版本状态码\n版本状态码\n更新时间: 2026-10-23 16:56\n\n版本状态\n\n\t\n\n状态说明\n\n\n\n\nCREATING\n\n\t\n\n创建中\n\n\n\n\nCREATED\n\n\t\n\n已创建\n\n\n\n\nMERGING\n\n\t\n\n归档中\n\n\n\n\nFINALIZED\n\n\t\n\n已归档\n\n\n\n\nCREATE_VERSION_FAILED\n\n\t\n\n创建版本失败\n\n\n\n\nVERSION_PACKAGE_ERROR\n\n\t\n\n版本包错误\n\n\n\n\nDELETING\n\n\t\n\n删除中\n\n\n\n\nDELETED\n\n\t\n\n已删除\n\n删除版本\n版本发布状态码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "版本状态", + "状态说明" + ], + [ + "CREATING", + "创建中" + ], + [ + "CREATED", + "已创建" + ], + [ + "MERGING", + "归档中" + ], + [ + "FINALIZED", + "已归档" + ], + [ + "CREATE_VERSION_FAILED", + "创建版本失败" + ], + [ + "VERSION_PACKAGE_ERROR", + "版本包错误" + ], + [ + "DELETING", + "删除中" + ], + [ + "DELETED", + "已删除" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-cloudhost-versioncode-0000001211707815" + } + ], + "title": "版本状态码", + "updatedAt": "2026-10-23 16:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-agcapi-obtain_token-0000001158365043.json b/pkg/domain/reference/supplemental/serverless-agcapi-obtain_token-0000001158365043.json new file mode 100644 index 0000000..d502deb --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-agcapi-obtain_token-0000001158365043.json @@ -0,0 +1,171 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section624414128367", + "text": "请求示例\nPOST /api/oauth2/v1/token\nHost: connect-api.cloud.huawei.com\nContent-Type: application/json\n{\n \"grant_type\":\"client_credentials\",\n \"client_id\":\"26********20\",\n \"client_secret\":\"************************\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section18524194122113", + "text": "响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"access_token\": \"eyJhbGciOiJIUzU****************\", \n \"expires_in\": 172800\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section125771341635", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section128mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section624414128367", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section129mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section18524194122113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section53163821", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section1466414833814", + "title": "Postman调试" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section125771341635", + "text": "在使用API客户端方式调用Connect API的接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section128mcpsimp", + "text": "请求参数以JSON格式传入,包含参数如下。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section129mcpsimp", + "text": "返回值为JSON格式的字符串,包含参数如下。" + }, + { + "section": "Postman调试", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section1466414833814", + "text": "您可以使用Postman在线调试此接口。" + } + ], + "renderedText": "获取Token\n更新时间: 2026-03-11 09:18\n功能介绍\n\n在使用API客户端方式调用Connect API的接口前,需要通过华为开放平台进行鉴权,并获取认证通过后的Token。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n开发者服务器 -> 华为服务器\n\n\n\n\n接口URL\n\n\t\n\nhttps://connect-api.cloud.huawei.com/api/oauth2/v1/token\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\n\n请求参数以JSON格式传入,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\ngrant_type\n\n\t\n\nM\n\n\t\n\nString(256)\n\n\t\n\n固定传入“client_credentials”。\n\n\n\n\nclient_id\n\n\t\n\nM\n\n\t\n\nString(256)\n\n\t\n\n客户端ID,即创建API客户端中生成的“ID”。\n\n\n\n\nclient_secret\n\n\t\n\nM\n\n\t\n\nString(2048)\n\n\t\n\n客户端密钥,即创建API客户端中生成的“密钥”。\n\n请求示例\nPOST /api/oauth2/v1/token\nHost: connect-api.cloud.huawei.com\nContent-Type: application/json\n{\n \"grant_type\":\"client_credentials\",\n \"client_id\":\"26********20\",\n \"client_secret\":\"************************\"\n}\n响应参数\n\n返回值为JSON格式的字符串,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\naccess_token\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n认证Token,用于AppGallery Connect API接口调用。\n\n此参数只在获取成功时返回。\n\n\n\n\nexpires_in\n\n\t\n\nO\n\n\t\n\nLong\n\n\t\n\naccess_token的有效期,单位秒。您需要在过期时间到达时重新调用本接口获取新的access_token。\n\n有效期为48小时,如果在有效期内再次调用接口获取access_token时,新老access_token都是有效的。\n\n此参数只在获取成功时返回。\n\n\n\n\nret\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n获取Token失败时的错误信息,包含错误码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为错误码,description为错误码描述信息。\n\n响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"access_token\": \"eyJhbGciOiJIUzU****************\", \n \"expires_in\": 172800\n}\n调用示例\npublic static String getToken(String domain, String clientId, String clientSecret) {\n String token = null;\n try {\n HttpPost post = new HttpPost(domain + \"/oauth2/v1/token\");\n\n JSONObject keyString = new JSONObject();\n keyString.put(\"client_id\", \"18893***83957248\");\n keyString.put(\"client_secret\", \"B15B497B44E080EBE2C4DE4E74930***52409516B2A1A5C8F0FCD2C579A8EB14\");\n keyString.put(\"grant_type\", \"client_credentials\");\n\n StringEntity entity = new StringEntity(keyString.toString(), Charset.forName(\"UTF-8\"));\n entity.setContentEncoding(\"UTF-8\");\n entity.setContentType(\"application/json\");\n post.setEntity(entity);\n\n CloseableHttpClient httpClient = HttpClients.createDefault();\n HttpResponse response = httpClient.execute(post);\n int statusCode = response.getStatusLine().getStatusCode();\n if (statusCode == HttpStatus.SC_OK) {\n\n BufferedReader br =\n new BufferedReader(new InputStreamReader(response.getEntity().getContent(), Consts.UTF_8));\n String result = br.readLine();\n JSONObject object = JSON.parseObject(result);\n token = object.getString(\"access_token\");\n }\n\n post.releaseConnection();\n httpClient.close();\n } catch (Exception e) {\n\n }\n return token;\n}\nPostman调试\n\n您可以使用Postman在线调试此接口。\n\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\n请求示例\n响应参数\n响应示例\n调用示例\nPostman调试\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/oauth2/v1/token" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section6932219103913" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "grant_type", + "M", + "String(256)", + "固定传入“client_credentials”。" + ], + [ + "client_id", + "M", + "String(256)", + "客户端ID,即创建API客户端中生成的“ID”。" + ], + [ + "client_secret", + "M", + "String(2048)", + "客户端密钥,即创建API客户端中生成的“密钥”。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section128mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "access_token", + "O", + "String", + "认证Token,用于AppGallery Connect API接口调用。 此参数只在获取成功时返回。" + ], + [ + "expires_in", + "O", + "Long", + "access_token的有效期,单位秒。您需要在过期时间到达时重新调用本接口获取新的access_token。 有效期为48小时,如果在有效期内再次调用接口获取access_token时,新老access_token都是有效的。 此参数只在获取成功时返回。" + ], + [ + "ret", + "O", + "String(100)", + "获取Token失败时的错误信息,包含错误码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},retcode为错误码,description为错误码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043#section129mcpsimp" + } + ], + "title": "获取Token", + "updatedAt": "2026-03-11 09:18" +} diff --git a/pkg/domain/reference/supplemental/serverless-client-rest-auth-0000001351815781.json b/pkg/domain/reference/supplemental/serverless-client-rest-auth-0000001351815781.json new file mode 100644 index 0000000..bc0a08a --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-client-rest-auth-0000001351815781.json @@ -0,0 +1,152 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-verifycode-0000001294228992", + "title": "验证码申请" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-register-0000001346709109", + "title": "用户注册" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signin-0000001294069348", + "title": "用户密码登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-usersigini-0000001346828685", + "title": "用户验证码登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modify-phone-email-0000001347069197", + "title": "修改手机号或邮箱地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-resetpwd-0000001293909500", + "title": "重置密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-modifypwd-0000001293749536", + "title": "修改密码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userlink-0000001346909381", + "title": "用户关联" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-unlink-0000001294229000", + "title": "取消关联" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-signout-0000001346709113", + "title": "登出" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-userdelete-0000001294069360", + "title": "注销" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693", + "title": "账号重认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/harmonyos-arkts-agcautherror-0000001633167954", + "title": "AGCAuthError" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-obtaintoken-0000001414202481", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "获取Token" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "验证码申请" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "用户注册" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "用户密码登录" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "用户验证码登录" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "修改手机号或邮箱地址" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "重置密码" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "修改密码" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "用户关联" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "取消关联" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "登出" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "注销" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "账号重认证" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "text": "错误码" + } + ], + "renderedText": "API参考\n认证服务\nREST API\nREST API\n更新时间: 2026-10-22 11:25\n获取Token\n\n验证码申请\n\n用户注册\n\n用户密码登录\n\n用户验证码登录\n\n修改手机号或邮箱地址\n\n重置密码\n\n修改密码\n\n用户关联\n\n取消关联\n\n登出\n\n注销\n\n账号重认证\n\n错误码\n\nAGCAuthError\n获取Token\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "status": "browser-read", + "tables": [], + "title": "REST API", + "updatedAt": "2026-10-22 11:25" +} diff --git a/pkg/domain/reference/supplemental/serverless-client-rest-auth-errorcode-0000001353626777.json b/pkg/domain/reference/supplemental/serverless-client-rest-auth-errorcode-0000001353626777.json new file mode 100644 index 0000000..9d7f8a4 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-client-rest-auth-errorcode-0000001353626777.json @@ -0,0 +1,117 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-0000001351815781", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-reauthenticate-0000001346828693", + "title": "账号重认证" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-0000001055443186", + "title": "Server" + } + ], + "notes": [], + "renderedText": "API参考\n认证服务\nREST API\n错误码\n错误码\n更新时间: 2026-10-22 11:25\n\n错误码(errorCode)\n\n\t\n\n错误描述(errorMsg)\n\n\n\n\n0\n\n\t\n\n成功。\n\n\n\n\n203816961\n\n\t\n\n内部错误。\n\n\n\n\n203817219\n\n\t\n\n无效产品ID。\n\n\n\n\n203817221\n\n\t\n\nPROVIDER不能为空。\n\n\n\n\n203817223\n\n\t\n\nEMAIL格式校验失败。\n\n\n\n\n203817224\n\n\t\n\n手机号格式校验失败。\n\n\n\n\n203817730\n\n\t\n\n获取用户信息失败。\n\n\n\n\n203817988\n\n\t\n\n第三方认证方式关闭。\n\n\n\n\n203817989\n\n\t\n\n获取第三方信息失败。\n\n\n\n\n203818032\n\n\t\n\n用户未注册。\n\n\n\n\n203818034\n\n\t\n\n邮箱或者手机登录的时候鉴权信息不能为空。\n\n\n\n\n203818053\n\n\t\n\n验证码发送到达限制。\n\n\n\n\n203818054\n\n\t\n\n项目hash值不存在。\n\n\n\n\n203818069\n\n\t\n\n请求参数为空。\n\n\n\n\n203818080\n\n\t\n\n更新信息请求错误。\n\n\n\n\n203818129\n\n\t\n\n验证码格式错误。\n\n\n\n\n203818130\n\n\t\n\n用户已注册。\n\n\n\n\n203818135\n\n\t\n\n验证码和密码都为空。\n\n\n\n\n203818241\n\n\t\n\n发送消息失败。\n\n\n\n\n203818260\n\n\t\n\n自动创建用户错误。\n\n账号重认证\nServer\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码(errorCode)", + "错误描述(errorMsg)" + ], + [ + "0", + "成功。" + ], + [ + "203816961", + "内部错误。" + ], + [ + "203817219", + "无效产品ID。" + ], + [ + "203817221", + "PROVIDER不能为空。" + ], + [ + "203817223", + "EMAIL格式校验失败。" + ], + [ + "203817224", + "手机号格式校验失败。" + ], + [ + "203817730", + "获取用户信息失败。" + ], + [ + "203817988", + "第三方认证方式关闭。" + ], + [ + "203817989", + "获取第三方信息失败。" + ], + [ + "203818032", + "用户未注册。" + ], + [ + "203818034", + "邮箱或者手机登录的时候鉴权信息不能为空。" + ], + [ + "203818053", + "验证码发送到达限制。" + ], + [ + "203818054", + "项目hash值不存在。" + ], + [ + "203818069", + "请求参数为空。" + ], + [ + "203818080", + "更新信息请求错误。" + ], + [ + "203818129", + "验证码格式错误。" + ], + [ + "203818130", + "用户已注册。" + ], + [ + "203818135", + "验证码和密码都为空。" + ], + [ + "203818241", + "发送消息失败。" + ], + [ + "203818260", + "自动创建用户错误。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/client-rest-auth-errorcode-0000001353626777" + } + ], + "title": "错误码", + "updatedAt": "2026-10-22 11:25" +} diff --git a/pkg/domain/reference/supplemental/serverless-clouddb-error-code-rest-0000001454149360.json b/pkg/domain/reference/supplemental/serverless-clouddb-error-code-rest-0000001454149360.json new file mode 100644 index 0000000..9ba833d --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-clouddb-error-code-rest-0000001454149360.json @@ -0,0 +1,121 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "title": "删除数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-server-0000001127466283", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n云数据库 for Object\nREST API\n错误码\n错误码\n更新时间: 2026-10-21 17:20\n\n错误码(errorCode)\n\n\t\n\n错误描述(errorMsg)\n\n\n\n\n0\n\n\t\n\n成功。\n\n\n\n\n203816961\n\n\t\n\n内部错误。\n\n\n\n\n203817219\n\n\t\n\n无效产品ID。\n\n\n\n\n203817221\n\n\t\n\nPROVIDER不能为空。\n\n\n\n\n203817223\n\n\t\n\nEMAIL格式校验失败。\n\n\n\n\n203817224\n\n\t\n\n手机号格式校验失败。\n\n\n\n\n203817730\n\n\t\n\n获取用户信息失败。\n\n\n\n\n203817988\n\n\t\n\n第三方认证方式关闭。\n\n\n\n\n203817989\n\n\t\n\n获取第三方信息失败。\n\n\n\n\n203818032\n\n\t\n\n用户未注册。\n\n\n\n\n203818034\n\n\t\n\n邮箱或者手机登录的时候鉴权信息不能为空。\n\n\n\n\n203818053\n\n\t\n\n验证码发送到达限制。\n\n\n\n\n203818054\n\n\t\n\n项目hash值不存在。\n\n\n\n\n203818069\n\n\t\n\n请求参数为空。\n\n\n\n\n203818080\n\n\t\n\n更新信息请求错误。\n\n\n\n\n203818129\n\n\t\n\n验证码格式错误。\n\n\n\n\n203818130\n\n\t\n\n用户已注册。\n\n\n\n\n203818135\n\n\t\n\n验证码和密码都为空。\n\n\n\n\n203818241\n\n\t\n\n发送消息失败。\n\n\n\n\n203818260\n\n\t\n\n自动创建用户错误。\n\n删除数据\nServer\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-error-code-rest-0000001454149360", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码(errorCode)", + "错误描述(errorMsg)" + ], + [ + "0", + "成功。" + ], + [ + "203816961", + "内部错误。" + ], + [ + "203817219", + "无效产品ID。" + ], + [ + "203817221", + "PROVIDER不能为空。" + ], + [ + "203817223", + "EMAIL格式校验失败。" + ], + [ + "203817224", + "手机号格式校验失败。" + ], + [ + "203817730", + "获取用户信息失败。" + ], + [ + "203817988", + "第三方认证方式关闭。" + ], + [ + "203817989", + "获取第三方信息失败。" + ], + [ + "203818032", + "用户未注册。" + ], + [ + "203818034", + "邮箱或者手机登录的时候鉴权信息不能为空。" + ], + [ + "203818053", + "验证码发送到达限制。" + ], + [ + "203818054", + "项目hash值不存在。" + ], + [ + "203818069", + "请求参数为空。" + ], + [ + "203818080", + "更新信息请求错误。" + ], + [ + "203818129", + "验证码格式错误。" + ], + [ + "203818130", + "用户已注册。" + ], + [ + "203818135", + "验证码和密码都为空。" + ], + [ + "203818241", + "发送消息失败。" + ], + [ + "203818260", + "自动创建用户错误。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-error-code-rest-0000001454149360" + } + ], + "title": "错误码", + "updatedAt": "2026-10-21 17:20" +} diff --git a/pkg/domain/reference/supplemental/serverless-clouddb-rest-0000001446447626.json b/pkg/domain/reference/supplemental/serverless-clouddb-rest-0000001446447626.json new file mode 100644 index 0000000..aa0f3e2 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-clouddb-rest-0000001446447626.json @@ -0,0 +1,80 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-signin-rest-0000001496447669", + "title": "用户登录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-query-data-rest-0000001496647573", + "title": "查询数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-update-data-rest-0000001446287706", + "title": "更新数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-delete-data-rest-0000001449956714", + "title": "删除数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-error-code-rest-0000001454149360", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-harmonyos-ts-databaseconfig-0000001674830125", + "title": "DatabaseConfig" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-obtaintoken-rest-0000001446607602", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "text": "获取Token" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "text": "用户登录" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "text": "查询数据" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "text": "更新数据" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "text": "删除数据" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "text": "错误码" + } + ], + "renderedText": "API参考\n云数据库 for Object\nREST API\nREST API\n更新时间: 2026-10-21 17:20\n获取Token\n\n用户登录\n\n查询数据\n\n更新数据\n\n删除数据\n\n错误码\n\nDatabaseConfig\n获取Token\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/clouddb-rest-0000001446447626", + "status": "browser-read", + "tables": [], + "title": "REST API", + "updatedAt": "2026-10-21 17:20" +} diff --git a/pkg/domain/reference/supplemental/serverless-cloudfunction-nodejs-0000001733038596.json b/pkg/domain/reference/supplemental/serverless-cloudfunction-nodejs-0000001733038596.json new file mode 100644 index 0000000..2b72cda --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-cloudfunction-nodejs-0000001733038596.json @@ -0,0 +1,201 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-cloudfunction-0000001192993000", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-nodejs-0000001779998825", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-nodejs-package-0000001780038561", + "title": "@hw-agconnect/cloud-server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section1178121234312", + "title": "constructor" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section2026765062216", + "title": "call" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/functionparams-nodejs-0000001733711318", + "title": "FunctionParams" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/functionparams-nodejs-0000001733711318", + "title": "FunctionParams" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloud-nodejs-0000002000961181", + "title": "Cloud" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/functionparams-nodejs-0000001733711318", + "title": "FunctionParams" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section1611502174217", + "title": "Constructor Summary" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section177401747141118", + "title": "Method Summary" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section18207114439", + "title": "Constructors" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section1178121234312", + "title": "constructor" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section36433417229", + "title": "Public Methods" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section2026765062216", + "title": "call" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "Constructors", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section1178121234312", + "text": "Parameters" + }, + { + "section": "Public Methods", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section2026765062216", + "text": "Return" + } + ], + "renderedText": "API参考\n云函数\nServer\nNode.js\n@hw-agconnect/cloud-server\nCloudFunction\nCloudFunction\n更新时间: 2026-10-20 16:24\n\nClass Info\n\n\n\n\nexport class CloudFunction\n\nCloud Functions SDK的入口类,包含调用云函数的方法。\n\nConstructor Summary\n\nConstructor Info\n\n\n\n\nconstructor(name: string)\n\n构造方法。\n\nMethod Summary\n\nQualifier and Type\n\n\t\n\nMethod Name and Description\n\n\n\n\nPromise\n\n\t\n\ncall(params: FunctionParams)\n\n调用云函数,可以不传入data参数,也可以传入对象类型的参数。\n\nConstructors\nconstructor\n\nMethod\n\n\n\n\nconstructor(name: string)\n\n初始化CloudFunction实例。\n\nParameters\n\nName\n\n\t\n\nDescription\n\n\n\n\nname\n\n\t\n\nCloudFunction实例名称。\n\nPublic Methods\ncall\n\nMethod\n\n\n\n\ncall(params: FunctionParams):Promise\n\n调用云函数。\n\nParameters\n\nName\n\n\t\n\nDescription\n\n\n\n\nparams\n\n\t\n\n函数调用参数,包含函数名(必填)、函数版本、超时时长、函数请求消息体。\n\nReturn\n\nType\n\n\t\n\nDescription\n\n\n\n\nPromise\n\n\t\n\nPromise对象,返回函数调用结果。\n\nCloud\nFunctionParams\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\nConstructor Summary\nMethod Summary\nConstructors\nconstructor\nPublic Methods\ncall\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Class Info" + ], + [ + "export class CloudFunction Cloud Functions SDK的入口类,包含调用云函数的方法。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596" + }, + { + "location": "", + "rows": [ + [ + "Constructor Info" + ], + [ + "constructor(name: string) 构造方法。" + ] + ], + "section": "Constructor Summary", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section1611502174217" + }, + { + "location": "", + "rows": [ + [ + "Qualifier and Type", + "Method Name and Description" + ], + [ + "Promise", + "call(params: FunctionParams) 调用云函数,可以不传入data参数,也可以传入对象类型的参数。" + ] + ], + "section": "Method Summary", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section177401747141118" + }, + { + "location": "", + "rows": [ + [ + "Method" + ], + [ + "constructor(name: string) 初始化CloudFunction实例。" + ] + ], + "section": "Constructors", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section1178121234312" + }, + { + "location": "", + "rows": [ + [ + "Name", + "Description" + ], + [ + "name", + "CloudFunction实例名称。" + ] + ], + "section": "Constructors", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section1178121234312" + }, + { + "location": "", + "rows": [ + [ + "Method" + ], + [ + "call(params: FunctionParams):Promise 调用云函数。" + ] + ], + "section": "Public Methods", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section2026765062216" + }, + { + "location": "", + "rows": [ + [ + "Name", + "Description" + ], + [ + "params", + "函数调用参数,包含函数名(必填)、函数版本、超时时长、函数请求消息体。" + ] + ], + "section": "Public Methods", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section2026765062216" + }, + { + "location": "", + "rows": [ + [ + "Type", + "Description" + ], + [ + "Promise", + "Promise对象,返回函数调用结果。" + ] + ], + "section": "Public Methods", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596#section2026765062216" + } + ], + "title": "CloudFunction", + "updatedAt": "2026-10-20 16:24" +} diff --git a/pkg/domain/reference/supplemental/serverless-functionparams-nodejs-0000001733711318.json b/pkg/domain/reference/supplemental/serverless-functionparams-nodejs-0000001733711318.json new file mode 100644 index 0000000..7524454 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-functionparams-nodejs-0000001733711318.json @@ -0,0 +1,87 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-cloudfunction-0000001192993000", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-nodejs-0000001779998825", + "title": "Node.js" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-nodejs-package-0000001780038561", + "title": "@hw-agconnect/cloud-server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/cloudfunction-nodejs-0000001733038596", + "title": "CloudFunction" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcfunctionexception-nodejs-0000001737077046", + "title": "AGCFunctionException" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/functionparams-nodejs-0000001733711318#section1470913322016", + "title": "Public Field Summary" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n云函数\nServer\nNode.js\n@hw-agconnect/cloud-server\nFunctionParams\nFunctionParams\n更新时间: 2024-08-14 08:38\n\nInterface Info\n\n\n\n\nexport interface FunctionParams\n\n函数相关参数类。\n\nPublic Field Summary\n\nName\n\n\t\n\nType\n\n\t\n\nDescription\n\n\n\n\nname\n\n\t\n\nstring\n\n\t\n\n必填,函数名称。\n\n\n\n\nversion\n\n\t\n\nstring\n\n\t\n\n可选,函数版本,默认值为\"$latest\"。\n\n\n\n\ntimeout\n\n\t\n\nnumber\n\n\t\n\n可选,函数运行超时时长,单位为ms,范围(0,55000],默认值为55000。\n\n\n\n\ndata\n\n\t\n\nany\n\n\t\n\n可选,函数请求体。\n\nCloudFunction\nAGCFunctionException\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\nPublic Field Summary\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/functionparams-nodejs-0000001733711318", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "Interface Info" + ], + [ + "export interface FunctionParams 函数相关参数类。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/functionparams-nodejs-0000001733711318" + }, + { + "location": "", + "rows": [ + [ + "Name", + "Type", + "Description" + ], + [ + "name", + "string", + "必填,函数名称。" + ], + [ + "version", + "string", + "可选,函数版本,默认值为\"$latest\"。" + ], + [ + "timeout", + "number", + "可选,函数运行超时时长,单位为ms,范围(0,55000],默认值为55000。" + ], + [ + "data", + "any", + "可选,函数请求体。" + ] + ], + "section": "Public Field Summary", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/functionparams-nodejs-0000001733711318#section1470913322016" + } + ], + "title": "FunctionParams", + "updatedAt": "2024-08-14 08:38" +} diff --git a/pkg/domain/reference/supplemental/serverless-restapi-0000001223619953.json b/pkg/domain/reference/supplemental/serverless-restapi-0000001223619953.json new file mode 100644 index 0000000..e00e67a --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-restapi-0000001223619953.json @@ -0,0 +1,102 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getfile-0000001498998530", + "title": "下载文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-deletefile-0000001549478405", + "title": "删除文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-getmetadata-0000001549518573", + "title": "获取文件元数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-changemetadata-0000001549198553", + "title": "修改文件元数据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "title": "列举文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-datatypes-0000001498678718", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-error-0000001765362989", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/uploadresponse-0000001057373944", + "title": "UploadResponse" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-uploadfile-0000001549318457", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "上传文件" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "下载文件" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "删除文件" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "获取文件元数据" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "修改文件元数据" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "列举文件" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "数据类型" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "text": "错误码" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\nREST API\n更新时间: 2026-10-22 14:56\n上传文件\n\n下载文件\n\n删除文件\n\n获取文件元数据\n\n修改文件元数据\n\n列举文件\n\n数据类型\n\n错误码\n\nUploadResponse\n上传文件\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "status": "browser-read", + "tables": [], + "title": "REST API", + "updatedAt": "2026-10-22 14:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-server-auth-rest-0000001135233594.json b/pkg/domain/reference/supplemental/serverless-server-auth-rest-0000001135233594.json new file mode 100644 index 0000000..3ac1732 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-server-auth-rest-0000001135233594.json @@ -0,0 +1,75 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-0000001055443186", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892", + "title": "导入用户" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-export-0000001136180686", + "title": "导出用户" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-verify-0000001182300271", + "title": "验证用户凭据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193", + "title": "撤销用户凭据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-errorcode-0000001142701050", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/nodejs-errorcode-0000001732781488", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-import-0000001136020892", + "title": "导入用户" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "text": "导入用户" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "text": "导出用户" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "text": "验证用户凭据" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "text": "撤销用户凭据" + }, + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "text": "错误码" + } + ], + "renderedText": "API参考\n认证服务\nServer\nREST API\nREST API\n更新时间: 2026-10-22 11:25\n导入用户\n\n导出用户\n\n验证用户凭据\n\n撤销用户凭据\n\n错误码\n\n错误码\n导入用户\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "status": "browser-read", + "tables": [], + "title": "REST API", + "updatedAt": "2026-10-22 11:25" +} diff --git a/pkg/domain/reference/supplemental/serverless-server-rest-errorcode-0000001142701050.json b/pkg/domain/reference/supplemental/serverless-server-rest-errorcode-0000001142701050.json new file mode 100644 index 0000000..f36f672 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-server-rest-errorcode-0000001142701050.json @@ -0,0 +1,105 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-0000001055443186", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-auth-rest-0000001135233594", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-revoke-0000001182420193", + "title": "撤销用户凭据" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n认证服务\nServer\nREST API\n错误码\n错误码\n更新时间: 2026-10-22 11:25\n\n错误码(errorCode)\n\n\t\n\n错误描述(errorMsg)\n\n\n\n\n0\n\n\t\n\n成功。\n\n\n\n\n205524993\n\n\t\n\nclientToken鉴权失败。\n\n\n\n\n205524994\n\n\t\n\naccessToken验证失败。\n\n\n\n\n203816961\n\n\t\n\n系统内部错误。\n\n\n\n\n203818355\n\n\t\n\ntoken格式错误。\n\n\n\n\n203817985\n\n\t\n\n无效的accessToken。\n\n\n\n\n203818357\n\n\t\n\naccessToken过期。\n\n\n\n\n203817987\n\n\t\n\naccessToken与项目ID不匹配。\n\n\n\n\n203817988\n\n\t\n\n三方认证方式未开通。\n\n\n\n\n203818305\n\n\t\n\n用户列表为空。\n\n\n\n\n203817219\n\n\t\n\n无效的项目ID。\n\n\n\n\n203817744\n\n\t\n\n项目状态错误。\n\n\n\n\n203817856\n\n\t\n\n导出用户信息失败。\n\n\n\n\n203817220\n\n\t\n\n无效的用户ID。\n\n\n\n\n203817729\n\n\t\n\n用户ID和项目ID不匹配。\n\n\n\n\n203818358\n\n\t\n\n更新用户revokeTime失败。\n\n撤销用户凭据\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-errorcode-0000001142701050", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码(errorCode)", + "错误描述(errorMsg)" + ], + [ + "0", + "成功。" + ], + [ + "205524993", + "clientToken鉴权失败。" + ], + [ + "205524994", + "accessToken验证失败。" + ], + [ + "203816961", + "系统内部错误。" + ], + [ + "203818355", + "token格式错误。" + ], + [ + "203817985", + "无效的accessToken。" + ], + [ + "203818357", + "accessToken过期。" + ], + [ + "203817987", + "accessToken与项目ID不匹配。" + ], + [ + "203817988", + "三方认证方式未开通。" + ], + [ + "203818305", + "用户列表为空。" + ], + [ + "203817219", + "无效的项目ID。" + ], + [ + "203817744", + "项目状态错误。" + ], + [ + "203817856", + "导出用户信息失败。" + ], + [ + "203817220", + "无效的用户ID。" + ], + [ + "203817729", + "用户ID和项目ID不匹配。" + ], + [ + "203818358", + "更新用户revokeTime失败。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-rest-errorcode-0000001142701050" + } + ], + "title": "错误码", + "updatedAt": "2026-10-22 11:25" +} diff --git a/pkg/domain/reference/supplemental/serverless-storage-restapi-datatypes-0000001498678718.json b/pkg/domain/reference/supplemental/serverless-storage-restapi-datatypes-0000001498678718.json new file mode 100644 index 0000000..f67f125 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-storage-restapi-datatypes-0000001498678718.json @@ -0,0 +1,39 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-fileinfo-0000001498838610", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-listfile-0000001498518878", + "title": "列举文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-fileinfo-0000001498838610", + "title": "FileInfo" + } + ], + "notes": [ + { + "section": "文档说明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-datatypes-0000001498678718", + "text": "FileInfo" + } + ], + "renderedText": "API参考\n云存储\nServer\nREST API\n数据类型\n数据类型\n更新时间: 2026-10-22 14:56\n\nFileInfo\n\n列举文件\nFileInfo\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-datatypes-0000001498678718", + "status": "browser-read", + "tables": [], + "title": "数据类型", + "updatedAt": "2026-10-22 14:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-storage-restapi-error-0000001765362989.json b/pkg/domain/reference/supplemental/serverless-storage-restapi-error-0000001765362989.json new file mode 100644 index 0000000..b5cf87e --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-storage-restapi-error-0000001765362989.json @@ -0,0 +1,152 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-fileinfo-0000001498838610", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n云存储\nServer\nREST API\n错误码\n错误码\n更新时间: 2026-10-22 14:56\n\n错误码(errorCode)\n\n\t\n\n错误描述(errorMsg)\n\n\t\n\n解决方法(Solution)\n\n\n\n\n135001\n\n\t\n\n参数错误。\n\n\t\n\n请检查请求参数是否正确。\n\n\n\n\n135002\n\n\t\n\n项目不存在。\n\n\t\n\n请检查项目ID是否正确以及云存储服务是否开通。\n\n\n\n\n135003\n\n\t\n\n存储实例不存在。\n\n\t\n\n请检查存储实例是否正确。\n\n\n\n\n135004\n\n\t\n\n存储实例已经存在。\n\n\t\n\n请检查存储实例是否已创建。\n\n\n\n\n135006\n\n\t\n\n项目被管理员禁用。\n\n\t\n\n请联系支撑人员解决。\n\n\n\n\n135007\n\n\t\n\n存储实例被管理员禁用。\n\n\t\n\n请联系支撑人员解决。\n\n\n\n\n135008\n\n\t\n\n存储实例已经被删除。\n\n\t\n\n请检查存储实例是否存在。\n\n\n\n\n136101\n\n\t\n\n项目不存在。\n\n\t\n\n请检查项目ID是否正确,云存储是否开通。\n\n\n\n\n136103\n\n\t\n\n项目已删除。\n\n\t\n\n请联系支撑人员解决。\n\n\n\n\n136201\n\n\t\n\n存储实例数量超上限。\n\n\t\n\n存储实例的数量已达到上限,请删除多余的存储实例。\n\n\n\n\n136202\n\n\t\n\n存储实例正在创建。\n\n\t\n\n存储实例正在创建,无需重复创建。\n\n\n\n\n136203\n\n\t\n\n存储实例创建失败。\n\n\t\n\n请检查请求参数是否正确。若无法解决,请联系支撑人员。\n\n\n\n\n137400\n\n\t\n\n令牌不存在。\n\n\t\n\n请检查令牌是否正确。\n\n\n\n\n141002\n\n\t\n\n项目ID验证失败。\n\n\t\n\n请检查项目ID是否正确。\n\n\n\n\n141003\n\n\t\n\n团队ID验证失败。\n\n\t\n\n团队ID已被限流,请联系支撑人员解决。\n\n\n\n\n141004\n\n\t\n\n网关鉴权认证失败。\n\n\t\n\n请检查鉴权信息是否正确。\n\n\n\n\n141005\n\n\t\n\n匿名认证失败。\n\n\t\n\n请检查鉴权信息是否正确。\n\n\n\n\n141006\n\n\t\n\n项目配额不足。\n\n\t\n\n请补充项目配额。\n\n\n\n\n141008\n\n\t\n\n安全规则校验失败。\n\n\t\n\n安全规则拦截,请排查安全规则是否正确。\n\n\n\n\n141009\n\n\t\n\n云侧网关鉴权参数不正确。\n\n\t\n\n请检查云侧鉴权信息是否正确。\n\n\n\n\n141010\n\n\t\n\n下载文件令牌不存在。\n\n\t\n\n请检查文件令牌是否正确。\n\n\n\n\n141012\n\n\t\n\n待删除文件不存在。\n\n\t\n\n请检查需删除的文件是否存在。\n\nFileInfo\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-error-0000001765362989", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "错误码(errorCode)", + "错误描述(errorMsg)", + "解决方法(Solution)" + ], + [ + "135001", + "参数错误。", + "请检查请求参数是否正确。" + ], + [ + "135002", + "项目不存在。", + "请检查项目ID是否正确以及云存储服务是否开通。" + ], + [ + "135003", + "存储实例不存在。", + "请检查存储实例是否正确。" + ], + [ + "135004", + "存储实例已经存在。", + "请检查存储实例是否已创建。" + ], + [ + "135006", + "项目被管理员禁用。", + "请联系支撑人员解决。" + ], + [ + "135007", + "存储实例被管理员禁用。", + "请联系支撑人员解决。" + ], + [ + "135008", + "存储实例已经被删除。", + "请检查存储实例是否存在。" + ], + [ + "136101", + "项目不存在。", + "请检查项目ID是否正确,云存储是否开通。" + ], + [ + "136103", + "项目已删除。", + "请联系支撑人员解决。" + ], + [ + "136201", + "存储实例数量超上限。", + "存储实例的数量已达到上限,请删除多余的存储实例。" + ], + [ + "136202", + "存储实例正在创建。", + "存储实例正在创建,无需重复创建。" + ], + [ + "136203", + "存储实例创建失败。", + "请检查请求参数是否正确。若无法解决,请联系支撑人员。" + ], + [ + "137400", + "令牌不存在。", + "请检查令牌是否正确。" + ], + [ + "141002", + "项目ID验证失败。", + "请检查项目ID是否正确。" + ], + [ + "141003", + "团队ID验证失败。", + "团队ID已被限流,请联系支撑人员解决。" + ], + [ + "141004", + "网关鉴权认证失败。", + "请检查鉴权信息是否正确。" + ], + [ + "141005", + "匿名认证失败。", + "请检查鉴权信息是否正确。" + ], + [ + "141006", + "项目配额不足。", + "请补充项目配额。" + ], + [ + "141008", + "安全规则校验失败。", + "安全规则拦截,请排查安全规则是否正确。" + ], + [ + "141009", + "云侧网关鉴权参数不正确。", + "请检查云侧鉴权信息是否正确。" + ], + [ + "141010", + "下载文件令牌不存在。", + "请检查文件令牌是否正确。" + ], + [ + "141012", + "待删除文件不存在。", + "请检查需删除的文件是否存在。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-error-0000001765362989" + } + ], + "title": "错误码", + "updatedAt": "2026-10-22 14:56" +} diff --git a/pkg/domain/reference/supplemental/serverless-storage-restapi-fileinfo-0000001498838610.json b/pkg/domain/reference/supplemental/serverless-storage-restapi-fileinfo-0000001498838610.json new file mode 100644 index 0000000..f3a9730 --- /dev/null +++ b/pkg/domain/reference/supplemental/serverless-storage-restapi-fileinfo-0000001498838610.json @@ -0,0 +1,141 @@ +{ + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/server-0000001054967271", + "title": "Server" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/restapi-0000001223619953", + "title": "REST API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-datatypes-0000001498678718", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-datatypes-0000001498678718", + "title": "数据类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-error-0000001765362989", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "renderedText": "API参考\n云存储\nServer\nREST API\n数据类型\nFileInfo\nFileInfo\n更新时间: 2026-10-22 14:56\n\n属性\n\n\t\n\n类型\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n说明\n\n\n\n\nname\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件名称。\n\n\n\n\nbucket\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储实例名称。\n\n\n\n\nstorageArea\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储区域名称。\n\n\n\n\nstorageRegion\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n后端OBS存储站点。\n\n\n\n\nstorageType\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n存储类型。\n\n\n\n\ncontentType\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n文件类型。Content-Type标头告诉客户端实际返回的内容类型。\n\n\n\n\ncontentDisposition\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件打开方式,响应头指示回复的内容该以何种形式展示,是以内联的形式(即网页的一部分),还是以附件的形式下载并保存到本地。\n\n\n\n\ncacheControl\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n标准HTTP请求头字段Cache-Control。\n\npublic:文件可缓存到任何位置。\nprivate:文件可以缓存到请求者的本地缓存中。\nno-cache:文件可以缓存,但有请求发出时,缓存会将此请求发到服务器,服务器验证请求中所描述的缓存是否过期,若未过期,返回304,缓存可使用,否则不可使用。\nno-store:缓存中不得存储任何关于客户端请求和服务端响应的内容。\nmax-age=TIME_IN_SECONDS:文件可缓存的时长。\n\n\n\ncontentEncoding\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n标准HTTP请求头Content-Encoding,是一个实体消息首部,用于对特定媒体类型的数据进行压缩。当这个首部出现的时候,它的值表示消息主体进行了何种方式的内容编码转换。\n\n\n\n\ncontentLanguage\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n标准HTTP请求头 Content-Language,用来说明访问者希望采用的语言或语言组合,这样的话用户就可以根据自己偏好的语言来定制不同的内容。\n\n\n\n\nsha256\n\n\t\n\nString\n\n\t\n\nO\n\n\t\n\n文件SHA256值。\n\n\n\n\nsize\n\n\t\n\nlong\n\n\t\n\nM\n\n\t\n\n文件大小。\n\n\n\n\ncreateTime\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。\n\n\n\n\nupdateTime\n\n\t\n\nString\n\n\t\n\nM\n\n\t\n\n更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。\n\n\n\n\nmetadata\n\n\t\n\nMap\n\n\t\n\nO\n\n\t\n\n元数据,用户自定义元数据。\n\n数据类型\n错误码\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-fileinfo-0000001498838610", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "属性", + "类型", + "必选(M)/可选(O)", + "说明" + ], + [ + "name", + "String", + "M", + "文件名称。" + ], + [ + "bucket", + "String", + "M", + "存储实例名称。" + ], + [ + "storageArea", + "String", + "M", + "存储区域名称。" + ], + [ + "storageRegion", + "String", + "M", + "后端OBS存储站点。" + ], + [ + "storageType", + "String", + "M", + "存储类型。" + ], + [ + "contentType", + "String", + "M", + "文件类型。Content-Type标头告诉客户端实际返回的内容类型。" + ], + [ + "contentDisposition", + "String", + "O", + "文件打开方式,响应头指示回复的内容该以何种形式展示,是以内联的形式(即网页的一部分),还是以附件的形式下载并保存到本地。" + ], + [ + "cacheControl", + "String", + "O", + "标准HTTP请求头字段Cache-Control。 public:文件可缓存到任何位置。 private:文件可以缓存到请求者的本地缓存中。 no-cache:文件可以缓存,但有请求发出时,缓存会将此请求发到服务器,服务器验证请求中所描述的缓存是否过期,若未过期,返回304,缓存可使用,否则不可使用。 no-store:缓存中不得存储任何关于客户端请求和服务端响应的内容。 max-age=TIME_IN_SECONDS:文件可缓存的时长。" + ], + [ + "contentEncoding", + "String", + "O", + "标准HTTP请求头Content-Encoding,是一个实体消息首部,用于对特定媒体类型的数据进行压缩。当这个首部出现的时候,它的值表示消息主体进行了何种方式的内容编码转换。" + ], + [ + "contentLanguage", + "String", + "O", + "标准HTTP请求头 Content-Language,用来说明访问者希望采用的语言或语言组合,这样的话用户就可以根据自己偏好的语言来定制不同的内容。" + ], + [ + "sha256", + "String", + "O", + "文件SHA256值。" + ], + [ + "size", + "long", + "M", + "文件大小。" + ], + [ + "createTime", + "String", + "M", + "上传时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。" + ], + [ + "updateTime", + "String", + "M", + "更新时间,时间日期格式:yyyy-MM-ddTHH:mm:ssZ。" + ], + [ + "metadata", + "Map", + "O", + "元数据,用户自定义元数据。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/storage-restapi-fileinfo-0000001498838610" + } + ], + "title": "FileInfo", + "updatedAt": "2026-10-22 14:56" +} diff --git a/pkg/domain/reference/supplemental/testing-app-language.json b/pkg/domain/reference/supplemental/testing-app-language.json new file mode 100644 index 0000000..7a9f7a1 --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-app-language.json @@ -0,0 +1,108 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "title": "DeviceMaterial" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-operations/agc-help-app-visual-asset-spec-0000002277607976", + "title": "素材规范" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "language", + "M", + "String(20)", + "应用支持的语言。" + ], + [ + "appName", + "O", + "String(255)", + "应用名称。 不少于2个字符,否则应用信息不完整。" + ], + [ + "appDesc", + "M", + "String(8000)", + "对应语言的应用介绍。 不少于2个字符,否则应用信息不完整。" + ], + [ + "briefInfo", + "O", + "String(256)", + "应用简介,用于新增应用一句话介绍。 不少于1个字符,否则应用信息不完整。" + ], + [ + "newFeatures", + "M", + "String(1024)", + "测试说明,描述测试版本的重点特性。" + ], + [ + "formalVersionNewFeatures", + "O", + "String(1024)", + "描述正式版本的重点特性。 当为测试版本时,该字段表示后续转成正式版本的新版本特性描述。" + ], + [ + "deviceMaterials", + "O", + "List", + "设备类型相关的素材。 数组长度不超过6。 说明 素材的格式请参考素材规范。 注意 接口不校验素材的格式(尺寸、分辨率、文件后缀等),请开发者自行保证素材格式的准确性,以免影响素材最终的呈现效果。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312" + } + ], + "title": "AppLanguage", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:37:01.753Z" +} diff --git a/pkg/domain/reference/supplemental/testing-app-review-contact.json b/pkg/domain/reference/supplemental/testing-app-review-contact.json new file mode 100644 index 0000000..271ebfc --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-app-review-contact.json @@ -0,0 +1,64 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "title": "AppLanguage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "account", + "O", + "String(500)", + "应用负责人的手机号码或者邮箱账号。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043" + } + ], + "title": "AppReviewContact", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:58:09.334Z" +} diff --git a/pkg/domain/reference/supplemental/testing-delete-feedback-info.json b/pkg/domain/reference/supplemental/testing-delete-feedback-info.json new file mode 100644 index 0000000..41b1e6e --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-delete-feedback-info.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "title": "deleteFeedbackRequest" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "title": "feedbackListRequest" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "problemId", + "M", + "String(32)", + "问题ID。" + ], + [ + "testerId", + "M", + "String(32)", + "测试用户ID。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324" + } + ], + "title": "delFeedBackInfos", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T03:56:04.751Z" +} diff --git a/pkg/domain/reference/supplemental/testing-delete-feedback-request.json b/pkg/domain/reference/supplemental/testing-delete-feedback-request.json new file mode 100644 index 0000000..4377d8f --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-delete-feedback-request.json @@ -0,0 +1,74 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324", + "title": "delFeedBackInfos" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "title": "VersionVocReq" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324", + "title": "delFeedBackInfos" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "delFeedBackInfos", + "M", + "delFeedBackInfos", + "待删除问题反馈信息。" + ], + [ + "deleteMode", + "M", + "Integer", + "删除模式,1-仅删除反馈,2-删除反馈+测试用户。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673" + } + ], + "title": "deleteFeedbackRequest", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T03:55:35.977Z" +} diff --git a/pkg/domain/reference/supplemental/testing-device-material.json b/pkg/domain/reference/supplemental/testing-device-material.json new file mode 100644 index 0000000..ac92ccf --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-device-material.json @@ -0,0 +1,88 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表" + ], + [ + "appIcon", + "O", + "String(300)", + "应用图标下载地址。 不少于1个字符,否则应用信息不完整。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + ], + [ + "screenShots", + "O", + "List", + "应用截屏地址。 不少于1个字符,否则应用信息不完整。 多个地址以英文逗号隔开,最多不超过10个地址,最少不少于3个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + ], + [ + "showType", + "O", + "Integer", + "截图展现方式。 取值范围: 0:竖屏 1:横屏" + ], + [ + "promoGraphics", + "O", + "List", + "宣传图片地址。 多个地址以英文逗号隔开,最多不超过10个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492" + } + ], + "title": "DeviceMaterial", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:44:10.808Z" +} diff --git a/pkg/domain/reference/supplemental/testing-device-type-info.json b/pkg/domain/reference/supplemental/testing-device-type-info.json new file mode 100644 index 0000000..0c94cf7 --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-device-type-info.json @@ -0,0 +1,70 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "title": "DeviceMaterial" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deviceType", + "M", + "Integer", + "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表 说明 其他设备类型暂未开放。" + ], + [ + "appAdapters", + "O", + "String", + "适配设备类型。 5:平板 说明 当deviceType为4(手机)时,系统会默认兼容分发到平板设备,即给appAdapters赋值5。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488" + } + ], + "title": "DeviceTypeInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:52:16.310Z" +} diff --git a/pkg/domain/reference/supplemental/testing-feedback-list-request.json b/pkg/domain/reference/supplemental/testing-feedback-list-request.json new file mode 100644 index 0000000..389c3bd --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-feedback-list-request.json @@ -0,0 +1,106 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324", + "title": "delFeedBackInfos" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-errorcode-0000002356508845", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "startTime", + "O", + "Integer", + "时间戳,开始时间,不填默认近一年。" + ], + [ + "endTime", + "O", + "Integer", + "时间戳,结束时间,不填默认近一年。" + ], + [ + "appVersions", + "O", + "List", + "应用版本。" + ], + [ + "models", + "O", + "List", + "模型。" + ], + [ + "deviceVersions", + "O", + "List", + "设备版本。" + ], + [ + "machineTypes", + "O", + "List", + "机器类型。" + ], + [ + "currentPage", + "O", + "Integer", + "当前页。" + ], + [ + "pageSize", + "O", + "Integer", + "每页数量。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861" + } + ], + "title": "feedbackListRequest", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T03:55:34.726Z" +} diff --git a/pkg/domain/reference/supplemental/testing-group-info.json b/pkg/domain/reference/supplemental/testing-group-info.json new file mode 100644 index 0000000..615f56f --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-group-info.json @@ -0,0 +1,82 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-invitationcodeinfo-0000002237496324", + "title": "InvitationCodeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "O", + "String(32)", + "测试群组ID。" + ], + [ + "groupName", + "O", + "String(50)", + "测试群组名称。" + ], + [ + "addedTesterNum", + "O", + "Integer", + "已添加测试群组成员的数量。" + ], + [ + "bind", + "O", + "Integer", + "是否绑定该测试群组。 取值范围: 1:已绑定 0:未绑定" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557" + } + ], + "title": "GroupInfo", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T05:02:31.529Z" +} diff --git a/pkg/domain/reference/supplemental/testing-open-test-info.json b/pkg/domain/reference/supplemental/testing-open-test-info.json new file mode 100644 index 0000000..592098b --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-open-test-info.json @@ -0,0 +1,86 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "title": "TestTaskInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-invitationcodeinfo-0000002237496324", + "title": "InvitationCodeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "title": "PackagePermissionIntroVideo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "startTime", + "M", + "Integer(64)", + "测试版本开始时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + ], + [ + "endTime", + "M", + "Integer(64)", + "测试版本结束时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + ], + [ + "testDesc", + "O", + "String(50)", + "测试版本描述。" + ], + [ + "testTaskInfo", + "O", + "TestTaskInfo", + "测试发布信息。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553" + } + ], + "title": "OpenTestInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:52:29.841Z" +} diff --git a/pkg/domain/reference/supplemental/testing-package-file-info.json b/pkg/domain/reference/supplemental/testing-package-file-info.json new file mode 100644 index 0000000..ec4889a --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-package-file-info.json @@ -0,0 +1,54 @@ +{ + "title": "FileInfo", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549", + "updatedAt": "2026-06-25 19:52", + "status": "browser-read", + "tables": [ + { + "section": "", + "location": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "fileName", + "M", + "String(255)", + "文件名称,包括文件的后缀名。" + ], + [ + "objectId", + "M", + "String(1024)", + "文件在文件服务器中的对象ID。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ] + ] + } + ], + "notes": [], + "examples": [], + "links": [ + { + "title": "获取上传文件地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294" + }, + { + "title": "上传文件", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621" + }, + { + "title": "获取上传文件地址", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294" + }, + { + "title": "华为开发者联盟用户协议", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825" + } + ], + "checkedAt": "2026-10-07T04:38:48.485Z" +} diff --git a/pkg/domain/reference/supplemental/testing-package-permission-intro-video.json b/pkg/domain/reference/supplemental/testing-package-permission-intro-video.json new file mode 100644 index 0000000..d57748b --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-package-permission-intro-video.json @@ -0,0 +1,98 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-langtype-0000002236041558", + "title": "语言类型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-file-0000002271160621", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-upload-api-upload-url-0000002236201294", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "title": "OpenTestInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-pageinfo-0000002272455653", + "title": "PageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "lang", + "M", + "String(8)", + "语言种类。 说明 取值请参见语言类型。" + ], + [ + "permissionName", + "M", + "String(512)", + "权限标记字符串。" + ], + [ + "deviceType", + "M", + "Integer(32)", + "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表" + ], + [ + "objectId", + "M", + "String(512)", + "文件在OBS上的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316" + } + ], + "title": "PackagePermissionIntroVideo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:56:01.752Z" +} diff --git a/pkg/domain/reference/supplemental/testing-test-task-info.json b/pkg/domain/reference/supplemental/testing-test-task-info.json new file mode 100644 index 0000000..4f46a87 --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-test-task-info.json @@ -0,0 +1,92 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "title": "GroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-simplegroupinfo-0000002237336496", + "title": "SimpleGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testerinfo-0000002272575561", + "title": "TesterInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupInfos", + "M", + "List", + "测试用户信息。 注意 公开测试不支持修改。" + ], + [ + "needShareLink", + "O", + "Integer", + "是否需要生成分享链接。 取值范围: 0:不需要。 1:需要。" + ], + [ + "publicTestInstallLimit", + "O", + "Integer", + "公开测试安装次数上限。 默认值:10万次 注意 仅公开测试支持填写此字段。" + ], + [ + "displayArea", + "O", + "String(32)", + "展示区域。 取值范围: 1:AppGallery客户端测试专区 说明 邀请测试该字段必填。 公开测试该字段选填。" + ], + [ + "needNotify", + "O", + "Integer(32)", + "是否向用户发送测试通知。 取值范围: 0:不需要 1:需要 默认值:1" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649" + } + ], + "title": "TestTaskInfo", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T04:53:08.862Z" +} diff --git a/pkg/domain/reference/supplemental/testing-version-ext-info.json b/pkg/domain/reference/supplemental/testing-version-ext-info.json new file mode 100644 index 0000000..268ac15 --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-version-ext-info.json @@ -0,0 +1,168 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "title": "AppReviewContact" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testerinfo-0000002272575561", + "title": "TesterInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "title": "VersionVocReq" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "testUserName", + "O", + "String(128)", + "应用审核信息的测试账号。 注意 仅公开测试支持填写此字段。" + ], + [ + "testUserPassword", + "O", + "String(128)", + "应用审核信息的测试用户密码。 注意 仅公开测试支持填写此字段。" + ], + [ + "appRemark", + "O", + "String(300)", + "应用审核信息的备注。 注意 仅公开测试支持填写此字段。" + ], + [ + "isSignedCommitment", + "O", + "Integer(32)", + "是否签署合规承诺函。 取值范围: 空:未签署 1:已签署 说明 目前只有元服务涉及签署。 默认值:空 注意 仅公开测试支持填写此字段。" + ], + [ + "registeredIdType", + "O", + "Integer(32)", + "备案证件类型。 取值范围: -1:清空数据,同时也会清空registeredIdNumber的内容。 1:面向企业,备案证件为社会信用。 2:面向个人,备案证件为身份证。 3:面向机构,备案证件为机构代码。 注意 仅公开测试支持填写此字段。" + ], + [ + "registeredIdNumber", + "O", + "String(64)", + "备案证件号码。 取值范围: registeredIdType为1时,对应社会信用代码。 registeredIdType为2时,对应身份证号码。 registeredIdType为3时,对应机构代码。 注意 仅公开测试支持填写此字段。" + ], + [ + "privacyAgreementId", + "O", + "String(32)", + "隐私协议ID。 注意 仅公开测试支持填写此字段。" + ], + [ + "userAgreementUrl", + "O", + "String(512)", + "用户协议URL。 注意 仅公开测试支持填写此字段。" + ], + [ + "userAgreementIds", + "O", + "List", + "用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。 注意 仅公开测试支持填写此字段。" + ], + [ + "privacyPolicy", + "O", + "String(512)", + "隐私政策网址。" + ], + [ + "privacyRightsUrl", + "O", + "String(256)", + "隐私权利网址。" + ], + [ + "encrypted", + "O", + "Integer(32)", + "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1" + ], + [ + "isAiGenerate", + "O", + "Integer(32)", + "是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。 注意 仅公开测试支持填写此字段。" + ], + [ + "aiTypes", + "O", + "List", + "涉及的AI生成合成服务类型。 注意 仅公开测试支持填写此字段。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景 说明 isAiGenerate取值为1(涉及)时,此参数必填。" + ], + [ + "appReviewPhoneInfo", + "O", + "AppReviewContact", + "应用负责人的手机号信息。用于沟通审核问题。 注意 仅公开测试支持填写此字段。" + ], + [ + "appReviewEmailInfo", + "O", + "AppReviewContact", + "应用负责人的邮箱账号信息。用于接收上架审核结果,应用整改或下架通知。 注意 仅公开测试支持填写此字段。" + ], + [ + "appReviewName", + "O", + "String(256)", + "应用负责人的姓名。 注意 仅公开测试支持填写此字段。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645" + } + ], + "title": "VersionExtInfo", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T04:57:51.871Z" +} diff --git a/pkg/domain/reference/supplemental/testing-version-voc-req.json b/pkg/domain/reference/supplemental/testing-version-voc-req.json new file mode 100644 index 0000000..c059ca9 --- /dev/null +++ b/pkg/domain/reference/supplemental/testing-version-voc-req.json @@ -0,0 +1,76 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "title": "VersionExtInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "title": "deleteFeedbackRequest" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "版本号。" + ], + [ + "packageId", + "M", + "String(32)", + "软件包ID。" + ], + [ + "vocId", + "M", + "String(32)", + "问题工单ID。" + ] + ], + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597" + } + ], + "title": "VersionVocReq", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T05:01:13.222Z" +} diff --git a/pkg/domain/reference/templates/apply-plan.json b/pkg/domain/reference/templates/apply-plan.json new file mode 100644 index 0000000..4df5173 --- /dev/null +++ b/pkg/domain/reference/templates/apply-plan.json @@ -0,0 +1,300 @@ +{ + "title": "apply-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/serverlessModel/api/admApi.js", + "sha256": "b309e6bcebcdb15a4ba2852221a46c89771a5f41b9b3be6e745f7a8bcec2f796", + "source": "import path from\"path\";import crypto from\"crypto\";import{doRequestWithRetry}from\"../util/requestUtil.js\";import{newSLSError}from\"../errors.js\";const retry=3;function newPlanName(e){let t=e.storage.globalGet(\"projectId\"),a=e.storage.globalGet(\"teamId\"),r=crypto.createHash(\"md5\");return r.update(\"plan-\"+a+\"-\"+t+\"-\"),r.digest(\"hex\")+\"-\"+(new Date).getTime()+\"-\"+crypto.randomBytes(4).toString(\"hex\")}async function searchApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/search`,method:\"GET\",params:{appName:t}},r=checkResult(await doRequestWithRetry(e,a,3));return 0===r.length?{}:r[0]}async function addApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications`,method:\"POST\",data:t};return checkResult(await doRequestWithRetry(e,a,3))}async function addPlan(e,t,a){const r=`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans`;let s=JSON.parse(JSON.stringify(a));s.name=newPlanName(e,path.basename(process.cwd()));let o={url:r,method:\"POST\",data:s};return checkResult(await doRequestWithRetry(e,o,3))}async function getPlan(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/plans/${t}`,method:\"GET\"};return checkResult(await doRequestWithRetry(e,a,3))}async function setPlan(e,t,a){let r={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans/${a}`,method:\"PUT\"};return checkResult(await doRequestWithRetry(e,r,3))}function checkResult(e){if(0===e.status)return e.data;throw newSLSError(`Do request error, error message is '${e.message}'`)}export{searchApi,addApi,addPlan,setPlan,getPlan};" + }, + { + "packagePath": "commands/serverlessModel/validator/templateJSON.js", + "sha256": "caa4e0edf4e003b3336b31f9ccbeff0eb7438cf94c6d7d7ee482ce7becd95068", + "source": "import{newSLSError}from\"../errors.js\";import{CloudFunctionValidator}from\"./cloudFunctionValidator.js\";import{getErrorMessage}from\"../errors.js\";function validateTemplateJSON(e){let r=[];for(let o of e.components)switch(o.type){case\"Huawei::AGC::CloudFunctions\":{if(-1!==r.indexOf(o.name))throw newSLSError(`CloudFunction name:${o.name} must not be repeated.`);r.push(o.name);let e=new CloudFunctionValidator(o);try{e.validate()}catch(e){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${getErrorMessage(e)}`)}break}default:throw newSLSError(`Resource type invalid, valid type contains 'Huawei::AGC::CloudFunctions', the resource:${o.type} is invalid`)}}export{validateTemplateJSON};" + }, + { + "packagePath": "commands/serverlessModel/validator/cloudFunctionValidator.js", + "sha256": "a807c6aaed86997722d5d8109d13a540b27682978b416b10a6ed416955c554d1", + "source": "import fs from\"fs\";import path from\"path\";import{isEmpty,isInteger,isString,isArray}from\"../util/judgeUtil.js\";import{judgeZipFile}from\"../util/fsUtil.js\";import{newSLSError,getErrorMessage}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{CloudFunctionCronTriggerValidator}from\"./cronTriggerValidator.js\";import{CloudFunctionHttpTriggerValidator}from\"./httpTriggerValidator.js\";function ValidateCodeUri(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);if(fs.statSync(r).size>=314572800)throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_SIZE_TOO_LARGE}`)}}function ValidateCodeUriInDeployPhase(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);try{judgeZipFile(r)}catch(r){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}.${getErrorMessage(r)}`)}}}class CloudFunctionValidator{constructor(r){this.resource=r}validate(){if(validateFunctionName(this.resource.name),validateDescription(this.resource.properties.description),validateMemory(this.resource.properties.memorySize),validateRuntime(this.resource.properties.runtime),validateTimeout(this.resource.properties.timeout),validateLayers(this.resource.properties.layers),validateFunctionHandle(this.resource.properties.handler),\"java1.8\"!==this.resource.properties.runtime&&validateNoJavaHandler(this.resource.properties.handler),validateEnvironment(this.resource.properties.env),validateInstanceConcurrency(this.resource.properties.instanceConcurrency),validateAliasName(this.resource.properties.alias),void 0===this.resource.properties.events)return;if(!isArray(this.resource.properties.events))throw newSLSError(\"Properties events error. Events type must be array.\");let r=[];for(let e of this.resource.properties.events){if(-1!==r.indexOf(e.name))throw newSLSError(\"Properties event parameter error. Trigger name must not be repeated.\");switch(r.push(e.name),e.type){case\"http\":new CloudFunctionHttpTriggerValidator(e).validate();break;case\"cron\":new CloudFunctionCronTriggerValidator(e).validate();break;default:throw newSLSError(\"Properties event parameter error. The trigger type not supported.\")}}}}function validateFunctionName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_ILLEGAL)}function validateDescription(r){if(void 0!==r){if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_ILLEGAL);if(getStringWidth(r)>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_LONGER)}}const memories=[500,1e3,2e3,4e3];function validateMemory(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_TYPE_ILLEGAL);if(-1===memories.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED)}const runtimes=[\"nodejs14.x\",\"nodejs10.15.2\"];function validateRuntime(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_EMPTY);if(-1===runtimes.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_ILLEGAL)}function validateTimeout(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_TYPE_ILLEGAL);if(r<1||r>1800)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED)}function validateLayers(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_ILLEGAL);for(let e of r)if(!isString(e))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_VALUE_TYPE_ILLEGAL);if(r.length>5)throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_TOO_MANY)}}function validateNoJavaHandler(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateInstanceConcurrency(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL);if(r<1||r>1e3)throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED)}function validateAliasName(r){if(void 0===r)return;if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_ILLEGAL)}function validateFunctionHandle(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateEnvironment(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_ILLEGAL);for(let e of r){if(isEmpty(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_EMPTY);if(!isString(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_TYPE_ILLEGAL);if(isEmpty(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_EMPTY);if(!isString(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_TYPE_ILLEGAL);let r=e.name,o=e.value;if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_LONGER);if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL);if(o.length>2048)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_LONGER)}}}function getStringWidth(r){let e=0;for(let o=0;o=0&&t<=128?1:2}return e}export{CloudFunctionValidator,ValidateCodeUri,ValidateCodeUriInDeployPhase};" + }, + { + "packagePath": "commands/serverlessModel/validator/httpTriggerValidator.js", + "sha256": "5f24abf7b41669aadfeac97ce78468a055cd6206efdf9ac35976efe09b5f513d", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";class CloudFunctionHttpTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateHTTPTriggerAuthType(this.resource.properties.authType),validateHTTPTriggerEnableUrlDecode(this.resource.properties.enableUrlDecode)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function validateHTTPTriggerAuthType(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY);if(-1===HttpTriggerAuthTypeList.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL)}function validateHTTPTriggerEnableUrlDecode(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY);if(\"boolean\"!=typeof r)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL)}export{CloudFunctionHttpTriggerValidator};" + }, + { + "packagePath": "commands/serverlessModel/validator/cronTriggerValidator.js", + "sha256": "ff5ace40c811f4aade2a4f28a0bea20dc7fbf6d7f421129aad1a60580c440da4", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";import{validateTypeEveryExpression,validateTypeMinutesHourDayMonthWeekExpression}from\"../../cloudfunction/option/cronExpressionValidator.js\";class CloudFunctionCronTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateSchedule(this.resource.properties.schedule),validatePayload(this.resource.properties.input)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}function validateSchedule(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_TYPE_ILLEGAL);if(!validateTypeEveryExpression(r)&&!validateTypeMinutesHourDayMonthWeekExpression(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_ILLEGAL)}function validatePayload(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL);try{JSON.parse(r)}catch(r){throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL)}}export{CloudFunctionCronTriggerValidator};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "title": "管理模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "title": "Serverless模板开发" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477", + "title": "主要功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719", + "title": "使用流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "text": "HarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。" + } + ], + "renderedText": "指南\nServerless模板\n业务介绍\n业务介绍\n更新时间: 2026-10-20 16:24\n\nHarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。\n\n主要功能\n\n主要功能\n\n\t\n\n功能描述\n\n\n\n\n构建丰富的Serverless能力\n\n\t\n\n基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。\n\n\n\n\n简化开发与运维\n\n\t\n\n快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。\n\n使用流程\n\n序号\n\n\t\n\n步骤\n\n\t\n\n详情\n\n\n\n\n1\n\n\t\n\n部署Serverless模板\n\n\t\n\n您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。\n\n\n\n\n2\n\n\t\n\n管理Serverless模板\n\n\t\n\n您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。\n\n\n\n\n3\n\n\t\n\n使用Serverless模板\n\n\t\n\n您可以根据模板中的使用指导使用模板。\n\nServerless模板开发\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n主要功能\n使用流程\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "主要功能", + "功能描述" + ], + [ + "构建丰富的Serverless能力", + "基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。" + ], + [ + "简化开发与运维", + "快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。" + ] + ], + "section": "主要功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477" + }, + { + "location": "", + "rows": [ + [ + "序号", + "步骤", + "详情" + ], + [ + "1", + "部署Serverless模板", + "您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。" + ], + [ + "2", + "管理Serverless模板", + "您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。" + ], + [ + "3", + "使用Serverless模板", + "您可以根据模板中的使用指导使用模板。" + ] + ], + "section": "使用流程", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719" + } + ], + "title": "业务介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-imgcrop-0000001269535810", + "title": "图片尺寸调整模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-clearuser-0000001318455685", + "title": "用户数据删除模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-maxrow-0000001269535814", + "title": "数据库记录数限制模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-shortenurl-0000001270513938", + "title": "短URL生成模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-0000001322811985", + "title": "游戏排行榜模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "title": "业务介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "抽奖活动模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "图片尺寸调整模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "用户数据删除模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "数据库记录数限制模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "短URL生成模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "游戏排行榜模板" + } + ], + "renderedText": "指南\nServerless模板\nServerless模板开发\nServerless模板开发\n更新时间: 2025-08-13 09:38\n抽奖活动模板\n\n图片尺寸调整模板\n\n用户数据删除模板\n\n数据库记录数限制模板\n\n短URL生成模板\n\n游戏排行榜模板\n\n业务介绍\n抽奖活动模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "status": "browser-read", + "tables": [], + "title": "Serverless模板开发" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-restrict-0000001272332252", + "title": "使用限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-use_template-0000001320585441", + "title": "使用模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "title": "升级版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "title": "重试部署" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "text": "当模板发布新版本时,还可以选择升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "查看新版本模板的版本说明,确认后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "配置该Serverless服务需要的参数,配置完成后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在升级版本页面,点击“开始升级”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。" + }, + { + "section": "重试部署", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "text": "当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。" + } + ], + "renderedText": "指南\nServerless模板\n管理模板\n管理模板\n更新时间: 2026-10-20 16:24\n\n当模板发布新版本时,还可以选择升级模板。\n\n升级版本\n\n当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。\n选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。\n\n查看新版本模板的版本说明,确认后点击“下一步”。\n\n配置该Serverless服务需要的参数,配置完成后点击“下一步”。\n\n在升级版本页面,点击“开始升级”。\n\n注意\n\n如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。\n\n重试部署\n\n当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。\n\n使用限制\n使用模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n升级版本\n重试部署\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "status": "browser-read", + "tables": [], + "title": "管理模板" + } + ] +} diff --git a/pkg/domain/reference/templates/create-application.json b/pkg/domain/reference/templates/create-application.json new file mode 100644 index 0000000..c686b28 --- /dev/null +++ b/pkg/domain/reference/templates/create-application.json @@ -0,0 +1,300 @@ +{ + "title": "create-application", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/serverlessModel/api/admApi.js", + "sha256": "b309e6bcebcdb15a4ba2852221a46c89771a5f41b9b3be6e745f7a8bcec2f796", + "source": "import path from\"path\";import crypto from\"crypto\";import{doRequestWithRetry}from\"../util/requestUtil.js\";import{newSLSError}from\"../errors.js\";const retry=3;function newPlanName(e){let t=e.storage.globalGet(\"projectId\"),a=e.storage.globalGet(\"teamId\"),r=crypto.createHash(\"md5\");return r.update(\"plan-\"+a+\"-\"+t+\"-\"),r.digest(\"hex\")+\"-\"+(new Date).getTime()+\"-\"+crypto.randomBytes(4).toString(\"hex\")}async function searchApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/search`,method:\"GET\",params:{appName:t}},r=checkResult(await doRequestWithRetry(e,a,3));return 0===r.length?{}:r[0]}async function addApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications`,method:\"POST\",data:t};return checkResult(await doRequestWithRetry(e,a,3))}async function addPlan(e,t,a){const r=`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans`;let s=JSON.parse(JSON.stringify(a));s.name=newPlanName(e,path.basename(process.cwd()));let o={url:r,method:\"POST\",data:s};return checkResult(await doRequestWithRetry(e,o,3))}async function getPlan(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/plans/${t}`,method:\"GET\"};return checkResult(await doRequestWithRetry(e,a,3))}async function setPlan(e,t,a){let r={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans/${a}`,method:\"PUT\"};return checkResult(await doRequestWithRetry(e,r,3))}function checkResult(e){if(0===e.status)return e.data;throw newSLSError(`Do request error, error message is '${e.message}'`)}export{searchApi,addApi,addPlan,setPlan,getPlan};" + }, + { + "packagePath": "commands/serverlessModel/validator/templateJSON.js", + "sha256": "caa4e0edf4e003b3336b31f9ccbeff0eb7438cf94c6d7d7ee482ce7becd95068", + "source": "import{newSLSError}from\"../errors.js\";import{CloudFunctionValidator}from\"./cloudFunctionValidator.js\";import{getErrorMessage}from\"../errors.js\";function validateTemplateJSON(e){let r=[];for(let o of e.components)switch(o.type){case\"Huawei::AGC::CloudFunctions\":{if(-1!==r.indexOf(o.name))throw newSLSError(`CloudFunction name:${o.name} must not be repeated.`);r.push(o.name);let e=new CloudFunctionValidator(o);try{e.validate()}catch(e){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${getErrorMessage(e)}`)}break}default:throw newSLSError(`Resource type invalid, valid type contains 'Huawei::AGC::CloudFunctions', the resource:${o.type} is invalid`)}}export{validateTemplateJSON};" + }, + { + "packagePath": "commands/serverlessModel/validator/cloudFunctionValidator.js", + "sha256": "a807c6aaed86997722d5d8109d13a540b27682978b416b10a6ed416955c554d1", + "source": "import fs from\"fs\";import path from\"path\";import{isEmpty,isInteger,isString,isArray}from\"../util/judgeUtil.js\";import{judgeZipFile}from\"../util/fsUtil.js\";import{newSLSError,getErrorMessage}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{CloudFunctionCronTriggerValidator}from\"./cronTriggerValidator.js\";import{CloudFunctionHttpTriggerValidator}from\"./httpTriggerValidator.js\";function ValidateCodeUri(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);if(fs.statSync(r).size>=314572800)throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_SIZE_TOO_LARGE}`)}}function ValidateCodeUriInDeployPhase(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);try{judgeZipFile(r)}catch(r){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}.${getErrorMessage(r)}`)}}}class CloudFunctionValidator{constructor(r){this.resource=r}validate(){if(validateFunctionName(this.resource.name),validateDescription(this.resource.properties.description),validateMemory(this.resource.properties.memorySize),validateRuntime(this.resource.properties.runtime),validateTimeout(this.resource.properties.timeout),validateLayers(this.resource.properties.layers),validateFunctionHandle(this.resource.properties.handler),\"java1.8\"!==this.resource.properties.runtime&&validateNoJavaHandler(this.resource.properties.handler),validateEnvironment(this.resource.properties.env),validateInstanceConcurrency(this.resource.properties.instanceConcurrency),validateAliasName(this.resource.properties.alias),void 0===this.resource.properties.events)return;if(!isArray(this.resource.properties.events))throw newSLSError(\"Properties events error. Events type must be array.\");let r=[];for(let e of this.resource.properties.events){if(-1!==r.indexOf(e.name))throw newSLSError(\"Properties event parameter error. Trigger name must not be repeated.\");switch(r.push(e.name),e.type){case\"http\":new CloudFunctionHttpTriggerValidator(e).validate();break;case\"cron\":new CloudFunctionCronTriggerValidator(e).validate();break;default:throw newSLSError(\"Properties event parameter error. The trigger type not supported.\")}}}}function validateFunctionName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_ILLEGAL)}function validateDescription(r){if(void 0!==r){if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_ILLEGAL);if(getStringWidth(r)>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_LONGER)}}const memories=[500,1e3,2e3,4e3];function validateMemory(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_TYPE_ILLEGAL);if(-1===memories.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED)}const runtimes=[\"nodejs14.x\",\"nodejs10.15.2\"];function validateRuntime(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_EMPTY);if(-1===runtimes.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_ILLEGAL)}function validateTimeout(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_TYPE_ILLEGAL);if(r<1||r>1800)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED)}function validateLayers(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_ILLEGAL);for(let e of r)if(!isString(e))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_VALUE_TYPE_ILLEGAL);if(r.length>5)throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_TOO_MANY)}}function validateNoJavaHandler(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateInstanceConcurrency(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL);if(r<1||r>1e3)throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED)}function validateAliasName(r){if(void 0===r)return;if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_ILLEGAL)}function validateFunctionHandle(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateEnvironment(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_ILLEGAL);for(let e of r){if(isEmpty(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_EMPTY);if(!isString(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_TYPE_ILLEGAL);if(isEmpty(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_EMPTY);if(!isString(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_TYPE_ILLEGAL);let r=e.name,o=e.value;if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_LONGER);if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL);if(o.length>2048)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_LONGER)}}}function getStringWidth(r){let e=0;for(let o=0;o=0&&t<=128?1:2}return e}export{CloudFunctionValidator,ValidateCodeUri,ValidateCodeUriInDeployPhase};" + }, + { + "packagePath": "commands/serverlessModel/validator/httpTriggerValidator.js", + "sha256": "5f24abf7b41669aadfeac97ce78468a055cd6206efdf9ac35976efe09b5f513d", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";class CloudFunctionHttpTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateHTTPTriggerAuthType(this.resource.properties.authType),validateHTTPTriggerEnableUrlDecode(this.resource.properties.enableUrlDecode)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function validateHTTPTriggerAuthType(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY);if(-1===HttpTriggerAuthTypeList.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL)}function validateHTTPTriggerEnableUrlDecode(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY);if(\"boolean\"!=typeof r)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL)}export{CloudFunctionHttpTriggerValidator};" + }, + { + "packagePath": "commands/serverlessModel/validator/cronTriggerValidator.js", + "sha256": "ff5ace40c811f4aade2a4f28a0bea20dc7fbf6d7f421129aad1a60580c440da4", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";import{validateTypeEveryExpression,validateTypeMinutesHourDayMonthWeekExpression}from\"../../cloudfunction/option/cronExpressionValidator.js\";class CloudFunctionCronTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateSchedule(this.resource.properties.schedule),validatePayload(this.resource.properties.input)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}function validateSchedule(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_TYPE_ILLEGAL);if(!validateTypeEveryExpression(r)&&!validateTypeMinutesHourDayMonthWeekExpression(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_ILLEGAL)}function validatePayload(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL);try{JSON.parse(r)}catch(r){throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL)}}export{CloudFunctionCronTriggerValidator};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "title": "管理模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "title": "Serverless模板开发" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477", + "title": "主要功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719", + "title": "使用流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "text": "HarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。" + } + ], + "renderedText": "指南\nServerless模板\n业务介绍\n业务介绍\n更新时间: 2026-10-20 16:24\n\nHarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。\n\n主要功能\n\n主要功能\n\n\t\n\n功能描述\n\n\n\n\n构建丰富的Serverless能力\n\n\t\n\n基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。\n\n\n\n\n简化开发与运维\n\n\t\n\n快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。\n\n使用流程\n\n序号\n\n\t\n\n步骤\n\n\t\n\n详情\n\n\n\n\n1\n\n\t\n\n部署Serverless模板\n\n\t\n\n您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。\n\n\n\n\n2\n\n\t\n\n管理Serverless模板\n\n\t\n\n您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。\n\n\n\n\n3\n\n\t\n\n使用Serverless模板\n\n\t\n\n您可以根据模板中的使用指导使用模板。\n\nServerless模板开发\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n主要功能\n使用流程\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "主要功能", + "功能描述" + ], + [ + "构建丰富的Serverless能力", + "基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。" + ], + [ + "简化开发与运维", + "快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。" + ] + ], + "section": "主要功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477" + }, + { + "location": "", + "rows": [ + [ + "序号", + "步骤", + "详情" + ], + [ + "1", + "部署Serverless模板", + "您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。" + ], + [ + "2", + "管理Serverless模板", + "您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。" + ], + [ + "3", + "使用Serverless模板", + "您可以根据模板中的使用指导使用模板。" + ] + ], + "section": "使用流程", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719" + } + ], + "title": "业务介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-imgcrop-0000001269535810", + "title": "图片尺寸调整模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-clearuser-0000001318455685", + "title": "用户数据删除模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-maxrow-0000001269535814", + "title": "数据库记录数限制模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-shortenurl-0000001270513938", + "title": "短URL生成模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-0000001322811985", + "title": "游戏排行榜模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "title": "业务介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "抽奖活动模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "图片尺寸调整模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "用户数据删除模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "数据库记录数限制模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "短URL生成模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "游戏排行榜模板" + } + ], + "renderedText": "指南\nServerless模板\nServerless模板开发\nServerless模板开发\n更新时间: 2025-08-13 09:38\n抽奖活动模板\n\n图片尺寸调整模板\n\n用户数据删除模板\n\n数据库记录数限制模板\n\n短URL生成模板\n\n游戏排行榜模板\n\n业务介绍\n抽奖活动模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "status": "browser-read", + "tables": [], + "title": "Serverless模板开发" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-restrict-0000001272332252", + "title": "使用限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-use_template-0000001320585441", + "title": "使用模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "title": "升级版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "title": "重试部署" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "text": "当模板发布新版本时,还可以选择升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "查看新版本模板的版本说明,确认后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "配置该Serverless服务需要的参数,配置完成后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在升级版本页面,点击“开始升级”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。" + }, + { + "section": "重试部署", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "text": "当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。" + } + ], + "renderedText": "指南\nServerless模板\n管理模板\n管理模板\n更新时间: 2026-10-20 16:24\n\n当模板发布新版本时,还可以选择升级模板。\n\n升级版本\n\n当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。\n选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。\n\n查看新版本模板的版本说明,确认后点击“下一步”。\n\n配置该Serverless服务需要的参数,配置完成后点击“下一步”。\n\n在升级版本页面,点击“开始升级”。\n\n注意\n\n如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。\n\n重试部署\n\n当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。\n\n使用限制\n使用模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n升级版本\n重试部署\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "status": "browser-read", + "tables": [], + "title": "管理模板" + } + ] +} diff --git a/pkg/domain/reference/templates/create-plan.json b/pkg/domain/reference/templates/create-plan.json new file mode 100644 index 0000000..990e218 --- /dev/null +++ b/pkg/domain/reference/templates/create-plan.json @@ -0,0 +1,300 @@ +{ + "title": "create-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/serverlessModel/api/admApi.js", + "sha256": "b309e6bcebcdb15a4ba2852221a46c89771a5f41b9b3be6e745f7a8bcec2f796", + "source": "import path from\"path\";import crypto from\"crypto\";import{doRequestWithRetry}from\"../util/requestUtil.js\";import{newSLSError}from\"../errors.js\";const retry=3;function newPlanName(e){let t=e.storage.globalGet(\"projectId\"),a=e.storage.globalGet(\"teamId\"),r=crypto.createHash(\"md5\");return r.update(\"plan-\"+a+\"-\"+t+\"-\"),r.digest(\"hex\")+\"-\"+(new Date).getTime()+\"-\"+crypto.randomBytes(4).toString(\"hex\")}async function searchApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/search`,method:\"GET\",params:{appName:t}},r=checkResult(await doRequestWithRetry(e,a,3));return 0===r.length?{}:r[0]}async function addApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications`,method:\"POST\",data:t};return checkResult(await doRequestWithRetry(e,a,3))}async function addPlan(e,t,a){const r=`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans`;let s=JSON.parse(JSON.stringify(a));s.name=newPlanName(e,path.basename(process.cwd()));let o={url:r,method:\"POST\",data:s};return checkResult(await doRequestWithRetry(e,o,3))}async function getPlan(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/plans/${t}`,method:\"GET\"};return checkResult(await doRequestWithRetry(e,a,3))}async function setPlan(e,t,a){let r={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans/${a}`,method:\"PUT\"};return checkResult(await doRequestWithRetry(e,r,3))}function checkResult(e){if(0===e.status)return e.data;throw newSLSError(`Do request error, error message is '${e.message}'`)}export{searchApi,addApi,addPlan,setPlan,getPlan};" + }, + { + "packagePath": "commands/serverlessModel/validator/templateJSON.js", + "sha256": "caa4e0edf4e003b3336b31f9ccbeff0eb7438cf94c6d7d7ee482ce7becd95068", + "source": "import{newSLSError}from\"../errors.js\";import{CloudFunctionValidator}from\"./cloudFunctionValidator.js\";import{getErrorMessage}from\"../errors.js\";function validateTemplateJSON(e){let r=[];for(let o of e.components)switch(o.type){case\"Huawei::AGC::CloudFunctions\":{if(-1!==r.indexOf(o.name))throw newSLSError(`CloudFunction name:${o.name} must not be repeated.`);r.push(o.name);let e=new CloudFunctionValidator(o);try{e.validate()}catch(e){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${getErrorMessage(e)}`)}break}default:throw newSLSError(`Resource type invalid, valid type contains 'Huawei::AGC::CloudFunctions', the resource:${o.type} is invalid`)}}export{validateTemplateJSON};" + }, + { + "packagePath": "commands/serverlessModel/validator/cloudFunctionValidator.js", + "sha256": "a807c6aaed86997722d5d8109d13a540b27682978b416b10a6ed416955c554d1", + "source": "import fs from\"fs\";import path from\"path\";import{isEmpty,isInteger,isString,isArray}from\"../util/judgeUtil.js\";import{judgeZipFile}from\"../util/fsUtil.js\";import{newSLSError,getErrorMessage}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{CloudFunctionCronTriggerValidator}from\"./cronTriggerValidator.js\";import{CloudFunctionHttpTriggerValidator}from\"./httpTriggerValidator.js\";function ValidateCodeUri(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);if(fs.statSync(r).size>=314572800)throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_SIZE_TOO_LARGE}`)}}function ValidateCodeUriInDeployPhase(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);try{judgeZipFile(r)}catch(r){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}.${getErrorMessage(r)}`)}}}class CloudFunctionValidator{constructor(r){this.resource=r}validate(){if(validateFunctionName(this.resource.name),validateDescription(this.resource.properties.description),validateMemory(this.resource.properties.memorySize),validateRuntime(this.resource.properties.runtime),validateTimeout(this.resource.properties.timeout),validateLayers(this.resource.properties.layers),validateFunctionHandle(this.resource.properties.handler),\"java1.8\"!==this.resource.properties.runtime&&validateNoJavaHandler(this.resource.properties.handler),validateEnvironment(this.resource.properties.env),validateInstanceConcurrency(this.resource.properties.instanceConcurrency),validateAliasName(this.resource.properties.alias),void 0===this.resource.properties.events)return;if(!isArray(this.resource.properties.events))throw newSLSError(\"Properties events error. Events type must be array.\");let r=[];for(let e of this.resource.properties.events){if(-1!==r.indexOf(e.name))throw newSLSError(\"Properties event parameter error. Trigger name must not be repeated.\");switch(r.push(e.name),e.type){case\"http\":new CloudFunctionHttpTriggerValidator(e).validate();break;case\"cron\":new CloudFunctionCronTriggerValidator(e).validate();break;default:throw newSLSError(\"Properties event parameter error. The trigger type not supported.\")}}}}function validateFunctionName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_ILLEGAL)}function validateDescription(r){if(void 0!==r){if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_ILLEGAL);if(getStringWidth(r)>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_LONGER)}}const memories=[500,1e3,2e3,4e3];function validateMemory(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_TYPE_ILLEGAL);if(-1===memories.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED)}const runtimes=[\"nodejs14.x\",\"nodejs10.15.2\"];function validateRuntime(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_EMPTY);if(-1===runtimes.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_ILLEGAL)}function validateTimeout(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_TYPE_ILLEGAL);if(r<1||r>1800)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED)}function validateLayers(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_ILLEGAL);for(let e of r)if(!isString(e))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_VALUE_TYPE_ILLEGAL);if(r.length>5)throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_TOO_MANY)}}function validateNoJavaHandler(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateInstanceConcurrency(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL);if(r<1||r>1e3)throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED)}function validateAliasName(r){if(void 0===r)return;if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_ILLEGAL)}function validateFunctionHandle(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateEnvironment(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_ILLEGAL);for(let e of r){if(isEmpty(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_EMPTY);if(!isString(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_TYPE_ILLEGAL);if(isEmpty(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_EMPTY);if(!isString(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_TYPE_ILLEGAL);let r=e.name,o=e.value;if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_LONGER);if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL);if(o.length>2048)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_LONGER)}}}function getStringWidth(r){let e=0;for(let o=0;o=0&&t<=128?1:2}return e}export{CloudFunctionValidator,ValidateCodeUri,ValidateCodeUriInDeployPhase};" + }, + { + "packagePath": "commands/serverlessModel/validator/httpTriggerValidator.js", + "sha256": "5f24abf7b41669aadfeac97ce78468a055cd6206efdf9ac35976efe09b5f513d", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";class CloudFunctionHttpTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateHTTPTriggerAuthType(this.resource.properties.authType),validateHTTPTriggerEnableUrlDecode(this.resource.properties.enableUrlDecode)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function validateHTTPTriggerAuthType(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY);if(-1===HttpTriggerAuthTypeList.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL)}function validateHTTPTriggerEnableUrlDecode(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY);if(\"boolean\"!=typeof r)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL)}export{CloudFunctionHttpTriggerValidator};" + }, + { + "packagePath": "commands/serverlessModel/validator/cronTriggerValidator.js", + "sha256": "ff5ace40c811f4aade2a4f28a0bea20dc7fbf6d7f421129aad1a60580c440da4", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";import{validateTypeEveryExpression,validateTypeMinutesHourDayMonthWeekExpression}from\"../../cloudfunction/option/cronExpressionValidator.js\";class CloudFunctionCronTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateSchedule(this.resource.properties.schedule),validatePayload(this.resource.properties.input)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}function validateSchedule(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_TYPE_ILLEGAL);if(!validateTypeEveryExpression(r)&&!validateTypeMinutesHourDayMonthWeekExpression(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_ILLEGAL)}function validatePayload(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL);try{JSON.parse(r)}catch(r){throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL)}}export{CloudFunctionCronTriggerValidator};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "title": "管理模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "title": "Serverless模板开发" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477", + "title": "主要功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719", + "title": "使用流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "text": "HarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。" + } + ], + "renderedText": "指南\nServerless模板\n业务介绍\n业务介绍\n更新时间: 2026-10-20 16:24\n\nHarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。\n\n主要功能\n\n主要功能\n\n\t\n\n功能描述\n\n\n\n\n构建丰富的Serverless能力\n\n\t\n\n基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。\n\n\n\n\n简化开发与运维\n\n\t\n\n快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。\n\n使用流程\n\n序号\n\n\t\n\n步骤\n\n\t\n\n详情\n\n\n\n\n1\n\n\t\n\n部署Serverless模板\n\n\t\n\n您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。\n\n\n\n\n2\n\n\t\n\n管理Serverless模板\n\n\t\n\n您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。\n\n\n\n\n3\n\n\t\n\n使用Serverless模板\n\n\t\n\n您可以根据模板中的使用指导使用模板。\n\nServerless模板开发\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n主要功能\n使用流程\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "主要功能", + "功能描述" + ], + [ + "构建丰富的Serverless能力", + "基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。" + ], + [ + "简化开发与运维", + "快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。" + ] + ], + "section": "主要功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477" + }, + { + "location": "", + "rows": [ + [ + "序号", + "步骤", + "详情" + ], + [ + "1", + "部署Serverless模板", + "您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。" + ], + [ + "2", + "管理Serverless模板", + "您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。" + ], + [ + "3", + "使用Serverless模板", + "您可以根据模板中的使用指导使用模板。" + ] + ], + "section": "使用流程", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719" + } + ], + "title": "业务介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-imgcrop-0000001269535810", + "title": "图片尺寸调整模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-clearuser-0000001318455685", + "title": "用户数据删除模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-maxrow-0000001269535814", + "title": "数据库记录数限制模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-shortenurl-0000001270513938", + "title": "短URL生成模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-0000001322811985", + "title": "游戏排行榜模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "title": "业务介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "抽奖活动模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "图片尺寸调整模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "用户数据删除模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "数据库记录数限制模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "短URL生成模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "游戏排行榜模板" + } + ], + "renderedText": "指南\nServerless模板\nServerless模板开发\nServerless模板开发\n更新时间: 2025-08-13 09:38\n抽奖活动模板\n\n图片尺寸调整模板\n\n用户数据删除模板\n\n数据库记录数限制模板\n\n短URL生成模板\n\n游戏排行榜模板\n\n业务介绍\n抽奖活动模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "status": "browser-read", + "tables": [], + "title": "Serverless模板开发" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-restrict-0000001272332252", + "title": "使用限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-use_template-0000001320585441", + "title": "使用模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "title": "升级版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "title": "重试部署" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "text": "当模板发布新版本时,还可以选择升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "查看新版本模板的版本说明,确认后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "配置该Serverless服务需要的参数,配置完成后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在升级版本页面,点击“开始升级”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。" + }, + { + "section": "重试部署", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "text": "当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。" + } + ], + "renderedText": "指南\nServerless模板\n管理模板\n管理模板\n更新时间: 2026-10-20 16:24\n\n当模板发布新版本时,还可以选择升级模板。\n\n升级版本\n\n当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。\n选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。\n\n查看新版本模板的版本说明,确认后点击“下一步”。\n\n配置该Serverless服务需要的参数,配置完成后点击“下一步”。\n\n在升级版本页面,点击“开始升级”。\n\n注意\n\n如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。\n\n重试部署\n\n当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。\n\n使用限制\n使用模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n升级版本\n重试部署\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "status": "browser-read", + "tables": [], + "title": "管理模板" + } + ] +} diff --git a/pkg/domain/reference/templates/deploy.json b/pkg/domain/reference/templates/deploy.json new file mode 100644 index 0000000..886cc17 --- /dev/null +++ b/pkg/domain/reference/templates/deploy.json @@ -0,0 +1,320 @@ +{ + "title": "deploy", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/serverlessModel/api/admApi.js", + "sha256": "b309e6bcebcdb15a4ba2852221a46c89771a5f41b9b3be6e745f7a8bcec2f796", + "source": "import path from\"path\";import crypto from\"crypto\";import{doRequestWithRetry}from\"../util/requestUtil.js\";import{newSLSError}from\"../errors.js\";const retry=3;function newPlanName(e){let t=e.storage.globalGet(\"projectId\"),a=e.storage.globalGet(\"teamId\"),r=crypto.createHash(\"md5\");return r.update(\"plan-\"+a+\"-\"+t+\"-\"),r.digest(\"hex\")+\"-\"+(new Date).getTime()+\"-\"+crypto.randomBytes(4).toString(\"hex\")}async function searchApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/search`,method:\"GET\",params:{appName:t}},r=checkResult(await doRequestWithRetry(e,a,3));return 0===r.length?{}:r[0]}async function addApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications`,method:\"POST\",data:t};return checkResult(await doRequestWithRetry(e,a,3))}async function addPlan(e,t,a){const r=`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans`;let s=JSON.parse(JSON.stringify(a));s.name=newPlanName(e,path.basename(process.cwd()));let o={url:r,method:\"POST\",data:s};return checkResult(await doRequestWithRetry(e,o,3))}async function getPlan(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/plans/${t}`,method:\"GET\"};return checkResult(await doRequestWithRetry(e,a,3))}async function setPlan(e,t,a){let r={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans/${a}`,method:\"PUT\"};return checkResult(await doRequestWithRetry(e,r,3))}function checkResult(e){if(0===e.status)return e.data;throw newSLSError(`Do request error, error message is '${e.message}'`)}export{searchApi,addApi,addPlan,setPlan,getPlan};" + }, + { + "packagePath": "commands/serverlessModel/validator/templateJSON.js", + "sha256": "caa4e0edf4e003b3336b31f9ccbeff0eb7438cf94c6d7d7ee482ce7becd95068", + "source": "import{newSLSError}from\"../errors.js\";import{CloudFunctionValidator}from\"./cloudFunctionValidator.js\";import{getErrorMessage}from\"../errors.js\";function validateTemplateJSON(e){let r=[];for(let o of e.components)switch(o.type){case\"Huawei::AGC::CloudFunctions\":{if(-1!==r.indexOf(o.name))throw newSLSError(`CloudFunction name:${o.name} must not be repeated.`);r.push(o.name);let e=new CloudFunctionValidator(o);try{e.validate()}catch(e){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${getErrorMessage(e)}`)}break}default:throw newSLSError(`Resource type invalid, valid type contains 'Huawei::AGC::CloudFunctions', the resource:${o.type} is invalid`)}}export{validateTemplateJSON};" + }, + { + "packagePath": "commands/serverlessModel/validator/cloudFunctionValidator.js", + "sha256": "a807c6aaed86997722d5d8109d13a540b27682978b416b10a6ed416955c554d1", + "source": "import fs from\"fs\";import path from\"path\";import{isEmpty,isInteger,isString,isArray}from\"../util/judgeUtil.js\";import{judgeZipFile}from\"../util/fsUtil.js\";import{newSLSError,getErrorMessage}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{CloudFunctionCronTriggerValidator}from\"./cronTriggerValidator.js\";import{CloudFunctionHttpTriggerValidator}from\"./httpTriggerValidator.js\";function ValidateCodeUri(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);if(fs.statSync(r).size>=314572800)throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_SIZE_TOO_LARGE}`)}}function ValidateCodeUriInDeployPhase(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);try{judgeZipFile(r)}catch(r){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}.${getErrorMessage(r)}`)}}}class CloudFunctionValidator{constructor(r){this.resource=r}validate(){if(validateFunctionName(this.resource.name),validateDescription(this.resource.properties.description),validateMemory(this.resource.properties.memorySize),validateRuntime(this.resource.properties.runtime),validateTimeout(this.resource.properties.timeout),validateLayers(this.resource.properties.layers),validateFunctionHandle(this.resource.properties.handler),\"java1.8\"!==this.resource.properties.runtime&&validateNoJavaHandler(this.resource.properties.handler),validateEnvironment(this.resource.properties.env),validateInstanceConcurrency(this.resource.properties.instanceConcurrency),validateAliasName(this.resource.properties.alias),void 0===this.resource.properties.events)return;if(!isArray(this.resource.properties.events))throw newSLSError(\"Properties events error. Events type must be array.\");let r=[];for(let e of this.resource.properties.events){if(-1!==r.indexOf(e.name))throw newSLSError(\"Properties event parameter error. Trigger name must not be repeated.\");switch(r.push(e.name),e.type){case\"http\":new CloudFunctionHttpTriggerValidator(e).validate();break;case\"cron\":new CloudFunctionCronTriggerValidator(e).validate();break;default:throw newSLSError(\"Properties event parameter error. The trigger type not supported.\")}}}}function validateFunctionName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_ILLEGAL)}function validateDescription(r){if(void 0!==r){if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_ILLEGAL);if(getStringWidth(r)>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_LONGER)}}const memories=[500,1e3,2e3,4e3];function validateMemory(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_TYPE_ILLEGAL);if(-1===memories.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED)}const runtimes=[\"nodejs14.x\",\"nodejs10.15.2\"];function validateRuntime(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_EMPTY);if(-1===runtimes.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_ILLEGAL)}function validateTimeout(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_TYPE_ILLEGAL);if(r<1||r>1800)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED)}function validateLayers(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_ILLEGAL);for(let e of r)if(!isString(e))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_VALUE_TYPE_ILLEGAL);if(r.length>5)throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_TOO_MANY)}}function validateNoJavaHandler(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateInstanceConcurrency(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL);if(r<1||r>1e3)throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED)}function validateAliasName(r){if(void 0===r)return;if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_ILLEGAL)}function validateFunctionHandle(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateEnvironment(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_ILLEGAL);for(let e of r){if(isEmpty(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_EMPTY);if(!isString(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_TYPE_ILLEGAL);if(isEmpty(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_EMPTY);if(!isString(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_TYPE_ILLEGAL);let r=e.name,o=e.value;if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_LONGER);if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL);if(o.length>2048)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_LONGER)}}}function getStringWidth(r){let e=0;for(let o=0;o=0&&t<=128?1:2}return e}export{CloudFunctionValidator,ValidateCodeUri,ValidateCodeUriInDeployPhase};" + }, + { + "packagePath": "commands/serverlessModel/validator/httpTriggerValidator.js", + "sha256": "5f24abf7b41669aadfeac97ce78468a055cd6206efdf9ac35976efe09b5f513d", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";class CloudFunctionHttpTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateHTTPTriggerAuthType(this.resource.properties.authType),validateHTTPTriggerEnableUrlDecode(this.resource.properties.enableUrlDecode)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function validateHTTPTriggerAuthType(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY);if(-1===HttpTriggerAuthTypeList.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL)}function validateHTTPTriggerEnableUrlDecode(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY);if(\"boolean\"!=typeof r)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL)}export{CloudFunctionHttpTriggerValidator};" + }, + { + "packagePath": "commands/serverlessModel/validator/cronTriggerValidator.js", + "sha256": "ff5ace40c811f4aade2a4f28a0bea20dc7fbf6d7f421129aad1a60580c440da4", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";import{validateTypeEveryExpression,validateTypeMinutesHourDayMonthWeekExpression}from\"../../cloudfunction/option/cronExpressionValidator.js\";class CloudFunctionCronTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateSchedule(this.resource.properties.schedule),validatePayload(this.resource.properties.input)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}function validateSchedule(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_TYPE_ILLEGAL);if(!validateTypeEveryExpression(r)&&!validateTypeMinutesHourDayMonthWeekExpression(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_ILLEGAL)}function validatePayload(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL);try{JSON.parse(r)}catch(r){throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL)}}export{CloudFunctionCronTriggerValidator};" + }, + { + "packagePath": "commands/serverlessModel/api/cloudStorageApi.js", + "sha256": "3e6ab7a2d5553f7786dbbe0e191b443fc7870c474b55b7546b618207ef87f426", + "source": "import fs from\"fs\";import crypto from\"crypto\";function newCloudFunctionZipName(e,t){let o=e.storage.globalGet(\"projectId\"),r=e.storage.globalGet(\"teamId\"),a=crypto.createHash(\"md5\");return a.update(e.storage.globalGet(\"region\")+\"-\"+r+\"-\"+o+\"-\"+t),a.digest(\"hex\")+\"-\"+(new Date).getTime()+\"-\"+crypto.randomBytes(6).toString(\"hex\")}async function uploadApi(e,t,o){let r=newCloudFunctionZipName(e,t);const a=`${e.storage.getProjectStorageBaseUrl()}/v0/${t}/${r}.zip`;let n=fs.statSync(o),d=fs.createReadStream(o);return new Promise(((o,p)=>{e.edge({url:a,method:\"PUT\",headers:{\"Content-Type\":\"application/x-www-form-urlencoded\",\"Content-Length\":n.size,\"X-Agc-Trace-Id\":r},data:d}).then((e=>{o(t+\"/\"+r+\".zip\")})).catch((e=>{let t=\"network error\";void 0!==e.response&&void 0!==e.response.data&&(t=e.response.data),p(`upload to cloudStorage failed, ${t}`)}))}))}export{uploadApi};" + }, + { + "packagePath": "commands/serverlessModel/cmd/deploy/create.js", + "sha256": "cf904f59824fc04f344961c0e90938c3ab574465c667508cb86e27077759556e", + "source": "import{parseResourceFromTemplateJson}from\"./changeset.js\";import{addApi}from\"../../api/admApi.js\";import{output,outputProcessing}from\"./output.js\";import{newSLSError}from\"../../errors.js\";import{uploadApi}from\"../../api/cloudStorageApi.js\";import path from\"path\";import{getErrorMessage}from\"../../errors.js\";import{ask,STATUS_CONSTANTS}from\"./util.js\";async function newProject(r,o,e){PRINT(\"Waiting for changeset to be created...\\n\"),PRINT(\"CloudFormation resource operation\");let t,a=parseResourceFromTemplateJson(o);if(output({ResourceName:30,ResourceType:30,ResourceOperation:30},a),PRINT(\"\"),!await ask())return STATUS_CONSTANTS.INTERRUPT;for(let t of o.components)t.properties.codeUri=await uploadToCloudStorage(r,t,e);try{t=await addApi(r,o)}catch(r){throw newSLSError(\"Add sam name failed, error: \"+JSON.stringify(r)+\".\")}if(!t.id)throw newSLSError(\"Add sam failed, error: create sam failed, no id.\");try{await outputProcessing(r,o),PRINT(`New project ${o.name} successfully.`)}catch(r){throw newSLSError(`create project failed, reason: ${getErrorMessage(r)}`)}}async function uploadToCloudStorage(r,o,e){try{return await uploadApi(r,e,path.join(\".sam/build/\",o.properties.codeUri))}catch(r){throw newSLSError(`Upload ${o.name} function to cloudStorage failed, error: ${JSON.stringify(r)}.`)}}export{newProject};" + }, + { + "packagePath": "commands/serverlessModel/cmd/deploy/cmd.js", + "sha256": "268974b95746e07dcdda38b81895ca8f01fe5ea15e10236094c846cbe07f6ba9", + "source": "import{RELATIVE_BUILD_TEMPLATE_PATH}from\"../../constants.js\";import{validateTemplateJSON}from\"../../validator/templateJSON.js\";import{getErrorMessage}from\"../../errors.js\";import{getRegion,STATUS_CONSTANTS}from\"./util.js\";import{searchApi}from\"../../api/admApi.js\";import{newProject}from\"./create.js\";import{updateProject}from\"./update.js\";import{isLogin}from\"../common.js\";import{verifyStorageInstance}from\"../../option/verify.js\";import{parseTemplateYaml}from\"../../util/yamlUtil.js\";import{ValidateCodeUriInDeployPhase}from\"../../validator/cloudFunctionValidator.js\";async function cmd(e,t){if(!await isLogin(e))return;let o,r;PRINT(\"Agcli sam deploy cmd is used to deploy project.\\n\");try{verifyStorageInstance(t.storageInstance),o=parseTemplateYaml(RELATIVE_BUILD_TEMPLATE_PATH),validateTemplateJSON(o),ValidateCodeUriInDeployPhase(o,\".sam/build/\")}catch(e){return void ERROR(\"Failed to deploy serverless model project, error: \"+getErrorMessage(e))}PRINT(\"\\tDeploying with following values\"),PRINT(\"\\t===============================\"),PRINT(\"\\tProject Name: \",o.name),PRINT(\"\\tRegion: \",getRegion(e)),PRINT(\"\\tStorage Instance: \",t.storageInstance),PRINT(\"\\nInitiating deployment\\n\");try{parseFunctionName(o.name,o.components);let a=await searchApi(e,o.name);r=a.id?await updateProject(e,o,a,t.storageInstance):await newProject(e,o,t.storageInstance),PRINT(\"\")}catch(e){return void ERROR(\"Failed to deploy serverless model project, error: \"+getErrorMessage(e))}switch(r){case STATUS_CONSTANTS.INTERRUPT:WARN(\"Do not deploy severless model project successfully.\");break;case STATUS_CONSTANTS.FAILED:ERROR(\"Deploy severless model project failed.\");break;case STATUS_CONSTANTS.SUCCESS:default:PRINT(\"Deploy severless model project successfully.\")}}function parseFunctionName(e,t){for(let o of t)o.name=e+\"-\"+o.name}function main(e){return{cmd:\"deploy\",desc:\"serverless model deploy\",options:[[\"--storage-instance \",\"storage instance name\"]],action(t){cmd(e,t)}}}export default main;" + }, + { + "packagePath": "commands/serverlessModel/cmd/deploy/output.js", + "sha256": "510a65320311bf4d5e9049becce5c7e94c5947127ce4513430718512ddc8a131", + "source": "import{getPlan}from\"../../api/admApi.js\";import{isEmpty}from\"../../../cloudfunction/util/tools.js\";import{searchApi}from\"../../api/admApi.js\";import{parseChangeSetStatFromGetPlanResult,parseResourceStatusFromSearchApplication}from\"./changeset.js\";import{delay}from\"./util.js\";import{newSLSError}from\"../../errors.js\";function output(t,e){let o=outputTitle(t),r=\"-\".repeat(o);for(let o of e)outputLine(t,o);PRINT(r)}function outputTitle(t){let e=0,o=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e+=t[r],o++);let r=\"-\".repeat(e+2*o-2);PRINT(r);let s=\"\";for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s+=e+\" \".repeat(t[e]-e.length+2));return s=s.substr(0,s.length-2),PRINT(s),PRINT(r),r.length}function outputLine(t,e){let o=1;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&o{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "Create-only SAM deployment: validate every local codeUri ZIP, search exact application name, upload code, create application, then independently query readiness. Existing applications are refused; use explicit create-plan/get-plan/apply-plan for updates. Local-only storageInstance and waitForReady are not sent to ADM. Uploaded artifacts may be retained after failure. Not a console gallery deployment." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "title": "管理模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "title": "Serverless模板开发" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477", + "title": "主要功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719", + "title": "使用流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "text": "HarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。" + } + ], + "renderedText": "指南\nServerless模板\n业务介绍\n业务介绍\n更新时间: 2026-10-20 16:24\n\nHarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。\n\n主要功能\n\n主要功能\n\n\t\n\n功能描述\n\n\n\n\n构建丰富的Serverless能力\n\n\t\n\n基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。\n\n\n\n\n简化开发与运维\n\n\t\n\n快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。\n\n使用流程\n\n序号\n\n\t\n\n步骤\n\n\t\n\n详情\n\n\n\n\n1\n\n\t\n\n部署Serverless模板\n\n\t\n\n您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。\n\n\n\n\n2\n\n\t\n\n管理Serverless模板\n\n\t\n\n您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。\n\n\n\n\n3\n\n\t\n\n使用Serverless模板\n\n\t\n\n您可以根据模板中的使用指导使用模板。\n\nServerless模板开发\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n主要功能\n使用流程\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "主要功能", + "功能描述" + ], + [ + "构建丰富的Serverless能力", + "基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。" + ], + [ + "简化开发与运维", + "快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。" + ] + ], + "section": "主要功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477" + }, + { + "location": "", + "rows": [ + [ + "序号", + "步骤", + "详情" + ], + [ + "1", + "部署Serverless模板", + "您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。" + ], + [ + "2", + "管理Serverless模板", + "您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。" + ], + [ + "3", + "使用Serverless模板", + "您可以根据模板中的使用指导使用模板。" + ] + ], + "section": "使用流程", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719" + } + ], + "title": "业务介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-imgcrop-0000001269535810", + "title": "图片尺寸调整模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-clearuser-0000001318455685", + "title": "用户数据删除模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-maxrow-0000001269535814", + "title": "数据库记录数限制模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-shortenurl-0000001270513938", + "title": "短URL生成模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-0000001322811985", + "title": "游戏排行榜模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "title": "业务介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "抽奖活动模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "图片尺寸调整模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "用户数据删除模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "数据库记录数限制模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "短URL生成模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "游戏排行榜模板" + } + ], + "renderedText": "指南\nServerless模板\nServerless模板开发\nServerless模板开发\n更新时间: 2025-08-13 09:38\n抽奖活动模板\n\n图片尺寸调整模板\n\n用户数据删除模板\n\n数据库记录数限制模板\n\n短URL生成模板\n\n游戏排行榜模板\n\n业务介绍\n抽奖活动模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "status": "browser-read", + "tables": [], + "title": "Serverless模板开发" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-restrict-0000001272332252", + "title": "使用限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-use_template-0000001320585441", + "title": "使用模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "title": "升级版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "title": "重试部署" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "text": "当模板发布新版本时,还可以选择升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "查看新版本模板的版本说明,确认后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "配置该Serverless服务需要的参数,配置完成后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在升级版本页面,点击“开始升级”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。" + }, + { + "section": "重试部署", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "text": "当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。" + } + ], + "renderedText": "指南\nServerless模板\n管理模板\n管理模板\n更新时间: 2026-10-20 16:24\n\n当模板发布新版本时,还可以选择升级模板。\n\n升级版本\n\n当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。\n选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。\n\n查看新版本模板的版本说明,确认后点击“下一步”。\n\n配置该Serverless服务需要的参数,配置完成后点击“下一步”。\n\n在升级版本页面,点击“开始升级”。\n\n注意\n\n如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。\n\n重试部署\n\n当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。\n\n使用限制\n使用模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n升级版本\n重试部署\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "status": "browser-read", + "tables": [], + "title": "管理模板" + } + ] +} diff --git a/pkg/domain/reference/templates/get-plan.json b/pkg/domain/reference/templates/get-plan.json new file mode 100644 index 0000000..6cec373 --- /dev/null +++ b/pkg/domain/reference/templates/get-plan.json @@ -0,0 +1,300 @@ +{ + "title": "get-plan", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/serverlessModel/api/admApi.js", + "sha256": "b309e6bcebcdb15a4ba2852221a46c89771a5f41b9b3be6e745f7a8bcec2f796", + "source": "import path from\"path\";import crypto from\"crypto\";import{doRequestWithRetry}from\"../util/requestUtil.js\";import{newSLSError}from\"../errors.js\";const retry=3;function newPlanName(e){let t=e.storage.globalGet(\"projectId\"),a=e.storage.globalGet(\"teamId\"),r=crypto.createHash(\"md5\");return r.update(\"plan-\"+a+\"-\"+t+\"-\"),r.digest(\"hex\")+\"-\"+(new Date).getTime()+\"-\"+crypto.randomBytes(4).toString(\"hex\")}async function searchApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/search`,method:\"GET\",params:{appName:t}},r=checkResult(await doRequestWithRetry(e,a,3));return 0===r.length?{}:r[0]}async function addApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications`,method:\"POST\",data:t};return checkResult(await doRequestWithRetry(e,a,3))}async function addPlan(e,t,a){const r=`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans`;let s=JSON.parse(JSON.stringify(a));s.name=newPlanName(e,path.basename(process.cwd()));let o={url:r,method:\"POST\",data:s};return checkResult(await doRequestWithRetry(e,o,3))}async function getPlan(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/plans/${t}`,method:\"GET\"};return checkResult(await doRequestWithRetry(e,a,3))}async function setPlan(e,t,a){let r={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans/${a}`,method:\"PUT\"};return checkResult(await doRequestWithRetry(e,r,3))}function checkResult(e){if(0===e.status)return e.data;throw newSLSError(`Do request error, error message is '${e.message}'`)}export{searchApi,addApi,addPlan,setPlan,getPlan};" + }, + { + "packagePath": "commands/serverlessModel/validator/templateJSON.js", + "sha256": "caa4e0edf4e003b3336b31f9ccbeff0eb7438cf94c6d7d7ee482ce7becd95068", + "source": "import{newSLSError}from\"../errors.js\";import{CloudFunctionValidator}from\"./cloudFunctionValidator.js\";import{getErrorMessage}from\"../errors.js\";function validateTemplateJSON(e){let r=[];for(let o of e.components)switch(o.type){case\"Huawei::AGC::CloudFunctions\":{if(-1!==r.indexOf(o.name))throw newSLSError(`CloudFunction name:${o.name} must not be repeated.`);r.push(o.name);let e=new CloudFunctionValidator(o);try{e.validate()}catch(e){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${getErrorMessage(e)}`)}break}default:throw newSLSError(`Resource type invalid, valid type contains 'Huawei::AGC::CloudFunctions', the resource:${o.type} is invalid`)}}export{validateTemplateJSON};" + }, + { + "packagePath": "commands/serverlessModel/validator/cloudFunctionValidator.js", + "sha256": "a807c6aaed86997722d5d8109d13a540b27682978b416b10a6ed416955c554d1", + "source": "import fs from\"fs\";import path from\"path\";import{isEmpty,isInteger,isString,isArray}from\"../util/judgeUtil.js\";import{judgeZipFile}from\"../util/fsUtil.js\";import{newSLSError,getErrorMessage}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{CloudFunctionCronTriggerValidator}from\"./cronTriggerValidator.js\";import{CloudFunctionHttpTriggerValidator}from\"./httpTriggerValidator.js\";function ValidateCodeUri(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);if(fs.statSync(r).size>=314572800)throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_SIZE_TOO_LARGE}`)}}function ValidateCodeUriInDeployPhase(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);try{judgeZipFile(r)}catch(r){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}.${getErrorMessage(r)}`)}}}class CloudFunctionValidator{constructor(r){this.resource=r}validate(){if(validateFunctionName(this.resource.name),validateDescription(this.resource.properties.description),validateMemory(this.resource.properties.memorySize),validateRuntime(this.resource.properties.runtime),validateTimeout(this.resource.properties.timeout),validateLayers(this.resource.properties.layers),validateFunctionHandle(this.resource.properties.handler),\"java1.8\"!==this.resource.properties.runtime&&validateNoJavaHandler(this.resource.properties.handler),validateEnvironment(this.resource.properties.env),validateInstanceConcurrency(this.resource.properties.instanceConcurrency),validateAliasName(this.resource.properties.alias),void 0===this.resource.properties.events)return;if(!isArray(this.resource.properties.events))throw newSLSError(\"Properties events error. Events type must be array.\");let r=[];for(let e of this.resource.properties.events){if(-1!==r.indexOf(e.name))throw newSLSError(\"Properties event parameter error. Trigger name must not be repeated.\");switch(r.push(e.name),e.type){case\"http\":new CloudFunctionHttpTriggerValidator(e).validate();break;case\"cron\":new CloudFunctionCronTriggerValidator(e).validate();break;default:throw newSLSError(\"Properties event parameter error. The trigger type not supported.\")}}}}function validateFunctionName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_ILLEGAL)}function validateDescription(r){if(void 0!==r){if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_ILLEGAL);if(getStringWidth(r)>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_LONGER)}}const memories=[500,1e3,2e3,4e3];function validateMemory(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_TYPE_ILLEGAL);if(-1===memories.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED)}const runtimes=[\"nodejs14.x\",\"nodejs10.15.2\"];function validateRuntime(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_EMPTY);if(-1===runtimes.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_ILLEGAL)}function validateTimeout(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_TYPE_ILLEGAL);if(r<1||r>1800)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED)}function validateLayers(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_ILLEGAL);for(let e of r)if(!isString(e))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_VALUE_TYPE_ILLEGAL);if(r.length>5)throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_TOO_MANY)}}function validateNoJavaHandler(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateInstanceConcurrency(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL);if(r<1||r>1e3)throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED)}function validateAliasName(r){if(void 0===r)return;if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_ILLEGAL)}function validateFunctionHandle(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateEnvironment(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_ILLEGAL);for(let e of r){if(isEmpty(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_EMPTY);if(!isString(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_TYPE_ILLEGAL);if(isEmpty(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_EMPTY);if(!isString(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_TYPE_ILLEGAL);let r=e.name,o=e.value;if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_LONGER);if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL);if(o.length>2048)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_LONGER)}}}function getStringWidth(r){let e=0;for(let o=0;o=0&&t<=128?1:2}return e}export{CloudFunctionValidator,ValidateCodeUri,ValidateCodeUriInDeployPhase};" + }, + { + "packagePath": "commands/serverlessModel/validator/httpTriggerValidator.js", + "sha256": "5f24abf7b41669aadfeac97ce78468a055cd6206efdf9ac35976efe09b5f513d", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";class CloudFunctionHttpTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateHTTPTriggerAuthType(this.resource.properties.authType),validateHTTPTriggerEnableUrlDecode(this.resource.properties.enableUrlDecode)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function validateHTTPTriggerAuthType(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY);if(-1===HttpTriggerAuthTypeList.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL)}function validateHTTPTriggerEnableUrlDecode(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY);if(\"boolean\"!=typeof r)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL)}export{CloudFunctionHttpTriggerValidator};" + }, + { + "packagePath": "commands/serverlessModel/validator/cronTriggerValidator.js", + "sha256": "ff5ace40c811f4aade2a4f28a0bea20dc7fbf6d7f421129aad1a60580c440da4", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";import{validateTypeEveryExpression,validateTypeMinutesHourDayMonthWeekExpression}from\"../../cloudfunction/option/cronExpressionValidator.js\";class CloudFunctionCronTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateSchedule(this.resource.properties.schedule),validatePayload(this.resource.properties.input)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}function validateSchedule(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_TYPE_ILLEGAL);if(!validateTypeEveryExpression(r)&&!validateTypeMinutesHourDayMonthWeekExpression(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_ILLEGAL)}function validatePayload(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL);try{JSON.parse(r)}catch(r){throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL)}}export{CloudFunctionCronTriggerValidator};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "title": "管理模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "title": "Serverless模板开发" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477", + "title": "主要功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719", + "title": "使用流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "text": "HarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。" + } + ], + "renderedText": "指南\nServerless模板\n业务介绍\n业务介绍\n更新时间: 2026-10-20 16:24\n\nHarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。\n\n主要功能\n\n主要功能\n\n\t\n\n功能描述\n\n\n\n\n构建丰富的Serverless能力\n\n\t\n\n基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。\n\n\n\n\n简化开发与运维\n\n\t\n\n快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。\n\n使用流程\n\n序号\n\n\t\n\n步骤\n\n\t\n\n详情\n\n\n\n\n1\n\n\t\n\n部署Serverless模板\n\n\t\n\n您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。\n\n\n\n\n2\n\n\t\n\n管理Serverless模板\n\n\t\n\n您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。\n\n\n\n\n3\n\n\t\n\n使用Serverless模板\n\n\t\n\n您可以根据模板中的使用指导使用模板。\n\nServerless模板开发\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n主要功能\n使用流程\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "主要功能", + "功能描述" + ], + [ + "构建丰富的Serverless能力", + "基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。" + ], + [ + "简化开发与运维", + "快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。" + ] + ], + "section": "主要功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477" + }, + { + "location": "", + "rows": [ + [ + "序号", + "步骤", + "详情" + ], + [ + "1", + "部署Serverless模板", + "您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。" + ], + [ + "2", + "管理Serverless模板", + "您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。" + ], + [ + "3", + "使用Serverless模板", + "您可以根据模板中的使用指导使用模板。" + ] + ], + "section": "使用流程", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719" + } + ], + "title": "业务介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-imgcrop-0000001269535810", + "title": "图片尺寸调整模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-clearuser-0000001318455685", + "title": "用户数据删除模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-maxrow-0000001269535814", + "title": "数据库记录数限制模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-shortenurl-0000001270513938", + "title": "短URL生成模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-0000001322811985", + "title": "游戏排行榜模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "title": "业务介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "抽奖活动模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "图片尺寸调整模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "用户数据删除模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "数据库记录数限制模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "短URL生成模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "游戏排行榜模板" + } + ], + "renderedText": "指南\nServerless模板\nServerless模板开发\nServerless模板开发\n更新时间: 2025-08-13 09:38\n抽奖活动模板\n\n图片尺寸调整模板\n\n用户数据删除模板\n\n数据库记录数限制模板\n\n短URL生成模板\n\n游戏排行榜模板\n\n业务介绍\n抽奖活动模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "status": "browser-read", + "tables": [], + "title": "Serverless模板开发" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-restrict-0000001272332252", + "title": "使用限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-use_template-0000001320585441", + "title": "使用模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "title": "升级版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "title": "重试部署" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "text": "当模板发布新版本时,还可以选择升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "查看新版本模板的版本说明,确认后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "配置该Serverless服务需要的参数,配置完成后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在升级版本页面,点击“开始升级”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。" + }, + { + "section": "重试部署", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "text": "当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。" + } + ], + "renderedText": "指南\nServerless模板\n管理模板\n管理模板\n更新时间: 2026-10-20 16:24\n\n当模板发布新版本时,还可以选择升级模板。\n\n升级版本\n\n当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。\n选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。\n\n查看新版本模板的版本说明,确认后点击“下一步”。\n\n配置该Serverless服务需要的参数,配置完成后点击“下一步”。\n\n在升级版本页面,点击“开始升级”。\n\n注意\n\n如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。\n\n重试部署\n\n当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。\n\n使用限制\n使用模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n升级版本\n重试部署\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "status": "browser-read", + "tables": [], + "title": "管理模板" + } + ] +} diff --git a/pkg/domain/reference/templates/player-id.json b/pkg/domain/reference/templates/player-id.json new file mode 100644 index 0000000..d99af99 --- /dev/null +++ b/pkg/domain/reference/templates/player-id.json @@ -0,0 +1,235 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section624414128367", + "text": "请求示例\nPOST https://your_auth_url\nContent-Type: application/json; charset=utf-8\n{\n \"accessToken\":\"eyJhbGciOiJIUzU****************\",\n \"appId\":\"102***218\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section1424604118480", + "text": "响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"common success\"\n },\n \"data\": {\n \"playerId\": \"10****01\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-game-leaderboard-0000001349245017", + "title": "游戏排行榜模板API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-help-appinfo-0000001100014694", + "title": "查看应用基本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-returncode-0000001323309633", + "title": "返回码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#ZH-CN_TOPIC_0000001296645276__li1171741871918", + "title": "ret参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#ZH-CN_TOPIC_0000001296645276__li8176052152215", + "title": "data参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-game-leaderboard-0000001349245017", + "title": "游戏排行榜模板API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section112501947114611", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section1849073954215", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section624414128367", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section1424604118480", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section112501947114611", + "text": "通过accessToken获取游戏排行榜的用户ID。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section1849073954215", + "text": "必须使用https协议。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "text": "请求参数以JSON格式传入,包含参数如下。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp", + "text": "返回值为JSON格式的字符串,包含参数如下。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp", + "text": "返回码使用标准HTTP状态码,详情请参考返回码。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp", + "text": "ret参数 参数名称 必选(M)/可选(O) 数据类型 参数说明 code M Integer 返回码: 0:成功。 403:accessToken无效,鉴权失败。 msg O String 返回码的描述信息。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp", + "text": "data参数 参数名称 必选(M)/可选(O) 数据类型 参数说明 playerId M String(200) 用户ID。" + } + ], + "renderedText": "API参考\nServerless模板\n游戏排行榜模板API\n获取玩家ID\n获取玩家ID\n更新时间: 2024-06-18 18:08\n功能介绍\n\n通过accessToken获取游戏排行榜的用户ID。\n\n使用约束\n\n必须使用https协议。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n华为服务器 -> 开发者服务器\n\n\n\n\n接口URL\n\n\t\n\n您提供的用户认证接口URL,必须为https协议,格式为https://your_auth_url。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\n\n请求参数以JSON格式传入,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\nappId\n\n\t\n\nM\n\n\t\n\nString(64)\n\n\t\n\n应用ID,获取方法参考查看应用基本信息。\n\n\n\n\naccessToken\n\n\t\n\nM\n\n\t\n\nString(2048)\n\n\t\n\n玩家ID的认证凭据,来自于您调用函数接口时带的参数值。\n\n请求示例\nPOST https://your_auth_url\nContent-Type: application/json; charset=utf-8\n{\n \"accessToken\":\"eyJhbGciOiJIUzU****************\",\n \"appId\":\"102***218\"\n}\n响应参数\n\n返回值为JSON格式的字符串,包含参数如下。\n\n说明\n\n返回码使用标准HTTP状态码,详情请参考返回码。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\nret\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\n获取Token失败时返回的错误信息,包含错误码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},详情请参见ret参数。\n\n\n\n\ndata\n\n\t\n\nM\n\n\t\n\nString\n\n\t\n\nJSONObject字符串的信息,格式为{\"playerId\": \"string\"},详情请参见data参数。\n\nret参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\ncode\n\n\t\n\nM\n\n\t\n\nInteger\n\n\t\n\n返回码:\n\n0:成功。\n403:accessToken无效,鉴权失败。\n\n\n\nmsg\n\n\t\n\nO\n\n\t\n\nString\n\n\t\n\n返回码的描述信息。\n\ndata参数\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\nplayerId\n\n\t\n\nM\n\n\t\n\nString(200)\n\n\t\n\n用户ID。\n\n响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"common success\"\n },\n \"data\": {\n \"playerId\": \"10****01\"\n }\n}\n游戏排行榜模板API\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n使用约束\n接口原型\n请求参数\n请求示例\n响应参数\n响应示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为服务器 -> 开发者服务器" + ], + [ + "接口URL", + "您提供的用户认证接口URL,必须为https协议,格式为https://your_auth_url。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section6932219103913" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "appId", + "M", + "String(64)", + "应用ID,获取方法参考查看应用基本信息。" + ], + [ + "accessToken", + "M", + "String(2048)", + "玩家ID的认证凭据,来自于您调用函数接口时带的参数值。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "ret", + "M", + "String", + "获取Token失败时返回的错误信息,包含错误码及描述信息的JSON字符串,格式为{\"code\":retcode, \"msg\": \"description\"},详情请参见ret参数。" + ], + [ + "data", + "M", + "String", + "JSONObject字符串的信息,格式为{\"playerId\": \"string\"},详情请参见data参数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "code", + "M", + "Integer", + "返回码: 0:成功。 403:accessToken无效,鉴权失败。" + ], + [ + "msg", + "O", + "String", + "返回码的描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "playerId", + "M", + "String(200)", + "用户ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section129mcpsimp" + } + ], + "title": "获取玩家ID", + "updatedAt": "2024-06-18 18:08", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/templates/player-id.parameters.json b/pkg/domain/reference/templates/player-id.parameters.json new file mode 100644 index 0000000..a046341 --- /dev/null +++ b/pkg/domain/reference/templates/player-id.parameters.json @@ -0,0 +1,28 @@ +[ + { + "name": "callbackUrl", + "in": "path", + "type": "string", + "required": true, + "description": "Developer HTTPS authentication callback URL", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276" + }, + { + "name": "appId", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用基本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "in": "body", + "maxLength": 64 + }, + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "玩家ID的认证凭据,来自于您调用函数接口时带的参数值。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-get-id-0000001296645276#section128mcpsimp", + "in": "body", + "maxLength": 2048 + } +] diff --git a/pkg/domain/reference/templates/player-id.rules.json b/pkg/domain/reference/templates/player-id.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/templates/player-id.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/templates/search-applications.json b/pkg/domain/reference/templates/search-applications.json new file mode 100644 index 0000000..ee27186 --- /dev/null +++ b/pkg/domain/reference/templates/search-applications.json @@ -0,0 +1,300 @@ +{ + "title": "search-applications", + "sourceUrl": "https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0", + "checkedAt": "2026-10-26", + "status": "vendor-source-reviewed", + "package": "@hw-agconnect/agc-cli", + "version": "1.12.0", + "sourceFiles": [ + { + "packagePath": "commands/serverlessModel/api/admApi.js", + "sha256": "b309e6bcebcdb15a4ba2852221a46c89771a5f41b9b3be6e745f7a8bcec2f796", + "source": "import path from\"path\";import crypto from\"crypto\";import{doRequestWithRetry}from\"../util/requestUtil.js\";import{newSLSError}from\"../errors.js\";const retry=3;function newPlanName(e){let t=e.storage.globalGet(\"projectId\"),a=e.storage.globalGet(\"teamId\"),r=crypto.createHash(\"md5\");return r.update(\"plan-\"+a+\"-\"+t+\"-\"),r.digest(\"hex\")+\"-\"+(new Date).getTime()+\"-\"+crypto.randomBytes(4).toString(\"hex\")}async function searchApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/search`,method:\"GET\",params:{appName:t}},r=checkResult(await doRequestWithRetry(e,a,3));return 0===r.length?{}:r[0]}async function addApi(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications`,method:\"POST\",data:t};return checkResult(await doRequestWithRetry(e,a,3))}async function addPlan(e,t,a){const r=`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans`;let s=JSON.parse(JSON.stringify(a));s.name=newPlanName(e,path.basename(process.cwd()));let o={url:r,method:\"POST\",data:s};return checkResult(await doRequestWithRetry(e,o,3))}async function getPlan(e,t){let a={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/plans/${t}`,method:\"GET\"};return checkResult(await doRequestWithRetry(e,a,3))}async function setPlan(e,t,a){let r={url:`${e.storage.getTeamBaseUrl()}/api/adm/v1/applications/${t}/plans/${a}`,method:\"PUT\"};return checkResult(await doRequestWithRetry(e,r,3))}function checkResult(e){if(0===e.status)return e.data;throw newSLSError(`Do request error, error message is '${e.message}'`)}export{searchApi,addApi,addPlan,setPlan,getPlan};" + }, + { + "packagePath": "commands/serverlessModel/validator/templateJSON.js", + "sha256": "caa4e0edf4e003b3336b31f9ccbeff0eb7438cf94c6d7d7ee482ce7becd95068", + "source": "import{newSLSError}from\"../errors.js\";import{CloudFunctionValidator}from\"./cloudFunctionValidator.js\";import{getErrorMessage}from\"../errors.js\";function validateTemplateJSON(e){let r=[];for(let o of e.components)switch(o.type){case\"Huawei::AGC::CloudFunctions\":{if(-1!==r.indexOf(o.name))throw newSLSError(`CloudFunction name:${o.name} must not be repeated.`);r.push(o.name);let e=new CloudFunctionValidator(o);try{e.validate()}catch(e){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${getErrorMessage(e)}`)}break}default:throw newSLSError(`Resource type invalid, valid type contains 'Huawei::AGC::CloudFunctions', the resource:${o.type} is invalid`)}}export{validateTemplateJSON};" + }, + { + "packagePath": "commands/serverlessModel/validator/cloudFunctionValidator.js", + "sha256": "a807c6aaed86997722d5d8109d13a540b27682978b416b10a6ed416955c554d1", + "source": "import fs from\"fs\";import path from\"path\";import{isEmpty,isInteger,isString,isArray}from\"../util/judgeUtil.js\";import{judgeZipFile}from\"../util/fsUtil.js\";import{newSLSError,getErrorMessage}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{CloudFunctionCronTriggerValidator}from\"./cronTriggerValidator.js\";import{CloudFunctionHttpTriggerValidator}from\"./httpTriggerValidator.js\";function ValidateCodeUri(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);if(fs.statSync(r).size>=314572800)throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_SIZE_TOO_LARGE}`)}}function ValidateCodeUriInDeployPhase(r,e){for(let o of r.components){if(isEmpty(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_EMPTY}`);if(!isString(o.properties.codeUri))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_TYPE_ILLEGAL}`);let r=o.properties.codeUri;if(path.isAbsolute(r)||(r=path.join(e,r)),!fs.existsSync(r))throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}. ${MSG_CONSTANTS.ARG_ERR_FUNCTION_CODE_PATH_UNEXIST}`);try{judgeZipFile(r)}catch(r){throw newSLSError(`Resource error, resource type: 'Huawei::AGC::CloudFunctions', resource name: ${o.name}.${getErrorMessage(r)}`)}}}class CloudFunctionValidator{constructor(r){this.resource=r}validate(){if(validateFunctionName(this.resource.name),validateDescription(this.resource.properties.description),validateMemory(this.resource.properties.memorySize),validateRuntime(this.resource.properties.runtime),validateTimeout(this.resource.properties.timeout),validateLayers(this.resource.properties.layers),validateFunctionHandle(this.resource.properties.handler),\"java1.8\"!==this.resource.properties.runtime&&validateNoJavaHandler(this.resource.properties.handler),validateEnvironment(this.resource.properties.env),validateInstanceConcurrency(this.resource.properties.instanceConcurrency),validateAliasName(this.resource.properties.alias),void 0===this.resource.properties.events)return;if(!isArray(this.resource.properties.events))throw newSLSError(\"Properties events error. Events type must be array.\");let r=[];for(let e of this.resource.properties.events){if(-1!==r.indexOf(e.name))throw newSLSError(\"Properties event parameter error. Trigger name must not be repeated.\");switch(r.push(e.name),e.type){case\"http\":new CloudFunctionHttpTriggerValidator(e).validate();break;case\"cron\":new CloudFunctionCronTriggerValidator(e).validate();break;default:throw newSLSError(\"Properties event parameter error. The trigger type not supported.\")}}}}function validateFunctionName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_FUNCTION_NAME_ILLEGAL)}function validateDescription(r){if(void 0!==r){if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_ILLEGAL);if(getStringWidth(r)>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_DESCRIPTION_LONGER)}}const memories=[500,1e3,2e3,4e3];function validateMemory(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_TYPE_ILLEGAL);if(-1===memories.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_MEMORY_VALUE_NOT_SUPPORTED)}const runtimes=[\"nodejs14.x\",\"nodejs10.15.2\"];function validateRuntime(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_EMPTY);if(-1===runtimes.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_RUNTIME_ILLEGAL)}function validateTimeout(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_TYPE_ILLEGAL);if(r<1||r>1800)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TIMEOUT_VALUE_NOT_SUPPORTED)}function validateLayers(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_ILLEGAL);for(let e of r)if(!isString(e))throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_VALUE_TYPE_ILLEGAL);if(r.length>5)throw newSLSError(MSG_CONSTANTS.ARG_ERR_LAYER_TOO_MANY)}}function validateNoJavaHandler(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateInstanceConcurrency(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_EMPTY);if(!isInteger(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_TYPE_ILLEGAL);if(r<1||r>1e3)throw newSLSError(MSG_CONSTANTS.ARG_ERR_INSTANCE_CONCURRENCY_VALUE_NOT_SUPPORTED)}function validateAliasName(r){if(void 0===r)return;if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_SHORT);if(r.length>16)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-z0-9-]*[a-z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ALIAS_ILLEGAL)}function validateFunctionHandle(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_ILLEGAL);if(!new RegExp(\"^[A-Za-z0-9-_]*\\\\.[A-Za-z0-9-_]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_REGEX_ILLEGAL);if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HANDLER_TYPE_LONGER)}function validateEnvironment(r){if(void 0!==r){if(!isArray(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_ILLEGAL);for(let e of r){if(isEmpty(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_EMPTY);if(!isString(e.name))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_TYPE_ILLEGAL);if(isEmpty(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_EMPTY);if(!isString(e.value))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_TYPE_ILLEGAL);let r=e.name,o=e.value;if(r.length>64)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_LONGER);if(!new RegExp(\"^[-._a-zA-Z][-._a-zA-Z0-9]*$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_KEY_ILLEGAL);if(o.length>2048)throw newSLSError(MSG_CONSTANTS.ARG_ERR_ENVIRONMENT_VALUE_LONGER)}}}function getStringWidth(r){let e=0;for(let o=0;o=0&&t<=128?1:2}return e}export{CloudFunctionValidator,ValidateCodeUri,ValidateCodeUriInDeployPhase};" + }, + { + "packagePath": "commands/serverlessModel/validator/httpTriggerValidator.js", + "sha256": "5f24abf7b41669aadfeac97ce78468a055cd6206efdf9ac35976efe09b5f513d", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";class CloudFunctionHttpTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateHTTPTriggerAuthType(this.resource.properties.authType),validateHTTPTriggerEnableUrlDecode(this.resource.properties.enableUrlDecode)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}const HttpTriggerAuthTypeList=[\"apigw-client\",\"cloudgw-client\"];function validateHTTPTriggerAuthType(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_EMPTY);if(-1===HttpTriggerAuthTypeList.indexOf(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_AUTH_TYPE_ILLEGAL)}function validateHTTPTriggerEnableUrlDecode(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_EMPTY);if(\"boolean\"!=typeof r)throw newSLSError(MSG_CONSTANTS.ARG_ERR_HTTP_TRIGGER_ENABLE_URL_DECODE_ILLEGAL)}export{CloudFunctionHttpTriggerValidator};" + }, + { + "packagePath": "commands/serverlessModel/validator/cronTriggerValidator.js", + "sha256": "ff5ace40c811f4aade2a4f28a0bea20dc7fbf6d7f421129aad1a60580c440da4", + "source": "import{newSLSError}from\"../errors.js\";import{MSG_CONSTANTS}from\"../constants.js\";import{isEmpty,isString}from\"../util/judgeUtil.js\";import{validateTypeEveryExpression,validateTypeMinutesHourDayMonthWeekExpression}from\"../../cloudfunction/option/cronExpressionValidator.js\";class CloudFunctionCronTriggerValidator{constructor(r){this.resource=r}validate(){validateName(this.resource.name),validateSchedule(this.resource.properties.schedule),validatePayload(this.resource.properties.input)}}function validateName(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_TYPE_ILLEGAL);if(r.length<2)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_SHORT);if(r.length>32)throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_LENTH_LONGER);if(!new RegExp(\"^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$\").test(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_TRIGGER_NAME_ILLEGAL)}function validateSchedule(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_TYPE_ILLEGAL);if(!validateTypeEveryExpression(r)&&!validateTypeMinutesHourDayMonthWeekExpression(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_SCHEDULE_ILLEGAL)}function validatePayload(r){if(isEmpty(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_EMPTY);if(!isString(r))throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL);try{JSON.parse(r)}catch(r){throw newSLSError(MSG_CONSTANTS.ARG_ERR_INPUT_ILLEGAL)}}export{CloudFunctionCronTriggerValidator};" + }, + { + "packagePath": "modules/request/edge.js", + "sha256": "6a2890b78c14efe687c13810ec7aa1ed8d1c512d4e946c66ebb517f93a16782f", + "source": "import axios from\"axios\";import https from\"https\";import fs from\"fs\";import session from\"../session/index.js\";import{isObject,getHDDate}from\"../../util/helper.js\";import storage from\"../storage/index.js\";import Logger from\"../../util/logger.js\";import path from\"path\";import{getDirName}from\"../util/dir.js\";const logger=new Logger(\"Edge\"),edgeRequest=axios.create({withCredentials:!0,httpsAgent:new https.Agent({rejectUnauthorized:!1})});function setEdgeHeaders(e={}){const t={};if(!isObject(e))return t;for(let s in e)e[s]&&(t[s]=e[s]);return t}function createUserAgent(){const e=getDirName(import.meta.url),t=JSON.parse(fs.readFileSync(path.join(e,\"../../package.json\"),\"utf8\"));return`agc-cli-tool/${t.version} (${t.platform})`}const onConfig=async e=>{if(!await session.isSessionValid())return logger.warn(\"Run the agcli login command to sign in the user first.\"),e;e.headers[\"User-Agent\"]=createUserAgent(),e.headers[\"X-HD-DATE\"]=getHDDate();const{uid:t,accessToken:s}=session.getToken(),r=storage.getProjectId(),o=setEdgeHeaders({uid:t,oauth2Token:s,teamId:storage.getTeamId(),productId:r});return Object.assign(e.headers,o),e},onError=e=>Promise.reject(e);edgeRequest.interceptors.request.use(onConfig,onError),edgeRequest.interceptors.response.use((e=>200===e.status?e.data:Promise.reject(e)),(e=>Promise.reject(e)));const edgeRequestWithRawResponse=axios.create({httpsAgent:new https.Agent({rejectUnauthorized:!1})});edgeRequestWithRawResponse.interceptors.request.use(onConfig,onError),edgeRequestWithRawResponse.interceptors.response.use((e=>200===e.status?{data:e.data,headers:e.headers}:Promise.reject(e)),(e=>Promise.reject(e)));export{edgeRequest,edgeRequestWithRawResponse,setEdgeHeaders,createUserAgent};" + } + ], + "notes": [ + "SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back." + ], + "reviewedPages": [ + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "title": "管理模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "title": "Serverless模板开发" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477", + "title": "主要功能" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719", + "title": "使用流程" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "text": "HarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。" + } + ], + "renderedText": "指南\nServerless模板\n业务介绍\n业务介绍\n更新时间: 2026-10-20 16:24\n\nHarmonyOS 开发者中心(简称开发者中心)Serverless模板是基于Serverless服务构建的场景化解决方案,提供了应用生态常见场景的代码实现。开发者可将所需能力快速部署和集成到自己的应用中,有效降低开发门槛,提高交付效率。\n\n主要功能\n\n主要功能\n\n\t\n\n功能描述\n\n\n\n\n构建丰富的Serverless能力\n\n\t\n\n基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。\n\n\n\n\n简化开发与运维\n\n\t\n\n快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。\n\n使用流程\n\n序号\n\n\t\n\n步骤\n\n\t\n\n详情\n\n\n\n\n1\n\n\t\n\n部署Serverless模板\n\n\t\n\n您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。\n\n\n\n\n2\n\n\t\n\n管理Serverless模板\n\n\t\n\n您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。\n\n\n\n\n3\n\n\t\n\n使用Serverless模板\n\n\t\n\n您可以根据模板中的使用指导使用模板。\n\nServerless模板开发\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n主要功能\n使用流程\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "主要功能", + "功能描述" + ], + [ + "构建丰富的Serverless能力", + "基于Serverless服务构建,可一键部署到Serverless环境。实现丰富的场景化能力,提供应用生态常见场景的代码实现。" + ], + [ + "简化开发与运维", + "快速集成到应用或直接使用,免除大量端侧开发与运维工作。支持一键部署、快速集成、弹性伸缩、免运维,助力应用开发者快速集成和交付相关能力。" + ] + ], + "section": "主要功能", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section328615414477" + }, + { + "location": "", + "rows": [ + [ + "序号", + "步骤", + "详情" + ], + [ + "1", + "部署Serverless模板", + "您需要将Serverless模板部署到需要使用模板的项目中,详情请参见对应模板的“部署模板”章节。" + ], + [ + "2", + "管理Serverless模板", + "您可以对已部署模板进行管理,包括升级版本、重试部署等,详情请参见管理模板章节。" + ], + [ + "3", + "使用Serverless模板", + "您可以根据模板中的使用指导使用模板。" + ] + ], + "section": "使用流程", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796#section18868181854719" + } + ], + "title": "业务介绍" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-imgcrop-0000001269535810", + "title": "图片尺寸调整模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-clearuser-0000001318455685", + "title": "用户数据删除模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-maxrow-0000001269535814", + "title": "数据库记录数限制模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-shortenurl-0000001270513938", + "title": "短URL生成模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-0000001322811985", + "title": "游戏排行榜模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-introduction-0000001241424796", + "title": "业务介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-lottery-0000001285625973", + "title": "抽奖活动模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "抽奖活动模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "图片尺寸调整模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "用户数据删除模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "数据库记录数限制模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "短URL生成模板" + }, + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "text": "游戏排行榜模板" + } + ], + "renderedText": "指南\nServerless模板\nServerless模板开发\nServerless模板开发\n更新时间: 2025-08-13 09:38\n抽奖活动模板\n\n图片尺寸调整模板\n\n用户数据删除模板\n\n数据库记录数限制模板\n\n短URL生成模板\n\n游戏排行榜模板\n\n业务介绍\n抽奖活动模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-develop_template-0000001285586137", + "status": "browser-read", + "tables": [], + "title": "Serverless模板开发" + }, + { + "captureTool": "Computer Use; merged-cell capture compatible with scripts/browser-capture-reference.mjs", + "checkedAt": "2026-10-26", + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-leaderboards-restrict-0000001272332252", + "title": "使用限制" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-use_template-0000001320585441", + "title": "使用模板" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "title": "升级版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "title": "重试部署" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "text": "当模板发布新版本时,还可以选择升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "登录HarmonyOS 开发者中心,进入“应用管理”页面。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "仅在模板发布新版本时,才可以进行升级操作。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "查看新版本模板的版本说明,确认后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "配置该Serverless服务需要的参数,配置完成后点击“下一步”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "在升级版本页面,点击“开始升级”。" + }, + { + "section": "升级版本", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section1283521354713", + "text": "如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。" + }, + { + "section": "重试部署", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200#section15379101918387", + "text": "当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。" + } + ], + "renderedText": "指南\nServerless模板\n管理模板\n管理模板\n更新时间: 2026-10-20 16:24\n\n当模板发布新版本时,还可以选择升级模板。\n\n升级版本\n\n当Serverless模板有新版本上架时,您可以在已经部署的模板列表中升级模板。\n\n登录HarmonyOS 开发者中心,进入“应用管理”页面。\n在左上角的应用列表中点击“切换至项目”,选择需要升级Serverless模板的项目。\n选择“开放能力配置 > Serverless模板”,点击可升级模板右侧的“升级”。\n说明\n\n仅在模板发布新版本时,才可以进行升级操作。\n\n查看新版本模板的版本说明,确认后点击“下一步”。\n\n配置该Serverless服务需要的参数,配置完成后点击“下一步”。\n\n在升级版本页面,点击“开始升级”。\n\n注意\n\n如升级失败,您可在页面点击“重新部署”。多次重新部署仍失败时,可点击“反馈问题”,填写问题详情并提交后等待运维人员处理,处理周期一般在1个工作日内。\n\n重试部署\n\n当Serverless部署失败后,操作列会出现“部署”操作,您可点击重试部署。\n\n使用限制\n使用模板\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n升级版本\n重试部署\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-serverless-manage_template-0000001241426200", + "status": "browser-read", + "tables": [], + "title": "管理模板" + } + ] +} diff --git a/pkg/domain/reference/templates/user-id.json b/pkg/domain/reference/templates/user-id.json new file mode 100644 index 0000000..c1797c7 --- /dev/null +++ b/pkg/domain/reference/templates/user-id.json @@ -0,0 +1,136 @@ +{ + "checkedAt": "2026-10-26", + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section624414128367", + "text": "请求示例\nPOST https://your_auth_url\nContent-Type: application/json; charset=utf-8\n{\n \"accessToken\":\"eyJhbGciOiJIUzU****************\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section18524194122113", + "text": "响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"userId\": \"10****01\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section125771341635", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section128mcpsimp", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section624414128367", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section129mcpsimp", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section18524194122113", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section125771341635", + "text": "通过accessToken获取抽奖用户ID,即userId。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section128mcpsimp", + "text": "请求参数以JSON格式传入,包含参数如下。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section129mcpsimp", + "text": "返回值为JSON格式的字符串,包含参数如下。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section129mcpsimp", + "text": "返回码使用标准HTTP状态码,详情请参考对应模板的返回码。" + } + ], + "renderedText": "API参考\nServerless模板\n公共API\n获取用户ID\n获取用户ID\n更新时间: 2022-07-11 10:50\n功能介绍\n\n通过accessToken获取抽奖用户ID,即userId。\n\n接口原型\n\n承载协议\n\n\t\n\nHTTPS POST\n\n\n\n\n接口方向\n\n\t\n\n华为服务器 -> 开发者服务器\n\n\n\n\n接口URL\n\n\t\n\n开发者提供用户认证接口URL,必须为HTTPS协议。\n\n\n\n\n数据格式\n\n\t\n\n请求:Content-Type: application/json\n\n响应:Content-Type: application/json\n\n请求参数\n\n请求参数以JSON格式传入,包含参数如下。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\naccessToken\n\n\t\n\nM\n\n\t\n\nString(256)\n\n\t\n\n认证凭据。\n\n请求示例\nPOST https://your_auth_url\nContent-Type: application/json; charset=utf-8\n{\n \"accessToken\":\"eyJhbGciOiJIUzU****************\"\n}\n响应参数\n\n返回值为JSON格式的字符串,包含参数如下。\n\n说明\n\n返回码使用标准HTTP状态码,详情请参考对应模板的返回码。\n\n参数名称\n\n\t\n\n必选(M)/可选(O)\n\n\t\n\n数据类型\n\n\t\n\n参数说明\n\n\n\n\nuserId\n\n\t\n\nO\n\n\t\n\nString(100)\n\n\t\n\n根据accessToken获取的用户ID。\n\n响应示例\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n{\n \"userId\": \"10****01\"\n}\n意见反馈\n以上内容对您是否有帮助?\n意见反馈\n如果您有其他疑问,您也可以通过开发者社区问答频道来和我们联系探讨。\n社区提问AI 助手提问\n本文导读\n功能介绍\n接口原型\n请求参数\n请求示例\n响应参数\n响应示例\n简体中文\n华为开发者联盟 版权所有 ©2026\n问题反馈\n使用条款\n华为开发者联盟用户协议\n关于华为开发者联盟与隐私的声明\nCookies\n开源软件声明", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "华为服务器 -> 开发者服务器" + ], + [ + "接口URL", + "开发者提供用户认证接口URL,必须为HTTPS协议。" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section6932219103913" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "accessToken", + "M", + "String(256)", + "认证凭据。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section128mcpsimp" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "数据类型", + "参数说明" + ], + [ + "userId", + "O", + "String(100)", + "根据accessToken获取的用户ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section129mcpsimp" + } + ], + "title": "获取用户ID", + "updatedAt": "2022-07-11 10:50", + "captureTool": "Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture" +} diff --git a/pkg/domain/reference/templates/user-id.parameters.json b/pkg/domain/reference/templates/user-id.parameters.json new file mode 100644 index 0000000..2a50169 --- /dev/null +++ b/pkg/domain/reference/templates/user-id.parameters.json @@ -0,0 +1,19 @@ +[ + { + "name": "callbackUrl", + "in": "path", + "type": "string", + "required": true, + "description": "Developer HTTPS authentication callback URL", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838" + }, + { + "name": "accessToken", + "type": "string", + "required": true, + "description": "认证凭据。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agc-serverless-comm-api-obtainuserid-0000001260291838#section128mcpsimp", + "in": "body", + "maxLength": 256 + } +] diff --git a/pkg/domain/reference/templates/user-id.rules.json b/pkg/domain/reference/templates/user-id.rules.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/pkg/domain/reference/templates/user-id.rules.json @@ -0,0 +1 @@ +[] diff --git a/pkg/domain/reference/testing/test-api-add-invite-code.json b/pkg/domain/reference/testing/test-api-add-invite-code.json new file mode 100644 index 0000000..d20d7a5 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-invite-code.json @@ -0,0 +1,347 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section162251741185115", + "text": "请求示例\n POST /api/app-test/v1/invitation-code HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId: 6917********65\n {\n \"groupId\": \"76********08\",\n \"invitationCodeValidDays\": 7,\n \"invitationCodeInviteLimit\": 1000\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\",\n \"businessCode\": 0,\n \"invitationCode\": \"1f******ll\",\n \"invitationCodeId\": \"2697**********43\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "title": "公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538", + "title": "发送邀请测试通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570", + "title": "删除邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section16817111413112", + "text": "此接口用于邀请测试生成邀请码。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section16817111413112", + "text": "若您的应用已切换为“AppTest邀请测试”,无法使用该接口,您可以使用创建公开链接接口。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213", + "text": "请求Body中使用JSON格式携带邀请码信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/invitation-code" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ], + [ + "invitationCodeValidDays", + "M", + "Integer(32)", + "邀请码有效期。 单位:天 邀请码仅支持30天有效。" + ], + [ + "invitationCodeInviteLimit", + "M", + "Integer(32)", + "邀请码可邀请人数上限。 最大值10000。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "返回码描述信息。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码。 取值范围: 100:测试群组已存在生效邀请码。 101:测试群用户数量已达上限。" + ], + [ + "invitationCode", + "O", + "String", + "邀请码。" + ], + [ + "invitationCodeId", + "O", + "String", + "邀请码ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section9752647125217" + } + ], + "title": "生成邀请码", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:54:52.317Z", + "family": "testing", + "endpoint": "test-api-add-invite-code" +} diff --git a/pkg/domain/reference/testing/test-api-add-invite-code.parameters.json b/pkg/domain/reference/testing/test-api-add-invite-code.parameters.json new file mode 100644 index 0000000..31ce2b4 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-invite-code.parameters.json @@ -0,0 +1,44 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115" + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213", + "maxLength": 32 + }, + { + "name": "invitationCodeValidDays", + "in": "body", + "type": "integer", + "required": true, + "description": "邀请码有效期。 单位:天 邀请码仅支持30天有效。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213" + }, + { + "name": "invitationCodeInviteLimit", + "in": "body", + "type": "integer", + "required": true, + "description": "邀请码可邀请人数上限。 最大值10000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section141117691213" + } +] diff --git a/pkg/domain/reference/testing/test-api-add-invite-code.rules.json b/pkg/domain/reference/testing/test-api-add-invite-code.rules.json new file mode 100644 index 0000000..af2225a --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-invite-code.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-invite-code-0000002236201342#section1929055974115", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-group-user.json b/pkg/domain/reference/testing/test-api-add-test-group-user.json new file mode 100644 index 0000000..d6bdab4 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-group-user.json @@ -0,0 +1,320 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section162251741185115", + "text": "请求示例\nPOST /api/publish/v2/test/user HTTP/1.1 \nHost: connect-api.cloud.huawei.com \nclient_id: 4141******68 \nContent-Type: application/json \nAuthorization: Bearer ******* \nappId: 6917********65\n{\n \"groupId\": \"41******68\",\n \"nickName\": \"M***y\",\n \"hwAccount\": \"86-130****5675\",\n \"uid\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section14178457143617", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773", + "title": "查询测试群组成员" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section16817111413112", + "text": "此接口用于邀请测试新增测试群组成员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/user" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ], + [ + "nickName", + "O", + "String(64)", + "需要添加到测试群组的成员昵称。" + ], + [ + "hwAccount", + "M", + "String(256)", + "测试群组成员的华为账号、邮箱或者手机号。 手机号格式为:国家码-手机号 内部群组手机号格式为:0086手机号 外部群组手机号格式为:86-手机号" + ], + [ + "uid", + "O", + "String(128)", + "联盟账号id,内部群组添加成员必填。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section9752647125217" + } + ], + "title": "新增测试群组成员", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:54:55.274Z", + "family": "testing", + "endpoint": "test-api-add-test-group-user" +} diff --git a/pkg/domain/reference/testing/test-api-add-test-group-user.parameters.json b/pkg/domain/reference/testing/test-api-add-test-group-user.parameters.json new file mode 100644 index 0000000..756d310 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-group-user.parameters.json @@ -0,0 +1,55 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518" + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 32 + }, + { + "name": "nickName", + "in": "body", + "type": "string", + "required": false, + "description": "需要添加到测试群组的成员昵称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 64 + }, + { + "name": "hwAccount", + "in": "body", + "type": "string", + "required": true, + "description": "测试群组成员的华为账号、邮箱或者手机号。 手机号格式为:国家码-手机号 内部群组手机号格式为:0086手机号 外部群组手机号格式为:86-手机号", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 256 + }, + { + "name": "uid", + "in": "body", + "type": "string", + "required": false, + "description": "联盟账号id,内部群组添加成员必填。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section141117691213", + "maxLength": 128 + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-group-user.rules.json b/pkg/domain/reference/testing/test-api-add-test-group-user.rules.json new file mode 100644 index 0000000..47d0172 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-group-user.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-user-0000002236201338#section1585011135518", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-group.json b/pkg/domain/reference/testing/test-api-add-test-group.json new file mode 100644 index 0000000..76e1331 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-group.json @@ -0,0 +1,331 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section162251741185115", + "text": "请求示例\n POST /api/app-test/v1/test-group HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId: 6917********65\n{\n \"groupName\": \"string\",\n \"groupType\": 0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section14178457143617", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\",\n \"businessCode\": 0,\n \"groupId\": \"761e********08\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334", + "title": "提交测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717", + "title": "查询测试群组列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section16817111413112", + "text": "此接口用于邀请测试创建内外部测试群组。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section141117691213", + "text": "请求Body中使用JSON格式携带测试群组信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/test-group" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupName", + "M", + "String(50)", + "测试群组。" + ], + [ + "groupType", + "O", + "Integer", + "群组类别。 取值范围: 0: 外部群组(默认)。 1: 内部群组。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3: 并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "返回码描述信息。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码。 取值范围: 100:测试群组名称重复。 101:测试群组数量已达上限。" + ], + [ + "groupId", + "O", + "String", + "测试群组ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section9752647125217" + } + ], + "title": "新增测试群组", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:54:53.586Z", + "family": "testing", + "endpoint": "test-api-add-test-group" +} diff --git a/pkg/domain/reference/testing/test-api-add-test-group.parameters.json b/pkg/domain/reference/testing/test-api-add-test-group.parameters.json new file mode 100644 index 0000000..786e217 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-group.parameters.json @@ -0,0 +1,40 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341" + }, + { + "name": "groupName", + "in": "body", + "type": "string", + "required": true, + "description": "测试群组。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section141117691213", + "maxLength": 50 + }, + { + "name": "groupType", + "in": "body", + "type": "integer", + "required": false, + "description": "群组类别。 取值范围: 0: 外部群组(默认)。 1: 内部群组。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section141117691213", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-group.rules.json b/pkg/domain/reference/testing/test-api-add-test-group.rules.json new file mode 100644 index 0000000..912189d --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-group.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-group-0000002271160661#section154576486341", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-package.json b/pkg/domain/reference/testing/test-api-add-test-package.json new file mode 100644 index 0000000..65834b9 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-package.json @@ -0,0 +1,328 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section162251741185115", + "text": "请求示例\n POST /api/publish/v2/test/version/pkg?appId=10****47 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n{\n \"distributeMode\": 1,\n \"file\": {\n \"fileName\": \"********.app\",\n \"objectId\": \"CN/2024052102/********.app\"\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section158414558359", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"pkgVersion\": [\"1426********00\"]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "title": "查询软件包编译状态" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657", + "title": "更新测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549", + "title": "FileInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189", + "title": "查询上架自检报告信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657", + "title": "更新测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330#section158414558359", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section16817111413112", + "text": "此接口用于测试版本上传软件包。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section16817111413112", + "text": "由于软件包解析采用异步方式,建议在上传软件包后轮询查询软件包编译状态,确认包解析完成后,再调用更新测试版本接口绑定软件包。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section141117691213", + "text": "请求Body中使用JSON格式携带需要上传的软件包信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/version/pkg" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section6641436115716" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "distributeMode", + "O", + "Integer(32)", + "软件包分发方式。 取值范围: 1:测试专区 2:应用市场" + ], + [ + "file", + "M", + "FileInfo", + "文件信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "pkgVersion", + "O", + "List", + "软件包ID。 仅返回一个值。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section9752647125217" + } + ], + "title": "添加软件包", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:56.608Z", + "family": "testing", + "endpoint": "test-api-add-test-package" +} diff --git a/pkg/domain/reference/testing/test-api-add-test-package.parameters.json b/pkg/domain/reference/testing/test-api-add-test-package.parameters.json new file mode 100644 index 0000000..6dd9de5 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-package.parameters.json @@ -0,0 +1,59 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "maxLength": 64 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section6641436115716" + }, + { + "name": "distributeMode", + "in": "body", + "type": "integer", + "required": false, + "description": "软件包分发方式。 取值范围: 1:测试专区 2:应用市场", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section141117691213", + "enum": [ + "1", + "2" + ] + }, + { + "name": "file", + "in": "body", + "type": "object", + "required": true, + "description": "文件信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section141117691213", + "properties": [ + { + "name": "fileName", + "in": "body", + "type": "string", + "required": true, + "maxLength": 255, + "description": "文件名称,包括文件的后缀名。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549" + }, + { + "name": "objectId", + "in": "body", + "type": "string", + "required": true, + "maxLength": 1024, + "description": "文件在文件服务器中的对象ID。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-fileinfo-0000002272575549" + } + ] + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-package.rules.json b/pkg/domain/reference/testing/test-api-add-test-package.rules.json new file mode 100644 index 0000000..9baf1f9 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-package.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-package-0000002236201330#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-version.json b/pkg/domain/reference/testing/test-api-add-test-version.json new file mode 100644 index 0000000..7c6337d --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-version.json @@ -0,0 +1,323 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section162251741185115", + "text": "请求示例\n POST /api/publish/v2/test/app/version?appId=10****47 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n {\n \"releaseType\": 6,\n \"testType\": 3,\n \"testDesc\": \"测试版本描述demo\",\n \"onshelfSelfDetect\": 1\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section45981511195316", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"versionId\": \"17*********8710\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189", + "title": "查询上架自检报告信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section16817111413112", + "text": "此接口用于创建HarmonyOS应用/元服务的测试版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "text": "请求Body中使用JSON格式携带添加的测试版本信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/app/version" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section6641436115716" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "releaseType", + "M", + "Integer(32)", + "HarmonyOS测试发布方式(API>=10)。 默认值:6" + ], + [ + "testType", + "M", + "Integer(32)", + "测试类型。 取值范围: 3:HarmonyOS邀请测试。 4:HarmonyOS公开测试。" + ], + [ + "testDesc", + "M", + "String(50)", + "测试版本描述。 最长50个字符。" + ], + [ + "onshelfSelfDetect", + "O", + "Integer(32)", + "是否进行上架自检。 取值范围: 0:否。 1:是。 说明 选择“是”,将提交邀请测试并按照正式上架的审核要求自检,上架自检预计1天内完成。 选择“否”,将仅提交邀请测试审核,不进行正式上架自检。 上架自检不影响您邀请测试的上架结果。 一个应用有且仅支持存在一个上架自检中的任务,若存在上架自检中的任务时,再次创建邀请测试,该字段设置无效。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "versionId", + "O", + "String", + "测试版本ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section9752647125217" + } + ], + "title": "新建测试版本", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:54:58.085Z", + "family": "testing", + "endpoint": "test-api-add-test-version" +} diff --git a/pkg/domain/reference/testing/test-api-add-test-version.parameters.json b/pkg/domain/reference/testing/test-api-add-test-version.parameters.json new file mode 100644 index 0000000..08ff061 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-version.parameters.json @@ -0,0 +1,60 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "maxLength": 64 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section6641436115716" + }, + { + "name": "releaseType", + "in": "body", + "type": "integer", + "required": true, + "description": "HarmonyOS测试发布方式(API>=10)。 默认值:6", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213" + }, + { + "name": "testType", + "in": "body", + "type": "integer", + "required": true, + "description": "测试类型。 取值范围: 3:HarmonyOS邀请测试。 4:HarmonyOS公开测试。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "enum": [ + "3", + "4" + ] + }, + { + "name": "testDesc", + "in": "body", + "type": "string", + "required": true, + "description": "测试版本描述。 最长50个字符。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "maxLength": 50 + }, + { + "name": "onshelfSelfDetect", + "in": "body", + "type": "integer", + "required": false, + "description": "是否进行上架自检。 取值范围: 0:否。 1:是。 说明 选择“是”,将提交邀请测试并按照正式上架的审核要求自检,上架自检预计1天内完成。 选择“否”,将仅提交邀请测试审核,不进行正式上架自检。 上架自检不影响您邀请测试的上架结果。 一个应用有且仅支持存在一个上架自检中的任务,若存在上架自检中的任务时,再次创建邀请测试,该字段设置无效。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section141117691213", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference/testing/test-api-add-test-version.rules.json b/pkg/domain/reference/testing/test-api-add-test-version.rules.json new file mode 100644 index 0000000..7647135 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-add-test-version.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-add-test-version-0000002236041526#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-create-open-test-link.json b/pkg/domain/reference/testing/test-api-create-open-test-link.json new file mode 100644 index 0000000..df9dfb0 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-create-open-test-link.json @@ -0,0 +1,282 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section162251741185115", + "text": "请求示例\n POST /api/app-test/v1/test-group/public-link HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965\n{\n \"groupId\": \"string\",\n \"limit\": 1\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346", + "title": "删除测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666", + "title": "修改公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section6641436115716", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section16817111413112", + "text": "此接口用于创建群组级公开测试链接。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section16817111413112", + "text": "“公开链接”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APPID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/test-group/public-link" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "request", + "M", + "Object", + "请求对象。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section6641436115716" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "Integer", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section9752647125217" + } + ], + "title": "创建公开链接", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T05:04:13.887Z" +} diff --git a/pkg/domain/reference/testing/test-api-create-open-test-link.parameters.json b/pkg/domain/reference/testing/test-api-create-open-test-link.parameters.json new file mode 100644 index 0000000..bc3b405 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-create-open-test-link.parameters.json @@ -0,0 +1,11 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/testing/test-api-create-open-test-link.rules.json b/pkg/domain/reference/testing/test-api-create-open-test-link.rules.json new file mode 100644 index 0000000..25e3ff0 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-create-open-test-link.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-feedback.json b/pkg/domain/reference/testing/test-api-delete-feedback.json new file mode 100644 index 0000000..fc47f03 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-feedback.json @@ -0,0 +1,283 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section162251741185115", + "text": "请求示例\n DELETE /api/app-test/v1/mgmt/tester-feedback HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965\n{\n \"delFeedBackInfos\": [\n {\n \"problemId\": \"string\",\n \"testerId\": \"string\"\n }\n ],\n \"deleteMode\": 1\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "title": "deleteFeedbackRequest" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717", + "title": "查询测试问题反馈" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-0000002237336484", + "title": "数据模型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section6641436115716", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section16817111413112", + "text": "此接口用于删除测试问题反馈。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/mgmt/tester-feedback" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section15707195611112" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deleteFeedbackRequest", + "M", + "deleteFeedbackRequest", + "删除问题反馈请求。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section6641436115716" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "Integer", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-feedback-0000002634718668#section9752647125217" + } + ], + "title": "删除测试问题反馈", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:01.149Z", + "family": "testing", + "endpoint": "test-api-delete-feedback" +} diff --git a/pkg/domain/reference/testing/test-api-delete-feedback.parameters.json b/pkg/domain/reference/testing/test-api-delete-feedback.parameters.json new file mode 100644 index 0000000..1f7165c --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-feedback.parameters.json @@ -0,0 +1,43 @@ +[ + { + "name": "delFeedBackInfos", + "in": "body", + "type": "array", + "required": true, + "description": "待删除问题反馈信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "itemsType": "object", + "itemsProperties": [ + { + "name": "problemId", + "in": "body", + "type": "string", + "required": true, + "maxLength": 32, + "description": "问题ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324" + }, + { + "name": "testerId", + "in": "body", + "type": "string", + "required": true, + "maxLength": 32, + "description": "测试用户ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-delfeedbackinfos-0000002641014324" + } + ] + }, + { + "name": "deleteMode", + "in": "body", + "type": "integer", + "required": true, + "description": "删除模式,1-仅删除反馈,2-删除反馈+测试用户。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-deletefeedbackrequest-0000002671009673", + "enum": [ + "1", + "2" + ] + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-invite-code.json b/pkg/domain/reference/testing/test-api-delete-invite-code.json new file mode 100644 index 0000000..c55f41f --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-invite-code.json @@ -0,0 +1,295 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section162251741185115", + "text": "请求示例\n DELETE /api/app-test/v1invitation-code?invitationCodeId=inviaaaVIXKEF HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "title": "公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342", + "title": "生成邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669", + "title": "查询测试群组邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section16817111413112", + "text": "此接口用于邀请测试删除邀请码。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section16817111413112", + "text": "若您的应用已切换为“AppTest邀请测试”,无法使用该接口,您可以使用创建公开链接接口。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/invitation-code?invitationCodeId=invia****KEF" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9752647125217" + } + ], + "title": "删除邀请码", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:02.651Z", + "family": "testing", + "endpoint": "test-api-delete-invite-code" +} diff --git a/pkg/domain/reference/testing/test-api-delete-invite-code.parameters.json b/pkg/domain/reference/testing/test-api-delete-invite-code.parameters.json new file mode 100644 index 0000000..287b414 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-invite-code.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188" + }, + { + "name": "invitationCodeId", + "in": "query", + "type": "string", + "required": true, + "description": "待删除的邀请码ID;参数表缺漏,Query位置由官方请求示例确认。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section162251741185115" + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-invite-code.rules.json b/pkg/domain/reference/testing/test-api-delete-invite-code.rules.json new file mode 100644 index 0000000..cf1dff8 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-invite-code.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-invite-code-0000002634878570#section9736184114188", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-test-group-user.json b/pkg/domain/reference/testing/test-api-delete-test-group-user.json new file mode 100644 index 0000000..7218838 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-group-user.json @@ -0,0 +1,264 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section162251741185115", + "text": "请求示例\nDELETE /api/publish/v2/test/user HTTP/1.1 \nHost: connect-api.cloud.huawei.com \nclient_id: 4141******68 \nContent-Type: application/json \nAuthorization: Bearer ******* \nappId: 6917********65\n{\n \"deleteTesterIds\": [\n \"41*****45\"\n ],\n \"groupId\": \"76********08\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section14178457143617", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538", + "title": "发送邀请测试通知" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section158318511129", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section16817111413112", + "text": "此接口用于邀请测试删除测试群组中的成员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/user" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "deleteTesterIds", + "M", + "List", + "需要删除的测试成员的ID列表。 数组长度不超过100。" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section158318511129" + } + ], + "title": "删除测试群组成员", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:23.289Z", + "family": "testing", + "endpoint": "test-api-delete-test-group-user" +} diff --git a/pkg/domain/reference/testing/test-api-delete-test-group-user.parameters.json b/pkg/domain/reference/testing/test-api-delete-test-group-user.parameters.json new file mode 100644 index 0000000..e054059 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-group-user.parameters.json @@ -0,0 +1,31 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section236517415165", + "maxLength": 32 + }, + { + "name": "deleteTesterIds", + "in": "body", + "type": "array", + "required": true, + "description": "需要删除的测试成员的ID列表。 数组长度不超过100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section141117691213", + "itemsType": "string", + "itemsMaxLength": 100, + "maxItems": 100 + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-user-0000002271000721#section141117691213", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-test-group.json b/pkg/domain/reference/testing/test-api-delete-test-group.json new file mode 100644 index 0000000..a4e0e85 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-group.json @@ -0,0 +1,314 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section162251741185115", + "text": "请求示例\n DELETE /api/app-test/v1/publish-api/test-group?groupId=761e********08 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer *******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717", + "title": "查询测试群组列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664", + "title": "修改测试群组" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section141117691213", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section16817111413112", + "text": "此接口用于邀请测试删除测试群组。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/publish-api/test-group" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "返回码描述信息。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section9752647125217" + } + ], + "title": "删除测试群组", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:22.144Z", + "family": "testing", + "endpoint": "test-api-delete-test-group" +} diff --git a/pkg/domain/reference/testing/test-api-delete-test-group.parameters.json b/pkg/domain/reference/testing/test-api-delete-test-group.parameters.json new file mode 100644 index 0000000..2ce2fda --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-group.parameters.json @@ -0,0 +1,28 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013" + }, + { + "name": "groupId", + "in": "query", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section141117691213", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-test-group.rules.json b/pkg/domain/reference/testing/test-api-delete-test-group.rules.json new file mode 100644 index 0000000..8856e7a --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-group.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-group-0000002236041534#section8258621134013", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-test-version.json b/pkg/domain/reference/testing/test-api-delete-test-version.json new file mode 100644 index 0000000..3400b9e --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-version.json @@ -0,0 +1,277 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section162251741185115", + "text": "请求示例\n DELETE /api/publish/v2/test/app/version?versionId=142******36&appId=5765********59 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer *******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section45981511195316", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542", + "title": "停止测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "title": "创建公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section16817111413112", + "text": "此接口用于删除测试版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS DELETE" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/app/version" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String", + "测试版本ID。" + ], + [ + "appId", + "M", + "String", + "应用ID" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section6641436115716" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section9752647125217" + } + ], + "title": "删除测试版本", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:55:24.555Z", + "family": "testing", + "endpoint": "test-api-delete-test-version" +} diff --git a/pkg/domain/reference/testing/test-api-delete-test-version.parameters.json b/pkg/domain/reference/testing/test-api-delete-test-version.parameters.json new file mode 100644 index 0000000..62e02c5 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-version.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "maxLength": 64 + }, + { + "name": "versionId", + "in": "query", + "type": "string", + "required": true, + "description": "测试版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section6641436115716" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section6641436115716" + } +] diff --git a/pkg/domain/reference/testing/test-api-delete-test-version.rules.json b/pkg/domain/reference/testing/test-api-delete-test-version.rules.json new file mode 100644 index 0000000..9554eea --- /dev/null +++ b/pkg/domain/reference/testing/test-api-delete-test-version.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-delete-test-version-0000002236201346#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-edit-open-test-link.json b/pkg/domain/reference/testing/test-api-edit-open-test-link.json new file mode 100644 index 0000000..f9de833 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-edit-open-test-link.json @@ -0,0 +1,296 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section162251741185115", + "text": "请求示例\n PUT /api/v1/test-group/public-link HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965\n{\n \"groupId\": \"string\",\n \"limit\": 1,\n \"status\": 1\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "title": "创建公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775", + "title": "查询公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section16817111413112", + "text": "此接口用于编辑群组级公开测试链接。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section16817111413112", + "text": "“公开链接”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APPID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/test-group/public-link" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String", + "群组ID。" + ], + [ + "limit", + "O", + "Integer", + "允许通过此公开链接加入群的数量限制,传null表示不限制。" + ], + [ + "status", + "M", + "Integer", + "链接状态。 取值范围: 1:生效 2:失效" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "Integer", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section9752647125217" + } + ], + "title": "修改公开链接", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:25.938Z", + "family": "testing", + "endpoint": "test-api-edit-open-test-link" +} diff --git a/pkg/domain/reference/testing/test-api-edit-open-test-link.parameters.json b/pkg/domain/reference/testing/test-api-edit-open-test-link.parameters.json new file mode 100644 index 0000000..d3f3147 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-edit-open-test-link.parameters.json @@ -0,0 +1,39 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "maxLength": 64 + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": true, + "description": "群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716" + }, + { + "name": "limit", + "in": "body", + "type": "integer", + "required": false, + "description": "允许通过此公开链接加入群的数量限制,传null表示不限制。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716" + }, + { + "name": "status", + "in": "body", + "type": "integer", + "required": true, + "description": "链接状态。 取值范围: 1:生效 2:失效", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section6641436115716", + "enum": [ + "1", + "2" + ] + } +] diff --git a/pkg/domain/reference/testing/test-api-edit-open-test-link.rules.json b/pkg/domain/reference/testing/test-api-edit-open-test-link.rules.json new file mode 100644 index 0000000..1e47444 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-edit-open-test-link.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-open-test-link-0000002634718666#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-edit-test-group.json b/pkg/domain/reference/testing/test-api-edit-test-group.json new file mode 100644 index 0000000..272ccd0 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-edit-test-group.json @@ -0,0 +1,320 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section162251741185115", + "text": "请求示例\n PUT /api/app-test/v2/test-group HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965\n{\n \"groupId\": \"string\",\n \"groupName\": \"string\"\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534", + "title": "删除测试群组" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773", + "title": "查询测试群组成员" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section16817111413112", + "text": "此接口用于邀请测试修改测试群组。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APPID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v2/test-group" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ], + [ + "groupName", + "M", + "String(50)", + "群组名称。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section9752647125217" + } + ], + "title": "修改测试群组", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:27.137Z", + "family": "testing", + "endpoint": "test-api-edit-test-group" +} diff --git a/pkg/domain/reference/testing/test-api-edit-test-group.parameters.json b/pkg/domain/reference/testing/test-api-edit-test-group.parameters.json new file mode 100644 index 0000000..4171344 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-edit-test-group.parameters.json @@ -0,0 +1,37 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114" + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section141117691213", + "maxLength": 32 + }, + { + "name": "groupName", + "in": "body", + "type": "string", + "required": true, + "description": "群组名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section141117691213", + "maxLength": 50 + } +] diff --git a/pkg/domain/reference/testing/test-api-edit-test-group.rules.json b/pkg/domain/reference/testing/test-api-edit-test-group.rules.json new file mode 100644 index 0000000..195726d --- /dev/null +++ b/pkg/domain/reference/testing/test-api-edit-test-group.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-edit-test-group-0000002634718664#section2081954113114", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-get-detect-task.json b/pkg/domain/reference/testing/test-api-get-detect-task.json new file mode 100644 index 0000000..cbac1e8 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-detect-task.json @@ -0,0 +1,263 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section162251741185115", + "text": "请求示例\n GET /api/publish/v2/test/app/version/detect-report?appId=6917********65&versionId=76********08 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer *******" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section45981511195316", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"state\": 3,\n \"reportUrl\": \"https://****\"\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526#section9752647125217", + "title": "新建测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-version-0000002236041526", + "title": "新建测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330", + "title": "添加软件包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section119494174419", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section141117691213", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-detect-task-0000002525033189#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section16817111413112", + "text": "此接口用于查询邀请测试进行上架自检的报告信息。如果自检未通过,可以从返回参数reportUrl中获取自检报告。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section119494174419", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section119494174419", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section119494174419", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/app/version/detect-report" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section119494174419" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section119494174419" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ], + [ + "versionId", + "M", + "String(32)", + "测试版本ID。 可从新建测试版本接口返回的versionId参数中获取。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "state", + "M", + "Integer", + "邀请测试进行上架前自检的任务状态。 取值范围: -1:自检任务已失效 0:自检任务待处理 1:自检任务处理中 2:自检已通过 3:自检未通过" + ], + [ + "reportUrl", + "O", + "String", + "自检报告链接。 说明 仅当state为3(自检未通过)时,返回该参数。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section9752647125217" + } + ], + "title": "查询上架自检报告信息", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:55:28.305Z", + "family": "testing", + "endpoint": "test-api-get-detect-task" +} diff --git a/pkg/domain/reference/testing/test-api-get-detect-task.parameters.json b/pkg/domain/reference/testing/test-api-get-detect-task.parameters.json new file mode 100644 index 0000000..e9abd4b --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-detect-task.parameters.json @@ -0,0 +1,20 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section141117691213", + "maxLength": 32 + }, + { + "name": "versionId", + "in": "query", + "type": "string", + "required": true, + "description": "测试版本ID。 可从新建测试版本接口返回的versionId参数中获取。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-detect-task-0000002525033189#section141117691213", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/testing/test-api-get-invite-code.json b/pkg/domain/reference/testing/test-api-get-invite-code.json new file mode 100644 index 0000000..18a5018 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-invite-code.json @@ -0,0 +1,328 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section162251741185115", + "text": "请求示例\n GET /api/app-test/v1/test-group/invitation-code?groupId=76********08 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId: 6917********65" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"invitationCodes\": [\n {\n \"id\": \"9800********7c\",\n \"invitationCode\": \"4n********nx\",\n \"startTime\": 1715*****000,\n \"endTime\": 1715*****000,\n \"status\": 2,\n \"invitedNum\": 0,\n \"waitInviteNum\": 100\n },\n {\n \"id\": \"9019********dd\",\n \"invitationCode\": \"1y******wl\",\n \"startTime\": 1715****000,\n \"endTime\": 1715****000,\n \"status\": 2,\n \"invitedNum\": 0,\n \"waitInviteNum\": 100\n },\n {\n \"id\": \"28de********5a\",\n \"invitationCode\": \"1P****On\",\n \"startTime\": 1715****000,\n \"endTime\": 1715****000,\n \"status\": 2,\n \"invitedNum\": 0,\n \"waitInviteNum\": 100\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "title": "公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-invitationcodeinfo-0000002237496324", + "title": "InvitationCodeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-invite-code-0000002634878570", + "title": "删除邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725", + "title": "停止邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section141117691213", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16817111413112", + "text": "此接口用于邀请测试查询测试群组邀请码信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16817111413112", + "text": "若您的应用已切换为“AppTest邀请测试”,无法使用该接口,您可以使用创建公开链接接口。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/test-group/invitation-code" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3: 并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "返回码描述信息。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码。" + ], + [ + "invitationCodes", + "O", + "InvitationCodeInfo", + "邀请码信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section9752647125217" + } + ], + "title": "查询测试群组邀请码", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:29.470Z", + "family": "testing", + "endpoint": "test-api-get-invite-code" +} diff --git a/pkg/domain/reference/testing/test-api-get-invite-code.parameters.json b/pkg/domain/reference/testing/test-api-get-invite-code.parameters.json new file mode 100644 index 0000000..4852ae7 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-invite-code.parameters.json @@ -0,0 +1,28 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428" + }, + { + "name": "groupId", + "in": "query", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section141117691213", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/testing/test-api-get-invite-code.rules.json b/pkg/domain/reference/testing/test-api-get-invite-code.rules.json new file mode 100644 index 0000000..737a20c --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-invite-code.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-invite-code-0000002271160669#section16187395428", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-get-test-grouplist.json b/pkg/domain/reference/testing/test-api-get-test-grouplist.json new file mode 100644 index 0000000..9f98443 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-test-grouplist.json @@ -0,0 +1,346 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section162251741185115", + "text": "请求示例\n GET /api/app-test/v1/test-group/list?groupType=1¤t=1&pageSize=10 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId: 6917********65" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\" : 0,\n \"groups\" : [{\n \"groupId\" : \"761e********08\",\n \"groupName\" : \"测试群组demo\",\n \"addedTestersNum\" : 0,\n \"groupType\" : 0 \n }\n ],\n \"allAddedTestersNum\" : 0,\n \"pageInfo\" : {\n \"current\" : 1,\n \"pageSize\" : 10,\n \"totalRecord\" : 1,\n \"totalPage\" : 1\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-simplegroupinfo-0000002237336496", + "title": "SimpleGroupInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-pageinfo-0000002272455653", + "title": "PageInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661", + "title": "新增测试群组" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-0000002236041534", + "title": "删除测试群组" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-test-grouplist-0000002271000717#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section16817111413112", + "text": "此接口用于邀请测试查询已创建的内外部测试群组列表。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/test-group/list" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupType", + "O", + "Integer", + "群组类别。 取值范围: 0: 外部群组(默认)。 1: 内部群组。" + ], + [ + "current", + "O", + "Integer", + "当前页。 默认值:1" + ], + [ + "pageSize", + "O", + "Integer", + "每页数。 默认值:10" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "返回码描述信息。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码。" + ], + [ + "groups", + "O", + "SimpleGroupInfo", + "简要测试群组信息。" + ], + [ + "pageInfo", + "O", + "PageInfo", + "分页信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section9752647125217" + } + ], + "title": "查询测试群组列表", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:30.803Z", + "family": "testing", + "endpoint": "test-api-get-test-grouplist" +} diff --git a/pkg/domain/reference/testing/test-api-get-test-grouplist.parameters.json b/pkg/domain/reference/testing/test-api-get-test-grouplist.parameters.json new file mode 100644 index 0000000..7a9cfa5 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-test-grouplist.parameters.json @@ -0,0 +1,47 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351" + }, + { + "name": "groupType", + "in": "query", + "type": "integer", + "required": false, + "description": "群组类别。 取值范围: 0: 外部群组(默认)。 1: 内部群组。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213", + "enum": [ + "0", + "1" + ] + }, + { + "name": "current", + "in": "query", + "type": "integer", + "required": false, + "description": "当前页。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213" + }, + { + "name": "pageSize", + "in": "query", + "type": "integer", + "required": false, + "description": "每页数。 默认值:10", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section141117691213" + } +] diff --git a/pkg/domain/reference/testing/test-api-get-test-grouplist.rules.json b/pkg/domain/reference/testing/test-api-get-test-grouplist.rules.json new file mode 100644 index 0000000..ccddf5a --- /dev/null +++ b/pkg/domain/reference/testing/test-api-get-test-grouplist.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-get-test-grouplist-0000002271000717#section523365814351", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-modify-test-version.json b/pkg/domain/reference/testing/test-api-modify-test-version.json new file mode 100644 index 0000000..121e192 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-modify-test-version.json @@ -0,0 +1,702 @@ +{ + "examples": [ + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section45981511195316", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713", + "title": "更新测试生效版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530", + "title": "更新有效期内的测试版本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-compile-status-0000002236041434", + "title": "查询软件包编译状态接口" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "title": "AppLanguage" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488", + "title": "DeviceTypeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-appendix-countrycode-0000002236201362", + "title": "国家码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "title": "VersionExtInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "title": "OpenTestInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "title": "PackagePermissionIntroVideo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "title": "VersionVocReq" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-post-app-version-voc-0000002495233986", + "title": "查询应用未处理的问题工单" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-package-0000002236201330", + "title": "添加软件包" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713", + "title": "更新测试生效版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "text": "此接口用于更新已创建的测试版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "text": "在架的测试版本不允许调用此接口。 如果需要修改生效版本,请参考更新测试生效版本。 如果需要修改测试版本时间和额度信息,请参考更新有效期内的测试版本信息。 如果需要改其他参数,请新建一个测试版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "text": "如果需要修改生效版本,请参考更新测试生效版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "text": "如果需要修改测试版本时间和额度信息,请参考更新有效期内的测试版本信息。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "text": "如果需要改其他参数,请新建一个测试版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "text": "针对设备类型为“智能表”目前为受限开放,若您想要体验使用,可以通过在线工单系统与我们联系,工单 “问题分类”请选择 “上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称,开发者ID、应用名称、APP ID。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "请求Body中使用JSON格式携带需要更新的测试版本信息,参数如下表所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "测试信息默认继承全网版本信息或最近一个测试版本填写的信息。如需调整,请在当前测试版本提交前重新审视并修改,测试信息配置不影响全网版本的应用信息。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "PUT /api/publish/v2/test/app/version?appId=6917********65 HTTP/1.1" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "Host: connect-api.cloud.huawei.com" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "client_id: 4141******68" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "Content-Type: application/json" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "Authorization: Bearer *******" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "{" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"versionId\": \"1425*********60\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"pkgId\": \"1426********56\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"languages\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"language\": \"zh-CN\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"appName\": \"应用名称demo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"appDesc\": \"应用介绍demo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"briefInfo\": \"应用简介demo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"newFeatures\": \"测试说明demo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"deviceMaterials\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"deviceType\" : 4," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"showType\" : 1," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"appIcon\" : \"CN/2024072501/**************************d505c9.png\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"screenShots\" : [\"CN/2024072502/**************************77ff8e.png\", \"CN/2024072502/**************************de7e9a.png\", \"CN/2024072502/**************************acaaea.png\"]" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "}," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"deviceType\" : 5," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"appIcon\" : \"CN/2024072501/**************************37fd1b.png\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"screenShots\" : [\"CN/2024072502/**************************32d622.png\", \"CN/2024072502/**************************5d3050.png\", \"CN/2024072502/**************************d6eedc.png\", \"CN/2024072502/**************************a9a829.png\"]" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"deviceType\" : 12," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"appIcon\" : \"CN/2024072501/**************************1a8716.png\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"screenShots\" : [\"CN/2024072502/**************************949260.png\", \"CN/2024072502/**************************e71f72.png\", \"CN/2024072502/**************************572790.png\", \"CN/2024072502/**************************5c904e.png\", \"CN/2024072502/**************************6b7bff.png\"]," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"promoGraphics\" : [\"CN/2024072502/**************************f48560.png\", \"CN/2024072502/**************************fc084b.png\", \"CN/2024072502/**************************a3d4a5.PNG\"]" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "}" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "]" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "]," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"deviceTypes\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"deviceType\": 4," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"appAdapters\": \"\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"distCountryList\": \"CN\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"extInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"privacyPolicy\": \"http://**********\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"privacyRightsUrl\": \"http://*********\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"openTestInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"startTime\": 1716*****000," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"endTime\": 1717*****000," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"testDesc\": \"版本描述demo\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"testTaskInfo\": {" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"groupInfos\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"groupId\": \"761e*****************008\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"groupName\": \"string\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"addedTesterNum\": 0," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"bind\": 0" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"needShareLink\": 0," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"displayArea\": \"1\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"needNotify\": 0" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"packagePermissionIntroVideoList\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"lang\": \"zh-CN\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"permissionName\": \"*****\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"objectId\": \"CN/2024052102/********.app\"" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"versionVocReq\": [" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"versionId\": \"10*****528\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"packageId\": \"1573*******5952\"," + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "text": "\"vocId\": \"18******24\"" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/app/version" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section6641436115716" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "需要更新的测试版本ID。" + ], + [ + "pkgId", + "O", + "String(32)", + "需要上传的软件包ID。 说明 请确保上传的软件包是正常状态,即确认查询软件包编译状态接口中的响应参数successStatus为0。" + ], + [ + "languages", + "O", + "List", + "版本多语言本地化信息。 数组长度不超过100。" + ], + [ + "deviceTypes", + "O", + "List", + "版本的设备类型信息。 数组长度不超过6。" + ], + [ + "distCountryList", + "O", + "String(1024)", + "版本发布国家的国家码。 多个国家以英文逗号分隔,例如:“CN,DE,MC”。 如果取值为“OTHER”,则表示当AppGallery支持的国家或地区列表中新增某个国家或地区时,版本将自动分发到新增的国家和地区。国家码列表请参见国家码。 注意 取值不能只包含OTHER。仅公开测试支持填写此字段。" + ], + [ + "extInfo", + "O", + "VersionExtInfo", + "版本扩展信息。" + ], + [ + "openTestInfo", + "O", + "OpenTestInfo", + "测试版本信息,包含测试版本开始时间和结束时间。" + ], + [ + "packagePermissionIntroVideoList", + "O", + "List", + "软件包权限使用场景说明视频。 数组长度不超过100。" + ], + [ + "versionVocReq", + "O", + "List", + "应用版本已解决问题。 数组长度不超过1000。 仅公开测试支持填写此字段。 说明 调用查询应用未处理的问题工单接口可以查询用户反馈的应用问题。如果在应用版本更新时某些问题已经解决,可以将这些问题提交审核,工单平台验证通过后会关闭工单。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section9752647125217" + } + ], + "title": "更新测试版本", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:32.017Z", + "family": "testing", + "endpoint": "test-api-modify-test-version" +} diff --git a/pkg/domain/reference/testing/test-api-modify-test-version.parameters.json b/pkg/domain/reference/testing/test-api-modify-test-version.parameters.json new file mode 100644 index 0000000..f6fc94d --- /dev/null +++ b/pkg/domain/reference/testing/test-api-modify-test-version.parameters.json @@ -0,0 +1,653 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "maxLength": 64 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section6641436115716" + }, + { + "name": "versionId", + "in": "body", + "type": "string", + "required": true, + "description": "需要更新的测试版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxLength": 32 + }, + { + "name": "pkgId", + "in": "body", + "type": "string", + "required": false, + "description": "需要上传的软件包ID。 说明 请确保上传的软件包是正常状态,即确认查询软件包编译状态接口中的响应参数successStatus为0。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxLength": 32 + }, + { + "name": "languages", + "in": "body", + "type": "array", + "required": false, + "description": "版本多语言本地化信息。 数组长度不超过100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "itemsType": "object", + "maxItems": 100, + "itemsProperties": [ + { + "name": "language", + "in": "body", + "type": "string", + "required": true, + "description": "应用支持的语言。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 20 + }, + { + "name": "appName", + "in": "body", + "type": "string", + "required": false, + "description": "应用名称。 不少于2个字符,否则应用信息不完整。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 255, + "minLength": 2 + }, + { + "name": "appDesc", + "in": "body", + "type": "string", + "required": true, + "description": "对应语言的应用介绍。 不少于2个字符,否则应用信息不完整。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 8000, + "minLength": 2 + }, + { + "name": "briefInfo", + "in": "body", + "type": "string", + "required": false, + "description": "应用简介,用于新增应用一句话介绍。 不少于1个字符,否则应用信息不完整。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 256, + "minLength": 1 + }, + { + "name": "newFeatures", + "in": "body", + "type": "string", + "required": true, + "description": "测试说明,描述测试版本的重点特性。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 1024 + }, + { + "name": "formalVersionNewFeatures", + "in": "body", + "type": "string", + "required": false, + "description": "描述正式版本的重点特性。 当为测试版本时,该字段表示后续转成正式版本的新版本特性描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "maxLength": 1024 + }, + { + "name": "deviceMaterials", + "in": "body", + "type": "array", + "required": false, + "description": "设备类型相关的素材。 数组长度不超过6。 说明 素材的格式请参考素材规范。 注意 接口不校验素材的格式(尺寸、分辨率、文件后缀等),请开发者自行保证素材格式的准确性,以免影响素材最终的呈现效果。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-applanguage-0000002237496312", + "itemsType": "object", + "maxItems": 6, + "itemsProperties": [ + { + "name": "deviceType", + "in": "body", + "type": "integer", + "required": true, + "description": "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "enum": [ + "4", + "5", + "12", + "14" + ] + }, + { + "name": "appIcon", + "in": "body", + "type": "string", + "required": false, + "description": "应用图标下载地址。 不少于1个字符,否则应用信息不完整。 注意 作为输入参数是相对地址,作为查询结果是完整地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "maxLength": 300, + "minLength": 1 + }, + { + "name": "screenShots", + "in": "body", + "type": "array", + "required": false, + "description": "应用截屏地址。 不少于1个字符,否则应用信息不完整。 多个地址以英文逗号隔开,最多不超过10个地址,最少不少于3个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "itemsType": "string", + "itemsMaxLength": 300, + "maxItems": 10, + "minItems": 3 + }, + { + "name": "showType", + "in": "body", + "type": "integer", + "required": false, + "description": "截图展现方式。 取值范围: 0:竖屏 1:横屏", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "enum": [ + "0", + "1" + ] + }, + { + "name": "promoGraphics", + "in": "body", + "type": "array", + "required": false, + "description": "宣传图片地址。 多个地址以英文逗号隔开,最多不超过10个地址。 注意 作为输入参数是相对地址,作为查询结果是完整地址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicematerial-0000002237336492", + "itemsType": "string", + "itemsMaxLength": 300, + "maxItems": 10 + } + ] + } + ] + }, + { + "name": "deviceTypes", + "in": "body", + "type": "array", + "required": false, + "description": "版本的设备类型信息。 数组长度不超过6。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "itemsType": "object", + "maxItems": 6, + "itemsProperties": [ + { + "name": "deviceType", + "in": "body", + "type": "integer", + "required": true, + "description": "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表 说明 其他设备类型暂未开放。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488", + "enum": [ + "4", + "5", + "12", + "14" + ] + }, + { + "name": "appAdapters", + "in": "body", + "type": "string", + "required": false, + "description": "适配设备类型。 5:平板 说明 当deviceType为4(手机)时,系统会默认兼容分发到平板设备,即给appAdapters赋值5。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-devicetypeinfo-0000002237336488" + } + ] + }, + { + "name": "distCountryList", + "in": "body", + "type": "string", + "required": false, + "description": "版本发布国家的国家码。 多个国家以英文逗号分隔,例如:“CN,DE,MC”。 如果取值为“OTHER”,则表示当AppGallery支持的国家或地区列表中新增某个国家或地区时,版本将自动分发到新增的国家和地区。国家码列表请参见国家码。 注意 取值不能只包含OTHER。仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "maxLength": 1024 + }, + { + "name": "extInfo", + "in": "body", + "type": "object", + "required": false, + "description": "版本扩展信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "properties": [ + { + "name": "testUserName", + "in": "body", + "type": "string", + "required": false, + "description": "应用审核信息的测试账号。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 128 + }, + { + "name": "testUserPassword", + "in": "body", + "type": "string", + "required": false, + "description": "应用审核信息的测试用户密码。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 128 + }, + { + "name": "appRemark", + "in": "body", + "type": "string", + "required": false, + "description": "应用审核信息的备注。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 300 + }, + { + "name": "isSignedCommitment", + "in": "body", + "type": "integer", + "required": false, + "description": "是否签署合规承诺函。 取值范围: 空:未签署 1:已签署 说明 目前只有元服务涉及签署。 默认值:空 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "1" + ] + }, + { + "name": "registeredIdType", + "in": "body", + "type": "integer", + "required": false, + "description": "备案证件类型。 取值范围: -1:清空数据,同时也会清空registeredIdNumber的内容。 1:面向企业,备案证件为社会信用。 2:面向个人,备案证件为身份证。 3:面向机构,备案证件为机构代码。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "-1", + "1", + "2", + "3" + ] + }, + { + "name": "registeredIdNumber", + "in": "body", + "type": "string", + "required": false, + "description": "备案证件号码。 取值范围: registeredIdType为1时,对应社会信用代码。 registeredIdType为2时,对应身份证号码。 registeredIdType为3时,对应机构代码。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 64 + }, + { + "name": "privacyAgreementId", + "in": "body", + "type": "string", + "required": false, + "description": "隐私协议ID。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 32 + }, + { + "name": "userAgreementUrl", + "in": "body", + "type": "string", + "required": false, + "description": "用户协议URL。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 512 + }, + { + "name": "userAgreementIds", + "in": "body", + "type": "array", + "required": false, + "description": "用户协议ID列表。 当userAgreementUrl和userAgreementIds同时传值时,以userAgreementIds值为准。 数组长度不超过5。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "itemsType": "string", + "itemsMaxLength": 32, + "maxItems": 5 + }, + { + "name": "privacyPolicy", + "in": "body", + "type": "string", + "required": false, + "description": "隐私政策网址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 512 + }, + { + "name": "privacyRightsUrl", + "in": "body", + "type": "string", + "required": false, + "description": "隐私权利网址。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 256 + }, + { + "name": "encrypted", + "in": "body", + "type": "integer", + "required": false, + "description": "包是否加密。 取值范围: 0:否,表示不加密。 1:是,表示加密。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "0", + "1" + ] + }, + { + "name": "isAiGenerate", + "in": "body", + "type": "integer", + "required": false, + "description": "是否涉及AI生成合成服务。 取值范围: 0:不涉及。 1:涉及。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "enum": [ + "0", + "1" + ] + }, + { + "name": "aiTypes", + "in": "body", + "type": "array", + "required": false, + "description": "涉及的AI生成合成服务类型。 注意 仅公开测试支持填写此字段。 取值范围: -1:其他 1:文本 2:图片 3:音频 4:视频 5:虚拟场景 说明 isAiGenerate取值为1(涉及)时,此参数必填。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "itemsType": "integer", + "itemsEnum": [ + "-1", + "1", + "2", + "3", + "4", + "5" + ] + }, + { + "name": "appReviewPhoneInfo", + "in": "body", + "type": "object", + "required": false, + "description": "应用负责人的手机号信息。用于沟通审核问题。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "properties": [ + { + "name": "account", + "in": "body", + "type": "string", + "required": false, + "description": "应用负责人的手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "maxLength": 500 + } + ] + }, + { + "name": "appReviewEmailInfo", + "in": "body", + "type": "object", + "required": false, + "description": "应用负责人的邮箱账号信息。用于接收上架审核结果,应用整改或下架通知。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "properties": [ + { + "name": "account", + "in": "body", + "type": "string", + "required": false, + "description": "应用负责人的手机号码或者邮箱账号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-appreviewcontact-0000002527365043", + "maxLength": 500 + } + ] + }, + { + "name": "appReviewName", + "in": "body", + "type": "string", + "required": false, + "description": "应用负责人的姓名。 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "maxLength": 256 + } + ] + }, + { + "name": "openTestInfo", + "in": "body", + "type": "object", + "required": false, + "description": "测试版本信息,包含测试版本开始时间和结束时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "properties": [ + { + "name": "startTime", + "in": "body", + "type": "integer", + "required": true, + "description": "测试版本开始时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553" + }, + { + "name": "endTime", + "in": "body", + "type": "integer", + "required": true, + "description": "测试版本结束时间。 时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553" + }, + { + "name": "testDesc", + "in": "body", + "type": "string", + "required": false, + "description": "测试版本描述。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "maxLength": 50 + }, + { + "name": "testTaskInfo", + "in": "body", + "type": "object", + "required": false, + "description": "测试发布信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-opentestinfo-0000002272575553", + "properties": [ + { + "name": "groupInfos", + "in": "body", + "type": "array", + "required": true, + "description": "测试用户信息。 注意 公开测试不支持修改。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "itemsType": "object", + "itemsProperties": [ + { + "name": "groupId", + "in": "body", + "type": "string", + "required": false, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "maxLength": 32 + }, + { + "name": "groupName", + "in": "body", + "type": "string", + "required": false, + "description": "测试群组名称。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "maxLength": 50 + }, + { + "name": "addedTesterNum", + "in": "body", + "type": "integer", + "required": false, + "description": "已添加测试群组成员的数量。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557" + }, + { + "name": "bind", + "in": "body", + "type": "integer", + "required": false, + "description": "是否绑定该测试群组。 取值范围: 1:已绑定 0:未绑定", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-groupinfo-0000002272575557", + "enum": [ + "0", + "1" + ] + } + ] + }, + { + "name": "needShareLink", + "in": "body", + "type": "integer", + "required": false, + "description": "是否需要生成分享链接。 取值范围: 0:不需要。 1:需要。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "enum": [ + "0", + "1" + ] + }, + { + "name": "publicTestInstallLimit", + "in": "body", + "type": "integer", + "required": false, + "description": "公开测试安装次数上限。 默认值:10万次 注意 仅公开测试支持填写此字段。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649" + }, + { + "name": "displayArea", + "in": "body", + "type": "string", + "required": false, + "description": "展示区域。 取值范围: 1:AppGallery客户端测试专区 说明 邀请测试该字段必填。 公开测试该字段选填。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "maxLength": 32 + }, + { + "name": "needNotify", + "in": "body", + "type": "integer", + "required": false, + "description": "是否向用户发送测试通知。 取值范围: 0:不需要 1:需要 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-testtaskinfo-0000002272455649", + "enum": [ + "0", + "1" + ] + } + ] + } + ] + }, + { + "name": "packagePermissionIntroVideoList", + "in": "body", + "type": "array", + "required": false, + "description": "软件包权限使用场景说明视频。 数组长度不超过100。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "itemsType": "object", + "maxItems": 100, + "itemsProperties": [ + { + "name": "lang", + "in": "body", + "type": "string", + "required": true, + "description": "语言种类。 说明 取值请参见语言类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "maxLength": 8 + }, + { + "name": "permissionName", + "in": "body", + "type": "string", + "required": true, + "description": "权限标记字符串。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "maxLength": 512 + }, + { + "name": "deviceType", + "in": "body", + "type": "integer", + "required": true, + "description": "设备类型。 取值范围: 4:手机 5:平板 12:智能手表 14:运动手表", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "enum": [ + "4", + "5", + "12", + "14" + ] + }, + { + "name": "objectId", + "in": "body", + "type": "string", + "required": true, + "description": "文件在OBS上的objectId。 说明 objectId的获取流程:先调用获取上传文件地址接口,然后调用上传文件接口上传文件,最后得到获取上传文件地址接口返回的objectId。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-packagepermissionintrovideo-0000002237496316", + "maxLength": 512 + } + ] + }, + { + "name": "versionVocReq", + "in": "body", + "type": "array", + "required": false, + "description": "应用版本已解决问题。 数组长度不超过1000。 仅公开测试支持填写此字段。 说明 调用查询应用未处理的问题工单接口可以查询用户反馈的应用问题。如果在应用版本更新时某些问题已经解决,可以将这些问题提交审核,工单平台验证通过后会关闭工单。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section141117691213", + "itemsType": "object", + "maxItems": 1000, + "itemsProperties": [ + { + "name": "versionId", + "in": "body", + "type": "string", + "required": true, + "description": "版本号。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "maxLength": 32 + }, + { + "name": "packageId", + "in": "body", + "type": "string", + "required": true, + "description": "软件包ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "maxLength": 32 + }, + { + "name": "vocId", + "in": "body", + "type": "string", + "required": true, + "description": "问题工单ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-versionvocreq-0000002527368597", + "maxLength": 32 + } + ] + } +] diff --git a/pkg/domain/reference/testing/test-api-modify-test-version.rules.json b/pkg/domain/reference/testing/test-api-modify-test-version.rules.json new file mode 100644 index 0000000..800ea60 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-modify-test-version.rules.json @@ -0,0 +1,25 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-modify-test-version-0000002271160657#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + }, + { + "id": "testing-ai-types", + "kind": "required_if", + "field": "body.extInfo.aiTypes", + "when": { + "field": "body.extInfo.isAiGenerate", + "equals": "1" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-versionextinfo-0000002272455645", + "message": "AI-generated services require aiTypes.", + "suggestion": "Supply the documented AI service types in extInfo.aiTypes." + } +] diff --git a/pkg/domain/reference/testing/test-api-post-test-notify.json b/pkg/domain/reference/testing/test-api-post-test-notify.json new file mode 100644 index 0000000..d42808e --- /dev/null +++ b/pkg/domain/reference/testing/test-api-post-test-notify.json @@ -0,0 +1,268 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section162251741185115", + "text": "请求示例\nPOST /api/publish/v2/test/user/action/notify HTTP/1.1 \nHost: connect-api.cloud.huawei.com \nclient_id: 4141******68 \nContent-Type: application/json \nAuthorization: Bearer ******* \nappId: 6917********65\n{\n \"groupId\": \"76********08\",\n \"testerIds\": [\n \"41*****45\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section14178457143617", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-group-user-0000002271000721", + "title": "删除测试群组成员" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-invite-code-0000002236201342", + "title": "生成邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section158318511129", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-post-test-notify-0000002236041538#section14178457143617", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section16817111413112", + "text": "此接口用于给内外部群组的测试用户发送邀请测试的通知。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section236517415165", + "text": "本接口支持使用Service Account方式和API客户端方式,二者区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section236517415165", + "text": "API客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v1/test/user/action/notify" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section236517415165" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ], + [ + "testerIds", + "M", + "List", + "需要通知的测试用户ID。 数组长度不超过10000。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section158318511129" + } + ], + "title": "发送邀请测试通知", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:33.320Z", + "family": "testing", + "endpoint": "test-api-post-test-notify" +} diff --git a/pkg/domain/reference/testing/test-api-post-test-notify.parameters.json b/pkg/domain/reference/testing/test-api-post-test-notify.parameters.json new file mode 100644 index 0000000..3759471 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-post-test-notify.parameters.json @@ -0,0 +1,31 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section236517415165", + "maxLength": 32 + }, + { + "name": "groupId", + "in": "body", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section141117691213", + "maxLength": 32 + }, + { + "name": "testerIds", + "in": "body", + "type": "array", + "required": true, + "description": "需要通知的测试用户ID。 数组长度不超过10000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-post-test-notify-0000002236041538#section141117691213", + "itemsType": "string", + "itemsMaxLength": 32, + "maxItems": 10000 + } +] diff --git a/pkg/domain/reference/testing/test-api-query-feedback-dimension.json b/pkg/domain/reference/testing/test-api-query-feedback-dimension.json new file mode 100644 index 0000000..98570df --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-feedback-dimension.json @@ -0,0 +1,345 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section162251741185115", + "text": "请求示例\n POST /api/app-test/v1/mgmt/tester-feedback-dimension/action/query HTTP/1.1\n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965\n{\n \"startTime\": 0,\n \"endTime\": 0,\n \"appVersions\": [\n \"string\"\n ],\n \"models\": [\n \"string\"\n ],\n \"deviceVersions\": [\n \"string\"\n ],\n \"machineTypes\": [\n \"string\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0,\n \"dimensionData\": [\n {\n \"appVersions\": [\n \"string\"\n ],\n \"models\": [\n \"string\"\n ],\n \"deviceVersions\": [\n \"string\"\n ],\n \"machineTypes\": [\n \"string\"\n ]\n }\n ]\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775", + "title": "查询公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717", + "title": "查询测试问题反馈" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section16817111413112", + "text": "此接口用于查询测试反馈维度。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/mgmt/tester-feedback-dimension/action/query" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "startTime", + "O", + "integer", + "开始时间。" + ], + [ + "endTime", + "O", + "integer", + "结束时间。" + ], + [ + "appVersions", + "O", + "List", + "应用版本。" + ], + [ + "models", + "O", + "String(64)", + "模型。" + ], + [ + "deviceVersions", + "O", + "String(64)", + "设备版本信息。" + ], + [ + "machineTypes", + "O", + "String(64)", + "机器类型。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "Integer", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ], + [ + "dimensionData", + "O", + "Object", + "问题反馈数据。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section9752647125217" + } + ], + "title": "查询测试问题反馈维度", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:36.402Z", + "family": "testing", + "endpoint": "test-api-query-feedback-dimension" +} diff --git a/pkg/domain/reference/testing/test-api-query-feedback-dimension.parameters.json b/pkg/domain/reference/testing/test-api-query-feedback-dimension.parameters.json new file mode 100644 index 0000000..6cdfa64 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-feedback-dimension.parameters.json @@ -0,0 +1,72 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310" + }, + { + "name": "startTime", + "in": "body", + "type": "integer", + "required": false, + "description": "开始时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716" + }, + { + "name": "endTime", + "in": "body", + "type": "integer", + "required": false, + "description": "结束时间。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716" + }, + { + "name": "appVersions", + "in": "body", + "type": "array", + "required": false, + "description": "应用版本。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "itemsType": "string", + "itemsMaxLength": 64 + }, + { + "name": "models", + "in": "body", + "type": "string", + "required": false, + "description": "模型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "maxLength": 64 + }, + { + "name": "deviceVersions", + "in": "body", + "type": "string", + "required": false, + "description": "设备版本信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "maxLength": 64 + }, + { + "name": "machineTypes", + "in": "body", + "type": "string", + "required": false, + "description": "机器类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section6641436115716", + "maxLength": 64 + } +] diff --git a/pkg/domain/reference/testing/test-api-query-feedback-dimension.rules.json b/pkg/domain/reference/testing/test-api-query-feedback-dimension.rules.json new file mode 100644 index 0000000..c968223 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-feedback-dimension.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-dimension-0000002634878572#section513712243310", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-query-feedback.json b/pkg/domain/reference/testing/test-api-query-feedback.json new file mode 100644 index 0000000..28df880 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-feedback.json @@ -0,0 +1,325 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section162251741185115", + "text": "请求示例\n POST /api//app-test/v1/mgmt/tester-feedback/action/query HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965\n{\n \"startTime\": 0,\n \"endTime\": 0,\n \"appVersions\": [\n \"string\"\n ],\n \"models\": [\n \"string\"\n ],\n \"deviceVersions\": [\n \"string\"\n ],\n \"machineTypes\": [\n \"string\"\n ],\n \"currentPage\": 0,\n \"pageSize\": 0\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0,\n \"feedbackInfos\": [\n {\n \"problemId\": \"string\",\n \"testerId\": \"string\",\n \"hwAccount\": \"string\",\n \"contact\": \"string\",\n \"userName\": \"string\",\n \"problemDesc\": \"string\",\n \"createTime\": 0,\n \"attachUrls;\": [\n \"log_url_1\",\n \"screenshot_url_2\"\n ],\n \"appVersion\": \"1.0.2.300\",\n \"model\": \"string\",\n \"machineType\": \"string\",\n \"deviceVersion\": \"string\",\n \"batteryState\": \"string\",\n \"timeZone\": \"string\",\n \"operatorName\": \"string\",\n \"networkType\": 0,\n \"networkStatus\": 0,\n \"availableDiskSpace\": \"string\",\n \"screenDensity\": \"string\"\n }\n ],\n \"pageInfo\": {\n \"current\": 0,\n \"pageSize\": 0,\n \"totalRecord\": 0,\n \"totalPage\": 0\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "title": "feedbackListRequest" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572", + "title": "查询测试问题反馈维度" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-feedback-0000002634718668", + "title": "删除测试问题反馈" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section7338205532", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section6641436115716", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-0000002665117717#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section16817111413112", + "text": "此接口用于查询测试问题反馈列表。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/mgmt/tester-feedback/action/query" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "feedbackListRequest", + "M", + "feedbackListRequest", + "查询问题反馈列表。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section6641436115716" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "O", + "Integer", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "Integer", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ], + [ + "feedbackInfos", + "O", + "Func", + "反馈列表。" + ], + [ + "pageInfo", + "O", + "Object", + "分页信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section9752647125217" + } + ], + "title": "查询测试问题反馈", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:34.569Z", + "family": "testing", + "endpoint": "test-api-query-feedback" +} diff --git a/pkg/domain/reference/testing/test-api-query-feedback.parameters.json b/pkg/domain/reference/testing/test-api-query-feedback.parameters.json new file mode 100644 index 0000000..18f7c88 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-feedback.parameters.json @@ -0,0 +1,83 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-feedback-0000002665117717#section7338205532", + "maxLength": 32 + }, + { + "name": "startTime", + "in": "body", + "type": "integer", + "required": false, + "description": "时间戳,开始时间,不填默认近一年。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861" + }, + { + "name": "endTime", + "in": "body", + "type": "integer", + "required": false, + "description": "时间戳,结束时间,不填默认近一年。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861" + }, + { + "name": "appVersions", + "in": "body", + "type": "array", + "required": false, + "description": "应用版本。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "itemsMaxLength": 64 + }, + { + "name": "models", + "in": "body", + "type": "array", + "required": false, + "description": "模型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "itemsMaxLength": 64 + }, + { + "name": "deviceVersions", + "in": "body", + "type": "array", + "required": false, + "description": "设备版本。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "itemsMaxLength": 64 + }, + { + "name": "machineTypes", + "in": "body", + "type": "array", + "required": false, + "description": "机器类型。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861", + "itemsType": "string", + "itemsMaxLength": 64 + }, + { + "name": "currentPage", + "in": "body", + "type": "integer", + "required": false, + "description": "当前页。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861" + }, + { + "name": "pageSize", + "in": "body", + "type": "integer", + "required": false, + "description": "每页数量。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-feedbacklistrequest-0000002671389861" + } +] diff --git a/pkg/domain/reference/testing/test-api-query-open-test-link.json b/pkg/domain/reference/testing/test-api-query-open-test-link.json new file mode 100644 index 0000000..94ad888 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-open-test-link.json @@ -0,0 +1,290 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section162251741185115", + "text": "请求示例\n GET /api/app-test/v1/test-group/public-link?groupId=2c383a3780f14471997bda6b867eaa1d HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0,\n \"publicLinkInfo\": {\n \"groupId\": \"string\",\n \"inviteCode\": \"string\",\n \"inviteLimit\": 0,\n \"inviteNumber\": 0,\n \"status\": 0,\n \"publicLink\": \"string\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-open-test-link-0000002634718666", + "title": "修改公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-feedback-dimension-0000002634878572", + "title": "查询测试问题反馈维度" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-open-test-link-0000002664997775#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section16817111413112", + "text": "此接口用于查询群组级公开测试链接。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section16817111413112", + "text": "“公开链接”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APPID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/test-group/public-link?groupId=2c3***********d" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String", + "测试版本ID。" + ], + [ + "appId", + "M", + "String", + "应用ID" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section6641436115716" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "Integer", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "错误描述。" + ], + [ + "businessCode", + "O", + "Integer", + "业务错误码,非rtnCode的业务错误码在这个字段返回。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section9752647125217" + } + ], + "title": "查询公开链接", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:37.909Z", + "family": "testing", + "endpoint": "test-api-query-open-test-link" +} diff --git a/pkg/domain/reference/testing/test-api-query-open-test-link.parameters.json b/pkg/domain/reference/testing/test-api-query-open-test-link.parameters.json new file mode 100644 index 0000000..2c81f8c --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-open-test-link.parameters.json @@ -0,0 +1,27 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "maxLength": 64 + }, + { + "name": "versionId", + "in": "query", + "type": "string", + "required": true, + "description": "测试版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section6641436115716" + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section6641436115716" + } +] diff --git a/pkg/domain/reference/testing/test-api-query-open-test-link.rules.json b/pkg/domain/reference/testing/test-api-query-open-test-link.rules.json new file mode 100644 index 0000000..32e8171 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-open-test-link.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-open-test-link-0000002664997775#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-query-test-user.json b/pkg/domain/reference/testing/test-api-query-test-user.json new file mode 100644 index 0000000..a36cd4c --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-test-user.json @@ -0,0 +1,344 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section162251741185115", + "text": "请求示例\n GET /api/app-test/v1/test-user HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId:69175*******88965\n groupId:3d9b11d5d0774efb9af4f9a807347e49\n current: 1\n pageSize: 25" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"string\",\n \"businessCode\": 0,\n \"testerInfo\": [\n {\n \"id\": \"string\",\n \"hwAccount\": \"string\",\n \"nickName\": \"string\",\n \"joinType\": 0,\n \"joinTime\": 0,\n \"latestInstallTime\": 0,\n \"versionName\": \"string\",\n \"versionCode\": 0,\n \"build\": \"string\"\n }\n ],\n \"pageInfo\": {\n \"current\": 0,\n \"pageSize\": 0,\n \"totalRecord\": 0,\n \"totalPage\": 0\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-edit-test-group-0000002634718664", + "title": "修改测试群组" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-user-0000002236201338", + "title": "新增测试群组成员" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section141117691213", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-query-test-user-0000002664997773#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section16817111413112", + "text": "此接口用于查询测试群组成员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section16817111413112", + "text": "“内部群组”为AppTest专属能力,如果您希望体验此能力,但您的应用尚未切换为AppTest邀请测试,可以通过在线工单系统与我们联系。工单“问题分类”请选择“上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称、开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "text": "OAuth客户端方式:" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/test-user" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "groupId", + "M", + "String(32)", + "测试群组ID。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID。" + ], + [ + "current", + "O", + "Integer", + "当前页。 默认值:1" + ], + [ + "pageSize", + "O", + "Integer", + "每页数。 默认值:25" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3:并发修改错误 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "返回码描述信息。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码。 取值范围: 100:测试群组已存在生效邀请码。 101:测试群用户数量已达上限。" + ], + [ + "testerInfo", + "O", + "Object", + "测试员信息。" + ], + [ + "pageInfo", + "O", + "Object", + "分页信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section9752647125217" + } + ], + "title": "查询测试群组成员", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:39.362Z", + "family": "testing", + "endpoint": "test-api-query-test-user" +} diff --git a/pkg/domain/reference/testing/test-api-query-test-user.parameters.json b/pkg/domain/reference/testing/test-api-query-test-user.parameters.json new file mode 100644 index 0000000..6c5ce9b --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-test-user.parameters.json @@ -0,0 +1,53 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296" + }, + { + "name": "groupId", + "in": "query", + "type": "string", + "required": true, + "description": "测试群组ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213", + "maxLength": 32 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213", + "maxLength": 32 + }, + { + "name": "current", + "in": "query", + "type": "integer", + "required": false, + "description": "当前页。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213" + }, + { + "name": "pageSize", + "in": "query", + "type": "integer", + "required": false, + "description": "每页数。 默认值:25", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section141117691213" + } +] diff --git a/pkg/domain/reference/testing/test-api-query-test-user.rules.json b/pkg/domain/reference/testing/test-api-query-test-user.rules.json new file mode 100644 index 0000000..50cda92 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-query-test-user.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-query-test-user-0000002664997773#section18864141115296", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-release-test-version.json b/pkg/domain/reference/testing/test-api-release-test-version.json new file mode 100644 index 0000000..65a356f --- /dev/null +++ b/pkg/domain/reference/testing/test-api-release-test-version.json @@ -0,0 +1,321 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section162251741185115", + "text": "请求示例\n PUT /api/publish/v2/test/version/release?appId=6917********72 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n{\n \"versionId\": \"1518********60\",\n \"releaseType\": 2,\n \"phasedReleaseInfo\": {\n \"phasedReleaseStartTime\": \"1727******95\",\n \"phasedReleaseEndTime\": \"1727******000\",\n \"phasedReleasePercent\": \"20\",\n \"phasedReleaseDescription\": \"测试*****\"\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section45981511195316", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-phasedreleaseinfo-0000002237496320", + "title": "PhasedReleaseInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-modify-test-version-0000002271160657", + "title": "更新测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530", + "title": "更新有效期内的测试版本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section16817111413112", + "text": "此接口用于将公开测试版本转为全网版本或者分阶段版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "text": "请求Body中使用JSON格式携带需要转正的测试版本信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/version/release" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section6641436115716" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "需要转为全网版本或者分阶段版本的测试版本ID。" + ], + [ + "releaseType", + "M", + "Integer(32)", + "发布方式。 取值范围: 1:全网发布。 2:分阶段发布。 默认值:1" + ], + [ + "releaseTime", + "O", + "Integer(64)", + "发布时间。 时间为毫秒数。 0,则表示立即上架。 非0,则表示指定时间上架,只对转全网生效。" + ], + [ + "phasedReleaseInfo", + "O", + "PhasedReleaseInfo", + "分阶段发布信息。 说明 releaseType为2时,该参数必填。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section9752647125217" + } + ], + "title": "更新测试生效版本", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:40.822Z", + "family": "testing", + "endpoint": "test-api-release-test-version" +} diff --git a/pkg/domain/reference/testing/test-api-release-test-version.parameters.json b/pkg/domain/reference/testing/test-api-release-test-version.parameters.json new file mode 100644 index 0000000..a25464d --- /dev/null +++ b/pkg/domain/reference/testing/test-api-release-test-version.parameters.json @@ -0,0 +1,56 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "maxLength": 64 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section6641436115716" + }, + { + "name": "versionId", + "in": "body", + "type": "string", + "required": true, + "description": "需要转为全网版本或者分阶段版本的测试版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "maxLength": 32 + }, + { + "name": "releaseType", + "in": "body", + "type": "integer", + "required": true, + "description": "发布方式。 取值范围: 1:全网发布。 2:分阶段发布。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213", + "enum": [ + "1", + "2" + ] + }, + { + "name": "releaseTime", + "in": "body", + "type": "integer", + "required": false, + "description": "发布时间。 时间为毫秒数。 0,则表示立即上架。 非0,则表示指定时间上架,只对转全网生效。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213" + }, + { + "name": "phasedReleaseInfo", + "in": "body", + "type": "object", + "required": false, + "description": "分阶段发布信息。 说明 releaseType为2时,该参数必填。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section141117691213" + } +] diff --git a/pkg/domain/reference/testing/test-api-release-test-version.rules.json b/pkg/domain/reference/testing/test-api-release-test-version.rules.json new file mode 100644 index 0000000..39d1d4e --- /dev/null +++ b/pkg/domain/reference/testing/test-api-release-test-version.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-release-test-version-0000002271000713#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-stop-invite-code.json b/pkg/domain/reference/testing/test-api-stop-invite-code.json new file mode 100644 index 0000000..bce08c8 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-stop-invite-code.json @@ -0,0 +1,323 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section162251741185115", + "text": "请求示例\n POST /api/app-test/v1/invitation-code/action/stop HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n appId: 6917********65\n {\n \"invitationCodeId\": \"1f******ll\"\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section45981511195316", + "text": "响应示例\n{\n \"rtnCode\": 0,\n \"rtnDesc\": \"success\",\n \"businessCode\": 0\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-create-open-test-link-0000002665117715", + "title": "公开链接" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-getting-started/agc-help-view-app-info-0000002282674569", + "title": "查看应用信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-get-invite-code-0000002271160669", + "title": "查询测试群组邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542", + "title": "停止测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section16817111413112", + "text": "此接口用于邀请测试停止邀请码。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section16817111413112", + "text": "若您的应用已切换为“AppTest邀请测试”,无法使用该接口,您可以使用创建公开链接接口。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section141117691213", + "text": "请求Body中使用JSON格式携带邀请码信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/app-test/v1/invitation-code/action/stop" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "Integer(int64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ], + [ + "appId", + "M", + "String(32)", + "应用ID,获取方法参考查看应用信息。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "invitationCodeId", + "M", + "String(32)", + "邀请码ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "rtnCode", + "M", + "String", + "返回码。 取值范围: 0:成功 1:参数校验不通过。 2:越权错误。 3: 并发修改错误。 -1:内部异常。" + ], + [ + "rtnDesc", + "O", + "String", + "返回码描述信息。" + ], + [ + "businessCode", + "O", + "String", + "业务错误码。 取值范围: 100:邀请码ID不存在。 101:邀请码已失效。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section9752647125217" + } + ], + "title": "停止邀请码", + "updatedAt": "2026-08-11 10:20", + "checkedAt": "2026-10-07T02:55:42.982Z", + "family": "testing", + "endpoint": "test-api-stop-invite-code" +} diff --git a/pkg/domain/reference/testing/test-api-stop-invite-code.parameters.json b/pkg/domain/reference/testing/test-api-stop-invite-code.parameters.json new file mode 100644 index 0000000..0cb4ae0 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-stop-invite-code.parameters.json @@ -0,0 +1,28 @@ +[ + { + "name": "appId", + "in": "header", + "type": "string", + "required": true, + "description": "应用ID,获取方法参考查看应用信息。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "maxLength": 32 + }, + { + "name": "teamId", + "in": "header", + "type": "integer", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310" + }, + { + "name": "invitationCodeId", + "in": "body", + "type": "string", + "required": true, + "description": "邀请码ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section141117691213", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/testing/test-api-stop-invite-code.rules.json b/pkg/domain/reference/testing/test-api-stop-invite-code.rules.json new file mode 100644 index 0000000..6633912 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-stop-invite-code.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-invite-code-0000002271000725#section667421774310", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-stop-test-version.json b/pkg/domain/reference/testing/test-api-stop-test-version.json new file mode 100644 index 0000000..ced90b7 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-stop-test-version.json @@ -0,0 +1,304 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section162251741185115", + "text": "请求示例\n POST /api/publish/v2/test/version/stop?appId=6917********65 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n {\n \"versionId\": \"1418********32\"\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section45981511195316", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-invite-code-0000002271000725", + "title": "停止邀请码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-delete-test-version-0000002236201346", + "title": "删除测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-stop-test-version-0000002236041542#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section16817111413112", + "text": "此接口用于停止测试版本。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section16817111413112", + "text": "停止测试版本后,测试版本会完全下架,不再支持编辑。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section141117691213", + "text": "请求Body中使用JSON格式携带测试版本信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/version/stop" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section6641436115716" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "测试版本ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section9752647125217" + } + ], + "title": "停止测试版本", + "updatedAt": "2026-06-25 19:52", + "checkedAt": "2026-10-07T02:55:44.345Z", + "family": "testing", + "endpoint": "test-api-stop-test-version" +} diff --git a/pkg/domain/reference/testing/test-api-stop-test-version.parameters.json b/pkg/domain/reference/testing/test-api-stop-test-version.parameters.json new file mode 100644 index 0000000..86a83c4 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-stop-test-version.parameters.json @@ -0,0 +1,28 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "maxLength": 64 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section6641436115716" + }, + { + "name": "versionId", + "in": "body", + "type": "string", + "required": true, + "description": "测试版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section141117691213", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/testing/test-api-stop-test-version.rules.json b/pkg/domain/reference/testing/test-api-stop-test-version.rules.json new file mode 100644 index 0000000..b72316f --- /dev/null +++ b/pkg/domain/reference/testing/test-api-stop-test-version.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-stop-test-version-0000002236041542#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-submit-test-version.json b/pkg/domain/reference/testing/test-api-submit-test-version.json new file mode 100644 index 0000000..300d74a --- /dev/null +++ b/pkg/domain/reference/testing/test-api-submit-test-version.json @@ -0,0 +1,304 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section162251741185115", + "text": "请求示例\n POST /api/publish/v2/test/app/version/submit?appId=6917********65 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n {\n \"versionId\": \"1418********32\"\n }" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section3431111843614", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530", + "title": "更新有效期内的测试版本信息" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-add-test-group-0000002271160661", + "title": "新增测试群组" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334#section3431111843614", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section16817111413112", + "text": "此接口用于测试版本提交审核。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section16817111413112", + "text": "针对设备类型为“智能表”目前为受限开放,若您想要体验使用,可以通过在线工单系统与我们联系,工单 “问题分类”请选择 “上架与运营-应用市场-应用测试”,并在“问题描述”中提供您的开发者名称,开发者ID、应用名称、APP ID。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section141117691213", + "text": "请求Body中使用JSON格式携带测试版本信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/app/version/submit" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section6641436115716" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "测试版本ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section9752647125217" + } + ], + "title": "提交测试版本", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:45.828Z", + "family": "testing", + "endpoint": "test-api-submit-test-version" +} diff --git a/pkg/domain/reference/testing/test-api-submit-test-version.parameters.json b/pkg/domain/reference/testing/test-api-submit-test-version.parameters.json new file mode 100644 index 0000000..eac2a14 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-submit-test-version.parameters.json @@ -0,0 +1,28 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "maxLength": 64 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section6641436115716" + }, + { + "name": "versionId", + "in": "body", + "type": "string", + "required": true, + "description": "测试版本ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section141117691213", + "maxLength": 32 + } +] diff --git a/pkg/domain/reference/testing/test-api-submit-test-version.rules.json b/pkg/domain/reference/testing/test-api-submit-test-version.rules.json new file mode 100644 index 0000000..44f9c83 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-submit-test-version.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-submit-test-version-0000002236201334#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/testing/test-api-update-test-version-opentest.json b/pkg/domain/reference/testing/test-api-update-test-version-opentest.json new file mode 100644 index 0000000..eef8fbf --- /dev/null +++ b/pkg/domain/reference/testing/test-api-update-test-version-opentest.json @@ -0,0 +1,323 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section162251741185115", + "text": "请求示例\n PUT /api/publish/v2/test/version/open-test?appId=69175********72 HTTP/1.1 \n Host: connect-api.cloud.huawei.com \n client_id: 4141******68 \n Content-Type: application/json \n Authorization: Bearer ******* \n{\n \"versionId\": \"1518********60\",\n \"startTime\": 1727******00,\n \"endTime\": 1730******00,\n \"publicTestInstallLimit\": 200,\n \"newBindGroupIds\": [\n \"761e********08\"\n ]\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section45981511195316", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter#section195981215284", + "title": "了解新版目录" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-open-ability-0000002235710238", + "title": "AGC开放能力" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-0000002236015554", + "title": "AppGallery Connect API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-reference-0000002271000709", + "title": "Testing API参考" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661", + "title": "获取服务端授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section104621343151212", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section09831133141712", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-connect-api-obtain-server-auth-0000002271134661#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-data-connectret-0000002272455641", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-release-test-version-0000002271000713", + "title": "更新测试生效版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-submit-test-version-0000002236201334", + "title": "提交测试版本" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section16817111413112", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section101651738121111", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section747013518115", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section6641436115716", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section162251741185115", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section9752647125217", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-test-api-update-test-version-opentest-0000002236041530#section45981511195316", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section16817111413112", + "text": "此接口用于更新有效期内测试版本的测试时间和下载安装次数。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section16817111413112", + "text": "接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见获取服务端授权。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "text": "请求Body中使用JSON格式携带需要更新的测试版本信息,参数如下表所示。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/test/version/open-test" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section101651738121111" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String(64)", + "开发者所在团队的团队ID。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String", + "应用ID。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section6641436115716" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "versionId", + "M", + "String(32)", + "需要更新的测试版本ID。 测试版本的状态必须是正在测试和等待生效。" + ], + [ + "startTime", + "O", + "Integer(64)", + "测试版本开始时间。 此时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + ], + [ + "endTime", + "O", + "Integer(64)", + "测试版本结束时间。 此时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000" + ], + [ + "publicTestInstallLimit", + "O", + "Integer", + "公开测试安装次数上限。 默认值:10万次。" + ], + [ + "newBindGroupIds", + "O", + "List", + "需要关联测试版本的测试群组ID列表。 数组长度不超过1000。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section9752647125217" + } + ], + "title": "更新有效期内的测试版本信息", + "updatedAt": "2026-08-05 11:22", + "checkedAt": "2026-10-07T02:55:47.214Z", + "family": "testing", + "endpoint": "test-api-update-test-version-opentest" +} diff --git a/pkg/domain/reference/testing/test-api-update-test-version-opentest.parameters.json b/pkg/domain/reference/testing/test-api-update-test-version-opentest.parameters.json new file mode 100644 index 0000000..6c89546 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-update-test-version-opentest.parameters.json @@ -0,0 +1,63 @@ +[ + { + "name": "teamId", + "in": "header", + "type": "string", + "required": false, + "description": "开发者所在团队的团队ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "maxLength": 64 + }, + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section6641436115716" + }, + { + "name": "versionId", + "in": "body", + "type": "string", + "required": true, + "description": "需要更新的测试版本ID。 测试版本的状态必须是正在测试和等待生效。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "maxLength": 32 + }, + { + "name": "startTime", + "in": "body", + "type": "integer", + "required": false, + "description": "测试版本开始时间。 此时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213" + }, + { + "name": "endTime", + "in": "body", + "type": "integer", + "required": false, + "description": "测试版本结束时间。 此时间是与1970年1月1日午夜之间的差值。 单位:毫秒 示例:1704211200000", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213" + }, + { + "name": "publicTestInstallLimit", + "in": "body", + "type": "integer", + "required": false, + "description": "公开测试安装次数上限。 默认值:10万次。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213" + }, + { + "name": "newBindGroupIds", + "in": "body", + "type": "array", + "required": false, + "description": "需要关联测试版本的测试群组ID列表。 数组长度不超过1000。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section141117691213", + "itemsType": "string", + "itemsMaxLength": 32, + "maxItems": 1000 + } +] diff --git a/pkg/domain/reference/testing/test-api-update-test-version-opentest.rules.json b/pkg/domain/reference/testing/test-api-update-test-version-opentest.rules.json new file mode 100644 index 0000000..936c499 --- /dev/null +++ b/pkg/domain/reference/testing/test-api-update-test-version-opentest.rules.json @@ -0,0 +1,13 @@ +[ + { + "id": "oauth-team", + "kind": "required_with", + "field": "header.teamId", + "fields": [ + "header.oauth2Token" + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/app/agc-help-test-api-update-test-version-opentest-0000002236041530#section15707195611112", + "message": "OAuth authorization requires its selected teamId.", + "suggestion": "Supply the selected OAuth team ID in the teamId header." + } +] diff --git a/pkg/domain/reference/upload/obbfile-compose.json b/pkg/domain/reference/upload/obbfile-compose.json new file mode 100644 index 0000000..c06b918 --- /dev/null +++ b/pkg/domain/reference/upload/obbfile-compose.json @@ -0,0 +1,363 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section17964273166", + "text": "请求示例\nPOST /api/publish/v2/upload/multipart/compose?objectId=*******&nspUploadId=***** HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"additionalProp1\": {\n \"partObjectId\": \"\",\n \"etag\": \"41a9ba6******fac180e149f94\"\n },\n \"additionalProp2\": {\n \"partObjectId\": \"\",\n \"etag\": \"2b8dd6a26*****3a364f55d2a92\"\n }\n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "title": "分片上传初始化" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "title": "分片上传初始化" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#ZH-CN_TOPIC_0000001111845098__zh-cn_topic_0000001058910558_p11596154414395", + "title": "FilePartComposeInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", + "title": "上传分片实体" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#ZH-CN_TOPIC_0000001111845098__p1474451117", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-errorcode-harmonyos-0000002123259325", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section0204135491218", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section17964273166", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section148573286116", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section9857192814112", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section992664711544", + "text": "此接口用于将已经上传成功后的分片合并为一个文件。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910", + "text": "请求Body中使用JSON格式携带分片信息,参数如下所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910", + "text": "FilePartComposeInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section148573286116", + "text": "ConnectRet" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/upload/multipart/compose" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "objectId", + "M", + "String(200)", + "对象ID,参见分片上传初始化时生成的objectId参数。" + ], + [ + "nspUploadId", + "M", + "String(64)", + "上传ID,参见分片上传初始化时生成的nspUploadId参数。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section0204135491218" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "additionalPropX", + "M", + "FilePartComposeInfo", + "分片信息。 其中参数名中的X为分片的编号,例如additionalProp1、additionalProp2,需要与获取分片上传地址时返回的分片编号一致。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "partObjectId", + "M", + "String(64)", + "分段对象ID,必须与获取分片上传地址时返回的partObjectId一致。" + ], + [ + "etag", + "M", + "String(64)", + "上传分片实体时返回的分片的Etag值。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section15344132481910" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section148573286116" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Integer", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098#section148573286116" + } + ], + "title": "合并分片", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:52:57.559Z", + "family": "upload", + "endpoint": "obbfile-compose" +} diff --git a/pkg/domain/reference/upload/obbfile-init.json b/pkg/domain/reference/upload/obbfile-init.json new file mode 100644 index 0000000..f9bed4a --- /dev/null +++ b/pkg/domain/reference/upload/obbfile-init.json @@ -0,0 +1,345 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-0000002092927786", + "title": "Upload Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#ZH-CN_TOPIC_0000001158365055__p1474451117", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-errorcode-harmonyos-0000002123259325", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section992664711544", + "text": "此接口用于分片信息初始化,在获取分片文件上传地址前调用。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section163825114565", + "text": "ConnectRet" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/upload/multipart/init" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "应用ID。" + ], + [ + "fileName", + "M", + "String(256)", + "原始文件名,需要带文件后缀。" + ], + [ + "contentType", + "O", + "String", + "对象内容的类型,为http标准的content-type,例如image/jpeg。 如果不传,默认值:“application/octet-stream”。" + ], + [ + "fileType", + "O", + "Integer", + "文件类型。 取值范围: 1:APP文件(HarmonyOS应用/元服务软件包)。 2:OBB(Android APK扩展文件)。 3:APK(Android软件包,含APK、AAB)。 默认值:2" + ], + [ + "releaseType", + "O", + "Integer", + "应用发布方式。 取值范围: 1:全网发布。 6:HarmonyOS测试发布(API>=10)。" + ], + [ + "obbType", + "O", + "Integer", + "OBB文件类型。 取值范围: 1:主扩展文件 2:补丁扩展文件 上传OBB文件时必填,非OBB文件不能传入此参数。上传OBB文件前,应用最新版本必须已经关联了APK包。" + ], + [ + "chineseMainlandFlag", + "O", + "Integer", + "软件包是否分发中国大陆(不包括港澳台)。 取值范围: 0:不分发中国大陆 1:分发中国大陆 说明 当fileType为1且开发者注册地非中国大陆时,必须设置chineseMainlandFlag参数。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "objectId", + "M", + "String(128)", + "生成的对象ID。在获取分片上传地址时需要使用此ID。" + ], + [ + "nspPartMinSize", + "M", + "Integer(64)", + "分片文件的最小值,单位字节。默认分片最小值为5MB。" + ], + [ + "nspPartMaxSize", + "M", + "Integer(64)", + "分片文件的最大值,单位字节。默认分片最大值为1024MB。" + ], + [ + "nspUploadId", + "M", + "String(128)", + "文件上传ID。在获取分片上传地址时需要使用此ID。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section163825114565" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Integer", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section163825114565" + } + ], + "title": "分片上传初始化", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:52:59.350Z", + "family": "upload", + "endpoint": "obbfile-init" +} diff --git a/pkg/domain/reference/upload/obbfile-init.rules.json b/pkg/domain/reference/upload/obbfile-init.rules.json new file mode 100644 index 0000000..aa471bb --- /dev/null +++ b/pkg/domain/reference/upload/obbfile-init.rules.json @@ -0,0 +1,39 @@ +[ + { + "id": "obb-subtype-required", + "kind": "required_if", + "field": "query.obbType", + "when": { + "field": "query.fileType", + "equals": "2", + "default": "2" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "message": "OBB 文件必须提供 obbType;省略 fileType 时默认为 OBB。", + "suggestion": "OBB 添加 --query obbType=1 或 2;HarmonyOS APP 明确添加 --query fileType=1。" + }, + { + "id": "non-obb-subtype-forbidden-1", + "kind": "forbidden_if", + "field": "query.obbType", + "when": { + "field": "query.fileType", + "equals": "1" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "message": "非 OBB 文件不能传入 obbType。", + "suggestion": "移除 --query obbType;保留正确的 fileType。" + }, + { + "id": "non-obb-subtype-forbidden-3", + "kind": "forbidden_if", + "field": "query.obbType", + "when": { + "field": "query.fileType", + "equals": "3" + }, + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055#section12533340135616", + "message": "非 OBB 文件不能传入 obbType。", + "suggestion": "移除 --query obbType;保留正确的 fileType。" + } +] diff --git a/pkg/domain/reference/upload/obbfile-upload.json b/pkg/domain/reference/upload/obbfile-upload.json new file mode 100644 index 0000000..d92692c --- /dev/null +++ b/pkg/domain/reference/upload/obbfile-upload.json @@ -0,0 +1,193 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-0000002092927786", + "title": "Upload Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "title": "获取分片上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-compose-0000001111845098", + "title": "合并分片" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section10856142851110", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section15511128181410", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section15344132481910", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section148573286116", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section992664711544", + "text": "此接口用于将分片实体文件上传到AppGallery Connect服务器,每次调用只能上传一个分片,支持多次调用逐个上传多个分片。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section15344132481910", + "text": "请求Body为二进制形式的分片文件内容,对应Content-Type为application/octet-stream,文件的大小必须和获取文件上传地址时填写的length一致,最大不能超过100MB。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section148573286116", + "text": "HTTP响应码为200时表示上传成功,成功时在header中会携带如下参数。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section148573286116", + "text": "HTTP响应码非200时表示上传失败,请检查获取分片上传地址时参数是否传入准确。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "获取分片上传地址接口中返回的method参数中指定的请求方式。" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "获取分片上传地址接口中返回的分片文件上传地址(参见FilePartUploadInfo的url参数)。" + ], + [ + "数据格式", + "请求:Content-Type: application/octet-stream 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "校验信息,对应获取分片上传地址接口返回的headers参数中的Authorization。" + ], + [ + "x-amz-content-sha256", + "M", + "String", + "文件对象内容的SHA256哈希值,对应获取分片上传地址接口返回的headers参数中的x-amz-content-sha256。" + ], + [ + "x-amz-date", + "M", + "String", + "文件上传地址生成的时间,对应获取分片上传地址接口返回的headers参数中的x-amz-date。" + ], + [ + "Host", + "M", + "String", + "上传服务器地址,对应获取分片上传地址接口返回的headers参数中的Host。" + ], + [ + "Content-Type", + "M", + "String", + "对象内容的类型,对应获取分片上传地址接口返回的headers参数中的Content-Type。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section15511128181410" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ETag", + "M", + "String(header)", + "响应消息header中的ETag值,每个分片Etag不相同,在合并分片时需要使用。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067#section148573286116" + } + ], + "title": "上传分片实体", + "updatedAt": "2025-12-02 17:24", + "checkedAt": "2026-10-07T02:53:00.764Z", + "family": "upload", + "endpoint": "obbfile-upload" +} diff --git a/pkg/domain/reference/upload/obbfile-uploadurl.json b/pkg/domain/reference/upload/obbfile-uploadurl.json new file mode 100644 index 0000000..0901090 --- /dev/null +++ b/pkg/domain/reference/upload/obbfile-uploadurl.json @@ -0,0 +1,440 @@ +{ + "examples": [ + { + "section": "请求示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section106476521156", + "text": "请求示例\nPOST /api/publish/v2/upload/multipart/parts?objectId=*******&nspUploadId=***** HTTP/1.1\nHost: connect-api.cloud.huawei.com\nclient_id: 41******68\nContent-Type: application/json\nAuthorization: Bearer ******\n{\n \"additionalProp1\": {\n \"sha256\": \"\",\n \"length\": 5242880\n },\n \"additionalProp2\": {\n \"sha256\": \"\",\n \"length\": 3519290\n }\n}" + }, + { + "section": "响应示例", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section192651716919", + "text": "响应示例\n{\n \"ret\": {\n \"code\": 0,\n \"msg\": \"success\"\n },\n \"uploadInfoMap\": {\n \"additionalProp1\": {\n \"url\": \"https://xxx.xxx.com/CN/20200728/1595904761905-6f2cca88-73fe-403e-9fc0-a49648aac596.jpg?partNumber=1&uploadId=000001739*****CEBAEC4E5A\",\n \"method\": \"PUT\",\n \"partObjectId\": \"\",\n \"headers\": {\n \"Authorization\": \"AWS4-HMAC-SHA256 Credential=I06FNCS*********ZC/20200728/cn-north-4/s3/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=51015****************224b1281931781\",\n \"x-amz-content-sha256\": \"UNSIGNED-PAYLOAD\",\n \"x-amz-date\": \"202****022Z\",\n \"Host\": \"agc-fhs-dev-test.obs.cn-north-4.****.com\",\n \"Content-Type\": \"application/octet-stream\"\n }\n },\n \"additionalProp2\": {\n ....\n } \n } \n}" + } + ], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-0000002092927786", + "title": "Upload Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "title": "分片上传初始化" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "title": "分片上传初始化" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "title": "分片上传初始化" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#ZH-CN_TOPIC_0000001111685208__zh-cn_topic_0000001058262129_p11596154414395", + "title": "FilePartInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#ZH-CN_TOPIC_0000001111685208__p1518531601913", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#ZH-CN_TOPIC_0000001111685208__zh-cn_topic_0000001058262129_p106441826185215", + "title": "FilePartUploadInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#ZH-CN_TOPIC_0000001111685208__zh-cn_topic_0000001058262129_p106441826185215", + "title": "FilePartUploadInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-errorcode-harmonyos-0000002123259325", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", + "title": "上传分片实体" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", + "title": "上传分片实体" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "title": "分片上传初始化" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-upload-0000001158245067", + "title": "上传分片实体" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section992664711544", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section420451011213", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section106476521156", + "title": "请求示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section163825114565", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section192651716919", + "title": "响应示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section992664711544", + "text": "此接口用于获取文件所有分片的上传地址,调用此接口前必须先调用分片上传初始化接口完成分片初始化。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910", + "text": "请求Body中使用JSON格式携带详细的分片信息,参数如下所示。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910", + "text": "FilePartInfo" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section163825114565", + "text": "ConnectRet" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section163825114565", + "text": "FilePartUploadInfo" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS POST" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/upload/multipart/parts" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "objectId", + "M", + "String", + "对象ID,必须与分片上传初始化时生成的objectId参数一致。" + ], + [ + "nspUploadId", + "M", + "String", + "上传ID,必须与分片上传初始化时生成的nspUploadId参数一致。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section420451011213" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "additionalPropX", + "M", + "FilePartInfo", + "详细分片信息。其中参数名中的X为分片的编号,从1开始顺序编号,例如additionalProp1、additionalProp2。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910" + }, + { + "location": "body", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "sha256", + "O", + "String(64)", + "分片文件的sha256值。" + ], + [ + "length", + "M", + "Integer(64)", + "分片文件大小,单位字节,必须与分片的实际大小一致。单个分片最大限制为100MB。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section15344132481910" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "uploadInfoMap", + "M", + "HashMap", + "包含分片地址的Map对象。key为分片的编号(例如“additionalProp1”, “additionalProp2”),value为包含对应分片地址信息的FilePartUploadInfo实体类。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section163825114565" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Integer", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section163825114565" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "url", + "M", + "String", + "分片上传地址。上传地址有效期为4分钟,请在4分钟内调用上传分片实体接口上传分片。" + ], + [ + "method", + "M", + "String", + "上传分片时需要使用的HTTP请求方式,默认值:PUT。" + ], + [ + "partObjectId", + "M", + "String", + "分片的分段对象ID,有可能为空字符串。" + ], + [ + "headers", + "M", + "String", + "使用分片上传地址上传分片文件时,请求头所需的参数,为JSON结构,格式为:{\"Authorization\":\"***\",\"x-amz-content-sha256\":\"***\",\"x-amz-date\":\"***\",\"Host\":\"***\",\"Content-Type\":\"***\"}。 具体说明请参见上传分片实体接口。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-uploadurl-0000001111685208#section163825114565" + } + ], + "title": "获取分片上传地址", + "updatedAt": "2026-03-11 09:18", + "checkedAt": "2026-10-07T02:53:02.499Z", + "family": "upload", + "endpoint": "obbfile-uploadurl" +} diff --git a/pkg/domain/reference/upload/upload-file-new.json b/pkg/domain/reference/upload/upload-file-new.json new file mode 100644 index 0000000..72c0cf9 --- /dev/null +++ b/pkg/domain/reference/upload/upload-file-new.json @@ -0,0 +1,233 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-0000002092927786", + "title": "Upload Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取上传文件地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "title": "获取文件上传地址" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obbfile-init-0000001158365055", + "title": "分片上传初始化" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section64225232", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "title": "使用约束" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section5195132", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section2842112511484", + "title": "header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section7459173834010", + "title": "Body" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section46756188", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section64225232", + "text": "客户端或服务器向AppGallery Connect上传相关文件接口。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section64225232", + "text": "浏览器或客户端与服务器之间的接口协议采用HTTPS,Content-Type采用application/octet-stream格式,文件使用application/octet-stream格式编码添加到HTTPS报文中。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section64225232", + "text": "此接口当前支持上传的应用软件包包括APK、AAB、RPK、APP(HarmonyOS应用/元服务)、EXE(Windows应用)。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "文件大小上限: APK:不超过4GB。 RPK:快应用不超过20MB,快游戏不超过30MB。 AAB:不超过150MB。 APP(HarmonyOS应用/元服务): HarmonyOS应用不超过4GB,元服务不超过10M。 EXE(Windows应用): 不超过4GB。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "APK:不超过4GB。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "RPK:快应用不超过20MB,快游戏不超过30MB。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "AAB:不超过150MB。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "APP(HarmonyOS应用/元服务): HarmonyOS应用不超过4GB,元服务不超过10M。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "EXE(Windows应用): 不超过4GB。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "文件类型要求与获取上传文件地址中请求的文件名后缀相同。" + }, + { + "section": "使用约束", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section132mcpsimp", + "text": "用户头像需采用文件加密存储。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section7459173834010", + "text": "请求Body为二进制形式的文件内容,对应Content-Type为application/octet-stream,文件的大小必须和获取文件上传地址时填写的contentLength一致。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section46756188", + "text": "接口返回的HTTP状态码为200时,表示文件上传成功。" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS PUT" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "获取上传文件地址接口中获取的URL地址。" + ], + [ + "数据格式", + "请求:Content-Type: application/octet-stream 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section6932219103913" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "校验信息,对应获取上传文件地址接口返回的headers参数中的Authorization。" + ], + [ + "x-amz-content-sha256", + "M", + "String", + "文件对象内容的SHA256哈希值,对应获取上传文件地址接口返回的headers参数中的x-amz-content-sha256。" + ], + [ + "x-amz-date", + "M", + "String", + "文件上传地址生成的时间,对应获取上传文件地址接口返回的headers参数中的x-amz-date。" + ], + [ + "Host", + "M", + "String", + "上传服务器地址,对应获取上传文件地址接口返回的headers参数中的Host。" + ], + [ + "user-agent", + "M", + "String", + "用户代理,对应获取上传文件地址接口返回的headers参数中的user-agent。" + ], + [ + "Content-Type", + "M", + "String", + "对象内容的类型,对应获取上传文件地址接口返回的headers参数中的Content-Type。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090#section2842112511484" + } + ], + "title": "上传文件", + "updatedAt": "2025-08-06 18:02", + "checkedAt": "2026-10-07T02:53:04.769Z", + "family": "upload", + "endpoint": "upload-file-new" +} diff --git a/pkg/domain/reference/upload/upload-url-new.json b/pkg/domain/reference/upload/upload-url-new.json new file mode 100644 index 0000000..dbab8a4 --- /dev/null +++ b/pkg/domain/reference/upload/upload-url-new.json @@ -0,0 +1,373 @@ +{ + "examples": [], + "links": [ + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-0000002092927786", + "title": "Upload Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114", + "title": "使用入门" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section1785535363715", + "title": "通过Service Account方式获取授权" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section103mcpsimp", + "title": "创建API客户端" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-obtain_token-0000001158365043", + "title": "获取Token" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-getteamlist-0000001158245075", + "title": "获取团队列表" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114#section949717114392", + "title": "获取用户授权码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#ZH-CN_TOPIC_0000001111685200__p1474451117", + "title": "ConnectRet" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#ZH-CN_TOPIC_0000001111685200__zh-cn_topic_0000001057512485_p173701128151713", + "title": "CommonUrlInfo" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-errorcode-harmonyos-0000002123259325", + "title": "错误码" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-uploadapi-0000002092927786", + "title": "Upload Management API" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-file-new-0000001111845090", + "title": "上传文件" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section10647983", + "title": "功能介绍" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section6932219103913", + "title": "接口原型" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section44860761", + "title": "请求参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165", + "title": "Header" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "title": "Query" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section1093665", + "title": "响应参数" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section8439614104314", + "title": "调用示例" + }, + { + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/start/useragreement-0000001494912825", + "title": "华为开发者联盟用户协议" + } + ], + "notes": [ + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section10647983", + "text": "上传文件至AppGallery Connect前需要先调用此接口获取上传地址,包括图片、视频、PDF等文件。接口调用者的角色:账号持有者、管理员、APP管理员、运营。" + }, + { + "section": "功能介绍", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section10647983", + "text": "此接口当前支持获取上传地址的应用软件包格式包括APK、AAB、RPK、EXE(Windows应用软件包)。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165", + "text": "本接口支持使用Service Account方式、API客户端方式和OAuth客户端方式,区别请参见使用入门。" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165", + "text": "Service Account方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165", + "text": "API客户端方式:" + }, + { + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165", + "text": "OAuth客户端方式:" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section1093665", + "text": "获取的上传URL有效期约为5分钟,超时后此URL将失效,需重新调用接口获取上传URL。" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section1093665", + "text": "ConnectRet" + }, + { + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section1093665", + "text": "CommonUrlInfo" + } + ], + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200", + "status": "browser-read", + "tables": [ + { + "location": "", + "rows": [ + [ + "承载协议", + "HTTPS GET" + ], + [ + "接口方向", + "开发者服务器 -> 华为服务器" + ], + [ + "接口URL", + "https://connect-api.cloud.huawei.com/api/publish/v2/upload-url/for-obs" + ], + [ + "数据格式", + "请求:Content-Type: application/json 响应:Content-Type: application/json" + ] + ], + "section": "接口原型", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section6932219103913" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${JWT}”。JWT为通过Service Account方式获取授权中获取的鉴权令牌。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "client_id", + "M", + "String", + "客户端ID,获取方法参考创建API客户端。" + ], + [ + "Authorization", + "M", + "String", + "认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165" + }, + { + "location": "header", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "teamId", + "M", + "String", + "开发者所在团队的团队ID,可通过获取团队列表接口获取。" + ], + [ + "oauth2Token", + "M", + "String", + "认证信息,传入获取用户授权码中获取的Access Token。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section236517415165" + }, + { + "location": "query", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "appId", + "M", + "String(32)", + "应用ID。" + ], + [ + "fileName", + "M", + "String(256)", + "原始文件名,需包含文件后缀。主要用于在生成上传地址时获取原始文件后缀。" + ], + [ + "sha256", + "O", + "String(64)", + "文件内容的SHA256哈希值,如果传入此参数,文件在上传到文件服务器后会执行完整性校验。如果不传则不做校验。" + ], + [ + "contentLength", + "M", + "Integer", + "文件内容的大小,单位:字节。" + ], + [ + "releaseType", + "O", + "Integer", + "发布方式。 取值范围: 1:全网发布。 默认值:1" + ], + [ + "chineseMainlandFlag", + "O", + "Integer", + "软件包是否分发中国大陆(不包括港澳台)。 取值范围: 0:不分发中国大陆 1:分发中国大陆 说明 当开发者注册地非中国大陆时,必须设置chineseMainlandFlag参数。" + ] + ], + "section": "请求参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "ret", + "M", + "ConnectRet", + "包含返回码及描述信息的结果。" + ], + [ + "urlInfo", + "M", + "CommonUrlInfo", + "文件上传信息,包含请求方法、文件上传URL、请求头等信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section1093665" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "code", + "O", + "Integer", + "返回码,请参见错误码。" + ], + [ + "msg", + "O", + "String", + "返回码描述信息。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section1093665" + }, + { + "location": "", + "rows": [ + [ + "参数名称", + "必选(M)/可选(O)", + "类型", + "参数说明" + ], + [ + "objectId", + "M", + "String", + "文件在文件服务器中的对象ID。" + ], + [ + "url", + "M", + "String", + "文件的上传URL,格式为https://{domainname}.com/{objectId}。" + ], + [ + "method", + "M", + "String", + "HTTP请求方法。获取文件上传地址时固定返回PUT。" + ], + [ + "headers", + "O", + "Map", + "使用文件上传URL上传文件到文件服务器时,请求头所需的参数,为JSON结构,格式为:{\"Authorization\":\"***\",\"x-amz-content-sha256\":\"***\",\"x-amz-date\":\"***\",\"Host\":\"***\",\"user-agent\":\"***\",\"Content-Type\":\"***\"}。 具体说明请参见上传文件接口。" + ] + ], + "section": "响应参数", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section1093665" + } + ], + "title": "获取文件上传地址", + "updatedAt": "2026-05-26 15:34", + "checkedAt": "2026-10-07T02:53:06.315Z", + "family": "upload", + "endpoint": "upload-url-new" +} diff --git a/pkg/domain/reference/upload/upload-url-new.parameters.json b/pkg/domain/reference/upload/upload-url-new.parameters.json new file mode 100644 index 0000000..f8efe35 --- /dev/null +++ b/pkg/domain/reference/upload/upload-url-new.parameters.json @@ -0,0 +1,60 @@ +[ + { + "name": "appId", + "in": "query", + "type": "string", + "required": true, + "description": "应用ID。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "maxLength": 32 + }, + { + "name": "fileName", + "in": "query", + "type": "string", + "required": true, + "description": "原始文件名,需包含文件后缀。主要用于在生成上传地址时获取原始文件后缀。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "maxLength": 256 + }, + { + "name": "sha256", + "in": "query", + "type": "string", + "required": false, + "description": "文件内容的SHA256哈希值,如果传入此参数,文件在上传到文件服务器后会执行完整性校验。如果不传则不做校验。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "maxLength": 64 + }, + { + "name": "contentLength", + "in": "query", + "type": "integer", + "required": true, + "description": "文件内容的大小,单位:字节。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209" + }, + { + "name": "releaseType", + "in": "query", + "type": "integer", + "required": false, + "description": "发布方式。 取值范围: 1:全网发布。 默认值:1", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "enum": [ + "1" + ] + }, + { + "name": "chineseMainlandFlag", + "in": "query", + "type": "integer", + "required": false, + "description": "软件包是否分发中国大陆(不包括港澳台)。 取值范围: 0:不分发中国大陆 1:分发中国大陆 说明 当开发者注册地非中国大陆时,必须设置chineseMainlandFlag参数。", + "sourceUrl": "https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-References/agcapi-upload-url-new-0000001111685200#section798917276209", + "enum": [ + "0", + "1" + ] + } +] diff --git a/pkg/domain/reference_discovery_test.go b/pkg/domain/reference_discovery_test.go new file mode 100644 index 0000000..7d32b97 --- /dev/null +++ b/pkg/domain/reference_discovery_test.go @@ -0,0 +1,21 @@ +package domain + +import "testing" + +// Discovery returns small metadata. It must not allocate proportional to every +// embedded request/response example each time a CLI command tree is constructed. +func TestEndpointDiscoveryAllocationsStayBounded(t *testing.T) { + _ = AllEndpoints() + allocations := testing.AllocsPerRun(2, func() { _ = AllEndpoints() }) + if allocations > 5000 { + t.Fatalf("discovery allocated %.0f objects; large source documents should not be reparsed for each invocation", allocations) + } +} +func TestDiscoveredDocumentationIsIndependent(t *testing.T) { + e, _ := EndpointByID("cloud-auth", "register") + e.Documentation.Title = "changed" + again, _ := EndpointByID("cloud-auth", "register") + if again.Documentation.Title == "changed" { + t.Fatal("a caller mutated another discovery result") + } +} diff --git a/pkg/domain/reference_test.go b/pkg/domain/reference_test.go new file mode 100644 index 0000000..f687788 --- /dev/null +++ b/pkg/domain/reference_test.go @@ -0,0 +1,373 @@ +package domain + +import ( + "encoding/json" + "testing" +) + +// Agent discovery must include the actual browser-read source and the rule +// that explains why a conditional input is required, rather than a bare URL. +func TestEndpointDiscoveryIncludesBrowserReadReference(t *testing.T) { + e, _ := EndpointByID("publishing", "app-info-query-v3") + raw, _ := json.Marshal(e) + var data map[string]any + json.Unmarshal(raw, &data) + doc, ok := data["documentation"].(map[string]any) + if !ok { + t.Fatal("Agent discovery is missing embedded official documentation") + } + if doc["status"] != "browser-read" { + t.Fatal("documentation is not identified as browser-read") + } + if doc["sourceUrl"] != e.SourceURL { + t.Fatal("wrong source document attached") + } + rules, ok := data["rules"].([]any) + if !ok || len(rules) == 0 { + t.Fatal("conditional requirement is missing") + } +} + +func TestFileEndpointIncludesDeviceSpecificRequirements(t *testing.T) { + raw, ok := EndpointReference("publishing", "app-file-info-v3") + if !ok { + t.Fatal("missing file documentation") + } + var doc struct { + RelatedDocuments []struct { + Title string + Tables []json.RawMessage + } `json:"relatedDocuments"` + } + if err := json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + if len(doc.RelatedDocuments) < 4 || doc.RelatedDocuments[0].Title != "应用文件要求" || len(doc.RelatedDocuments[0].Tables) != 2 { + t.Fatal("device and application-kind appendix missing from Agent docs") + } +} + +func TestBatchOperationsHaveDocumentedRequestBodies(t *testing.T) { + for _, platform := range []string{"android", "harmonyosnext"} { + for _, operation := range []string{"batchactproduct", "batchdeactproduct", "batchaddproduct", "batchupdateproduct", "batchactpromotion", "batchdeactpromotion"} { + id := operation + "-" + platform + t.Run(id, func(t *testing.T) { + e, _ := EndpointByID("pms", id) + fields := map[string]Parameter{} + for _, p := range e.Parameters { + if p.In == "body" { + fields[p.Name] = p + } + } + if p := fields["requestId"]; !p.Required || p.Type != "string" { + t.Fatal("missing required request identifier") + } + list := "products" + items := "string" + if operation == "batchactpromotion" || operation == "batchdeactpromotion" { + list = "promotions" + } + if operation == "batchaddproduct" || operation == "batchupdateproduct" { + items = "object" + } + p := fields[list] + if !p.Required || p.Type != "array" || p.ItemsType != items { + t.Fatalf("incorrect %s list contract: %+v", list, p) + } + if list == "promotions" && p.MaxItems != 100 { + t.Fatal("missing documented promotion list maximum") + } + }) + } + } +} + +func TestBatchImportDocumentsIncludePlatformSpecificModels(t *testing.T) { + for _, platform := range []string{"android", "harmonyosnext"} { + raw, ok := EndpointReference("pms", "batchaddproduct-"+platform) + if !ok { + t.Fatal("missing batch documentation") + } + var doc struct { + RelatedDocuments []struct { + Title string + SourceURL string `json:"sourceUrl"` + } `json:"relatedDocuments"` + } + if err := json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + if len(doc.RelatedDocuments) != 5 { + t.Fatalf("%s missing linked import/price/language/promotion source documents", platform) + } + for _, model := range doc.RelatedDocuments { + if model.SourceURL == "" || model.Title == "" { + t.Fatal("model lacks official provenance") + } + } + } +} + +func TestProductQueryAndReviewExposeActualTableFields(t *testing.T) { + for _, platform := range []string{"android", "harmonyosnext"} { + e, _ := EndpointByID("pms", "bygetproductinfo-"+platform) + found := map[string]Parameter{} + for _, p := range e.Parameters { + found[p.In+"."+p.Name] = p + } + for _, name := range []string{"requestId", "productNo", "productName", "purchaseType", "status", "orderBy", "beginTime", "endTime", "pageNum", "pageSize", "country", "groupId"} { + p, ok := found["body."+name] + if !ok { + t.Errorf("%s missing documented query field %s", platform, name) + } + if p.SourceURL == "" { + t.Errorf("%s.%s lacks source paragraph", platform, name) + } + } + if found["body.pageNum"].Type != "integer" { + t.Error("pagination lost JSON integer type") + } + } + e, _ := EndpointByID("pms", "reviewproduct-harmonyosnext") + for _, p := range e.Parameters { + if p.Name == "productIdList" && p.In == "body" && p.Type == "array" && p.ItemsType == "string" && p.Required { + return + } + } + t.Fatal("missing documented product review list") +} + +func TestReportOpenAPIAcceptsScalarOrRepeatedRequiredQueryInputs(t *testing.T) { + spec := OpenAPISpec() + path := spec["paths"].(map[string]any)["/api/v1/reports/endpoints/appdownloadexport/invoke"].(map[string]any) + schema := path["post"].(map[string]any)["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + for _, name := range schema["required"].([]string) { + if name == "query" { + t.Fatal("schema rejects requests supplied exclusively through queryValues") + } + } + alternatives, ok := schema["allOf"].([]any) + if !ok || len(alternatives) != 3 { + t.Fatal("missing alternatives for language/startTime/endTime") + } +} + +func TestDomainConfigApplicationIdentityUsesDocumentedLocation(t *testing.T) { + for _, tc := range []struct{ id, in string }{{"domain-api-get-domain-config", "query"}, {"domain-api-download-domain-config", "header"}} { + e, _ := EndpointByID("domains", tc.id) + found := false + for _, p := range e.Parameters { + if p.Name == "appId" { + if p.In != tc.in || !p.Required || p.Type != "string" || p.MaxLength != 32 || p.SourceURL == "" { + t.Fatalf("%s has wrong application contract: %+v", tc.id, p) + } + found = true + } + } + if !found { + t.Fatal("missing application identity") + } + } +} + +func TestProjectLookupExposesDocumentedIdentifiersAndPagination(t *testing.T) { + for _, tc := range []struct { + id, in, name, kind string + required bool + }{ + {"appbriefinfo", "header", "userID", "integer", true}, + {"appbriefinfo", "query", "packageNames", "string", false}, + {"appbriefinfo", "query", "fromRecCount", "integer", false}, + {"appbriefinfo", "query", "maxReqCount", "integer", false}, + {"queryservice", "query", "appID", "integer", true}, + {"queryappfingerprint", "header", "uid", "string", true}, + {"queryappfingerprint", "header", "teamId", "string", true}, + } { + e, _ := EndpointByID("projects", tc.id) + found := false + for _, p := range e.Parameters { + if p.Name == tc.name && p.In == tc.in { + found = true + if p.Type != tc.kind || p.Required != tc.required || p.SourceURL == "" { + t.Errorf("%s incorrect documented field: %+v", tc.id, p) + } + } + } + if !found { + t.Errorf("%s missing %s.%s", tc.id, tc.in, tc.name) + } + } +} + +func TestProvisioningContractsUseDocumentedTypesAndBounds(t *testing.T) { + for _, tc := range []struct { + id, name, kind string + max int + }{ + {"provision-api-applyacl", "aclPermissionList", "array", 0}, + {"provision-api-apply-provision", "aclPermissionList", "array", 1000}, + {"provision-api-apply-provision", "deviceIdList", "array", 4000}, + {"provision-api-add-device", "deviceList", "array", 1000}, + } { + e, _ := EndpointByID("provisioning", tc.id) + found := false + for _, p := range e.Parameters { + if p.In == "body" && p.Name == tc.name { + found = true + if p.Type != tc.kind || p.MaxItems != tc.max || p.SourceURL == "" { + t.Errorf("%s.%s wrong source contract: %+v", tc.id, tc.name, p) + } + } + } + if !found { + t.Errorf("%s missing %s", tc.id, tc.name) + } + } +} + +func TestTestingMemberQueryUsesOfficialQueryFields(t *testing.T) { + e, _ := EndpointByID("testing", "test-api-query-test-user") + for _, name := range []string{"appId", "groupId", "current", "pageSize"} { + found := false + for _, p := range e.Parameters { + if p.Name == name && p.In == "query" && p.SourceURL != "" { + found = true + } + } + if !found { + t.Errorf("missing official query.%s", name) + } + } +} + +func TestFeedbackContractsExposeActualRootModels(t *testing.T) { + for _, tc := range []struct{ id, name, kind string }{{"test-api-query-feedback", "models", "array"}, {"test-api-query-feedback", "currentPage", "integer"}, {"test-api-delete-feedback", "delFeedBackInfos", "array"}, {"test-api-delete-feedback", "deleteMode", "integer"}} { + e, _ := EndpointByID("testing", tc.id) + found := false + for _, p := range e.Parameters { + if p.In == "body" && p.Name == tc.name && p.Type == tc.kind && p.SourceURL != "" { + found = true + } + } + if !found { + t.Errorf("%s missing actual root field %s", tc.id, tc.name) + } + } +} + +func TestResourceRequestsUseActualRootAndNestedFields(t *testing.T) { + for _, tc := range []struct{ id, name, kind string }{{"respackapi-addversion", "resourceVersion", "object"}, {"respackapi-uploadapplyfor", "filePartApplyInfo", "array"}, {"respackapi-uploadconfirm", "filePartConfirmInfos", "array"}} { + e, _ := EndpointByID("resources", tc.id) + found := false + for _, p := range e.Parameters { + if p.Name == tc.name && p.In == "body" && p.Type == tc.kind { + found = true + if len(p.Properties)+len(p.ItemsProperties) == 0 { + t.Error("missing reviewed nested fields") + } + } + } + if !found { + t.Errorf("%s missing actual root %s", tc.id, tc.name) + } + } +} + +func TestResourceRootFieldsRetainTheirOwnParagraphs(t *testing.T) { + e, _ := EndpointByID("resources", "respackapi-uploadapplyfor") + for _, p := range e.Parameters { + if p.Name == "fileLength" && p.In == "body" { + if p.Description != "升级包文件大小(字节数)。" { + t.Fatalf("nested part table overwrote root description: %s", p.Description) + } + return + } + } + t.Fatal("missing root fileLength") +} + +func TestCommentReplyContractsFollowPlatformSpecificTypes(t *testing.T) { + for _, tc := range []struct{ id, name, in, kind string }{{"com-reviewreply-harmonyos", "reviewId", "body", "integer"}, {"com-reviewreply", "reviewId", "body", "string"}, {"com-reviewreply", "requestId", "header", "string"}, {"comapi-getreviews", "apkVersions", "query", "string"}} { + e, _ := EndpointByID("comments", tc.id) + found := false + for _, p := range e.Parameters { + if p.Name == tc.name && p.In == tc.in && p.Type == tc.kind && p.SourceURL != "" { + found = true + } + } + if !found { + t.Errorf("%s missing documented %s.%s %s", tc.id, tc.in, tc.name, tc.kind) + } + } +} + +func TestUploadAddressExposesDocumentedLengthsAndEnums(t *testing.T) { + e, _ := EndpointByID("upload", "upload-url-new") + for _, tc := range []struct { + name string + max int + }{{"appId", 32}, {"fileName", 256}, {"sha256", 64}} { + found := false + for _, p := range e.Parameters { + if p.Name == tc.name && p.In == "query" { + found = true + if p.MaxLength != tc.max { + t.Errorf("%s missing documented maximum %d", tc.name, tc.max) + } + } + } + if !found { + t.Errorf("missing query.%s", tc.name) + } + } + for _, p := range e.Parameters { + if p.Name == "releaseType" && (len(p.Enum) != 1 || p.Enum[0] != "1") { + t.Fatal("upload releaseType lost documented allowed value") + } + } +} + +func TestGameplayContractsSeparateHeadersAndJSONBody(t *testing.T) { + e, _ := EndpointByID("gameplay", "basic-info") + found := map[string]Parameter{} + for _, p := range e.Parameters { + found[p.In+"."+p.Name] = p + } + for _, name := range []string{"appId", "timestamp", "nonce", "sign"} { + if !found["header."+name].Required { + t.Errorf("missing mandatory signature header %s", name) + } + } + users := found["body.userIds"] + if users.Type != "array" || users.ItemsType != "object" || len(users.ItemsProperties) != 2 { + t.Fatal("missing reviewed player list model") + } +} + +func TestGameResourceOpenAPIPreservesJSONStringEncoding(t *testing.T) { + e, _ := EndpointByID("gameplay", "resources") + body := invokeRequestSchemaProperties(e)["body"].(map[string]any) + resource := body["properties"].(map[string]any)["resources"].(map[string]any) + if resource["type"] != "string" || resource["contentMediaType"] != "application/json" { + t.Fatal("resource JSON string wire type was lost") + } + inner := resource["contentSchema"].(map[string]any) + if inner["type"] != "array" || inner["maxItems"] != 50 { + t.Fatal("missing resource array contract") + } +} + +func TestLegacyPublishingRootAndNestedContracts(t *testing.T) { + for _, tc := range []struct{ id, name, kind string }{{"add-packageurl", "downloadFileName", "string"}, {"app-info-update", "privacyPolicy", "string"}, {"app-submit-with-file", "phasedReleaseInfo", "object"}} { + e, _ := EndpointByID("publishing", tc.id) + found := false + for _, p := range e.Parameters { + if p.In == "body" && p.Name == tc.name && p.Type == tc.kind && p.SourceURL != "" { + found = true + } + } + if !found { + t.Errorf("%s missing actual field %s", tc.id, tc.name) + } + } +} diff --git a/pkg/domain/resources_prerequisite_docs_test.go b/pkg/domain/resources_prerequisite_docs_test.go new file mode 100644 index 0000000..4025a53 --- /dev/null +++ b/pkg/domain/resources_prerequisite_docs_test.go @@ -0,0 +1,34 @@ +package domain + +import ( + "encoding/json" + "strings" + "testing" +) + +func TestResourceDocsExposeDeveloperIDGuide(t *testing.T) { + for _, endpoint := range EndpointsByFamily("resources") { + raw, ok := EndpointReference("resources", endpoint.ID) + if !ok { + t.Fatalf("missing reference %s", endpoint.ID) + } + var doc struct { + RelatedDocuments []struct { + SourceURL string `json:"sourceUrl"` + RenderedText string `json:"renderedText"` + } `json:"relatedDocuments"` + } + if err := json.Unmarshal(raw, &doc); err != nil { + t.Fatal(err) + } + found := false + for _, related := range doc.RelatedDocuments { + if strings.Contains(related.SourceURL, "agc-get-developerid-projectid-0000001166543063") && strings.Contains(related.RenderedText, "Developer ID and Project ID") { + found = true + } + } + if !found { + t.Fatalf("developer ID prerequisite guide absent for %s", endpoint.ID) + } + } +} diff --git a/pkg/domain/serverless.go b/pkg/domain/serverless.go new file mode 100644 index 0000000..af087de --- /dev/null +++ b/pkg/domain/serverless.go @@ -0,0 +1,63 @@ +package domain + +import "encoding/json" + +// Serverless contracts are generated from browser-read official parameter tables, +// then source-reviewed overrides. They do not share the publishing credential type. +func init() { + raw, err := referenceDocuments.ReadFile("reference/serverless/endpoints.json") + if err != nil { + panic(err) + } + var endpoints []Endpoint + if err = json.Unmarshal(raw, &endpoints); err != nil { + panic(err) + } + for _, e := range endpoints { + e.Body = inferBody(e.Method, e.Parameters) + for _, p := range e.Parameters { + if p.Required { + e.RequiredParams = append(e.RequiredParams, p.Name) + } + } + EndpointFamilies[e.FamilyID] = append(EndpointFamilies[e.FamilyID], e) + } + raw, err = referenceDocuments.ReadFile("reference/management/endpoints.json") + if err != nil { + panic(err) + } + // Unmarshal reuses non-nil slice elements and retains omitted struct fields. + // Management parameters must not inherit enums/bounds from the REST catalog. + endpoints = nil + if err = json.Unmarshal(raw, &endpoints); err != nil { + panic(err) + } + for _, e := range endpoints { + e.Body = inferBody(e.Method, e.Parameters) + for _, p := range e.Parameters { + if p.Required { + e.RequiredParams = append(e.RequiredParams, p.Name) + } + } + EndpointFamilies[e.FamilyID] = append(EndpointFamilies[e.FamilyID], e) + } + for _, c := range []struct{ id, name, description string }{ + {"cloud-auth", "Cloud Authentication", "Client sign-in and server user management; separate from developer authorization."}, + {"clouddb", "Cloud DB for Object", "Client REST data operations plus source-reviewed schema, zone and async-process management with explicit user sessions."}, + {"storage", "Cloud Storage", "File bytes, metadata and listing through server REST."}, + {"hosting", "Cloud Hosting", "Website sites, environments, signed ZIP uploads and version lifecycle."}, + {"templates", "Serverless Templates", "Authentication callbacks and source-reviewed SAM application/plan/deployment workflows; console gallery templates are distinct."}, + {"cache", "Cloud Cache", "Official AGCLI source management and Redis-command transport using an explicit user session."}, + {"prefetch", "Prefetch", "Browser-reviewed developer-server protocol simulation and device debugging; not a cloud configuration API."}, + } { + Capabilities = append(Capabilities, Capability{ID: c.id, Name: c.name, Description: c.description, Command: "agc " + c.id, RESTPath: "/api/v1/" + c.id, Status: "registered"}) + } +} + +func IsServerlessFamily(family string) bool { + switch family { + case "cloud-auth", "clouddb", "storage", "hosting", "templates", "functions", "cache", "prefetch": + return true + } + return false +} diff --git a/pkg/domain/serverless_contract_test.go b/pkg/domain/serverless_contract_test.go new file mode 100644 index 0000000..0909115 --- /dev/null +++ b/pkg/domain/serverless_contract_test.go @@ -0,0 +1,93 @@ +package domain + +import ( + "encoding/json" + "testing" +) + +func TestServerlessOfficialHTTPFamilies(t *testing.T) { + for family, want := range map[string]int{"cloud-auth": 17, "clouddb": 5, "storage": 6, "hosting": 16, "templates": 2} { + got := EndpointsByFamily(family) + publicCount := 0 + for _, e := range got { + if e.Authentication == "agcli-management-cookie" || e.Authentication == "agcli-management-oauth" { + continue + } + publicCount++ + raw, ok := EndpointReference(family, e.ID) + if !ok || !json.Valid(raw) { + t.Errorf("%s missing readable source", e.Command) + } + if e.Documentation == nil || e.Documentation.Status != "browser-read" { + t.Errorf("%s missing reviewed provenance", e.Command) + } + } + if publicCount != want { + t.Errorf("%s public HTTP operations=%d want %d", family, publicCount, want) + } + } +} +func TestServerlessSourceContracts(t *testing.T) { + // Independent assertions from official parameter tables/examples, not registry-derived fixtures. + e, ok := EndpointByID("hosting", "upload-url") + if !ok { + t.Fatal("hosting upload-url missing") + } + p := findServerlessParameter(e.Parameters, "materialInfos") + if p.Type != "array" || p.ItemsType != "object" { + t.Fatal("materialInfos must be object array") + } + f := findServerlessParameter(p.ItemsProperties, "contentType") + if !f.Required || len(f.Enum) != 1 || f.Enum[0] != "902" { + t.Fatal("nested contentType=902 required") + } + e, _ = EndpointByID("cloud-auth", "export-users") + p = findServerlessParameter(e.Parameters, "client_id") + if p.Required { + t.Fatal("Service Account alternative must not require client_id") + } + e, _ = EndpointByID("clouddb", "query-data") + p = findServerlessParameter(findServerlessParameter(e.Parameters, "queryReqMsg").Properties, "queryCond") + if p.Type != "string" || p.EncodedJSON == nil { + t.Fatal("queryCond must retain encoded JSON string") + } + e, _ = EndpointByID("templates", "player-id") + if e.Direction != "inbound-callback" { + t.Fatal("player-id is a developer callback") + } + e, _ = EndpointByID("storage", "update-metadata") + if e.Method != "GET" { + t.Fatal("official metadata-update verb is GET; preserve source") + } +} +func findServerlessParameter(ps []Parameter, name string) Parameter { + for _, p := range ps { + if p.Name == name { + return p + } + } + return Parameter{} +} + +func TestServerlessFileAndNativeOpenAPI(t *testing.T) { + spec := OpenAPISpec()["paths"].(map[string]any) + for _, op := range []string{"/api/v1/storage/endpoints/upload-file/invoke", "/api/v1/hosting/endpoints/upload-version/invoke"} { + schema := spec[op].(map[string]any)["post"].(map[string]any)["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + required := schema["required"].([]string) + has := false + for _, n := range required { + if n == "fields" { + t.Fatal("binary upload incorrectly requires fields") + } + has = has || n == "filePath" + } + if !has { + t.Fatal("binary upload requires explicit filePath") + } + } + schema := FunctionSchema() + p := schema["properties"].(map[string]any) + if p["timeout"].(map[string]any)["maximum"] != 1800 { + t.Fatal("native timeout bound absent from schema") + } +} diff --git a/pkg/domain/serverless_management_test.go b/pkg/domain/serverless_management_test.go new file mode 100644 index 0000000..1807463 --- /dev/null +++ b/pkg/domain/serverless_management_test.go @@ -0,0 +1,62 @@ +package domain + +import ( + "encoding/json" + "strings" + "testing" +) + +func TestReviewedManagementDiscovery(t *testing.T) { + for family, operations := range map[string][]string{ + "cache": {"execute-command", "connection-info", "usage"}, + "clouddb": {"schema-versions", "get-object-type", "create-object-type", "update-object-type", "import-object-types", "list-zones", "create-zone", "delete-zone"}, + "functions": {"create-alias", "get-alias", "list-aliases", "update-alias", "delete-alias", "create-http-trigger", "create-cron-trigger", "get-http-trigger", "get-trigger", "delete-http-trigger", "delete-trigger", "update-cron-trigger", "list-layers", "list-layer-versions", "get-layer-version", "create-layer-version"}, + "templates": {"search-applications", "create-application", "create-plan", "get-plan", "apply-plan"}, + "prefetch": {"fetch-install", "fetch-periodic", "fetch-deferred"}, + } { + for _, id := range operations { + t.Run(family+"/"+id, func(t *testing.T) { + e, ok := EndpointByID(family, id) + if !ok { + t.Fatalf("missing reviewed operation %s/%s", family, id) + } + if e.Method == "" || e.SourceURL == "" { + t.Fatal("missing method/source contract") + } + if _, ok := EndpointReference(family, id); !ok { + t.Fatal("missing embedded evidence") + } + }) + } + } +} + +func TestPrefetchDocsRetainFullLinkedConfigurationGuide(t *testing.T) { + raw, ok := EndpointReference("prefetch", "fetch-periodic") + if !ok { + t.Fatal("docs absent") + } + var doc struct { + RelatedDocuments []struct{ SourceURL, RenderedText string } + } + if json.Unmarshal(raw, &doc) != nil { + t.Fatal("invalid document") + } + for _, related := range doc.RelatedDocuments { + if strings.HasSuffix(related.SourceURL, "cloudfoundation-prefetch-config") && strings.Contains(related.RenderedText, "仅支持填写一个服务器地址") { + return + } + } + t.Fatal("full source configuration guide was replaced by unrelated supplements") +} + +func TestAliasMapOpenAPIContainsDynamicWeightContract(t *testing.T) { + e, _ := EndpointByID("functions", "create-alias") + props := invokeRequestSchemaProperties(e) + body := props["body"].(map[string]any)["properties"].(map[string]any) + routing := body["routingConfig"].(map[string]any) + values, ok := routing["additionalProperties"].(map[string]any) + if !ok || values["type"] != "integer" || values["minimum"] != int64(0) || values["maximum"] != int64(100) || routing["maxProperties"] != 2 { + t.Fatalf("missing dynamic version-weight shape: %+v", routing) + } +} diff --git a/pkg/domain/test_package_contract_test.go b/pkg/domain/test_package_contract_test.go new file mode 100644 index 0000000..9df4bf9 --- /dev/null +++ b/pkg/domain/test_package_contract_test.go @@ -0,0 +1,18 @@ +package domain + +import "testing" + +func TestTestPackageMetadataContract(t *testing.T) { + e, _ := EndpointByID("testing", "test-api-add-test-package") + for _, expected := range []struct{ name, where, kind string }{{"appId", "query", "string"}, {"file", "body", "object"}} { + found := false + for _, p := range e.Parameters { + if p.Name == expected.name && p.In == expected.where && p.Type == expected.kind && p.Required { + found = true + } + } + if !found { + t.Errorf("missing required %s in %s of type %s", expected.name, expected.where, expected.kind) + } + } +} diff --git a/pkg/domain/testing_ai_enum_openapi_test.go b/pkg/domain/testing_ai_enum_openapi_test.go new file mode 100644 index 0000000..a998a93 --- /dev/null +++ b/pkg/domain/testing_ai_enum_openapi_test.go @@ -0,0 +1,17 @@ +package domain + +import ( + "reflect" + "testing" +) + +func TestTestingAITypeOpenAPIUsesOfficialIntegerItemEnums(t *testing.T) { + op := OpenAPISpec()["paths"].(map[string]any)["/api/v1/testing/endpoints/test-api-modify-test-version/invoke"].(map[string]any)["post"].(map[string]any) + schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + body := schema["properties"].(map[string]any)["body"].(map[string]any) + ext := body["properties"].(map[string]any)["extInfo"].(map[string]any) + items := ext["properties"].(map[string]any)["aiTypes"].(map[string]any)["items"].(map[string]any) + if items["type"] != "integer" || !reflect.DeepEqual(items["enum"], []int64{-1, 1, 2, 3, 4, 5}) { + t.Fatalf("AI service item schema differs from reviewed official model: %#v", items) + } +} diff --git a/pkg/domain/testing_contract_test.go b/pkg/domain/testing_contract_test.go index cf4e19a..3baa135 100644 --- a/pkg/domain/testing_contract_test.go +++ b/pkg/domain/testing_contract_test.go @@ -73,22 +73,12 @@ func TestVersionListAllowsTestDraftReadback(t *testing.T) { func TestDedicatedAppCreationContract(t *testing.T) { ep, ok := EndpointByID("publishing", "app-create") - if !ok || ep.Path != "/api/publish/v3/app" || ep.Method != "POST" { - t.Fatal("缺少专用测试应用创建接口") - } + if !ok || ep.Path != "/api/publish/v3/app" || ep.Method != "POST" { t.Fatal("缺少专用测试应用创建接口") } for _, name := range []string{"appName", "parentType", "installationFree"} { found := false - for _, p := range ep.Parameters { - if p.Name == name && p.In == "body" && p.Required { - found = true - } - } - if !found { - t.Fatalf("缺少创建应用字段 %s", name) - } + for _, p := range ep.Parameters { if p.Name == name && p.In == "body" && p.Required { found = true } } + if !found { t.Fatalf("缺少创建应用字段 %s", name) } } info, ok := EndpointByID("publishing", "app-info-query-v3") - if !ok || info.Path != "/api/publish/v3/app-info" { - t.Fatal("缺少 HarmonyOS V3 应用信息读回") - } + if !ok || info.Path != "/api/publish/v3/app-info" { t.Fatal("缺少 HarmonyOS V3 应用信息读回") } } diff --git a/pkg/domain/testing_members_contract_test.go b/pkg/domain/testing_members_contract_test.go new file mode 100644 index 0000000..fa9f527 --- /dev/null +++ b/pkg/domain/testing_members_contract_test.go @@ -0,0 +1,30 @@ +package domain + +import "testing" + +func TestTestingMemberContractsMatchOfficialBodyModels(t *testing.T) { + for _, c := range []struct { + id, name, kind string + required bool + }{ + {"test-api-add-test-group-user", "groupId", "string", true}, + {"test-api-add-test-group-user", "hwAccount", "string", true}, + {"test-api-add-test-group-user", "nickName", "string", false}, + {"test-api-add-test-group-user", "uid", "string", false}, + {"test-api-delete-test-group-user", "groupId", "string", true}, + {"test-api-delete-test-group-user", "deleteTesterIds", "array", true}, + } { + t.Run(c.id+"/"+c.name, func(t *testing.T) { + e, _ := EndpointByID("testing", c.id) + for _, p := range e.Parameters { + if p.Name == c.name && p.In == "body" && p.Type == c.kind && p.Required == c.required { + if c.name == "deleteTesterIds" && (p.ItemsType != "string" || p.MaxItems != 100) { + t.Fatal("missing official string-array maximum") + } + return + } + } + t.Fatalf("official body field %s missing or wrong", c.name) + }) + } +} diff --git a/pkg/domain/testing_package_file_openapi_test.go b/pkg/domain/testing_package_file_openapi_test.go new file mode 100644 index 0000000..6ae9116 --- /dev/null +++ b/pkg/domain/testing_package_file_openapi_test.go @@ -0,0 +1,21 @@ +package domain + +import "testing" + +func TestTestingPackageFileOpenAPIMatchesOfficialModel(t *testing.T) { + op := OpenAPISpec()["paths"].(map[string]any)["/api/v1/testing/endpoints/test-api-add-test-package/invoke"].(map[string]any)["post"].(map[string]any) + schema := op["requestBody"].(map[string]any)["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any) + body := schema["properties"].(map[string]any)["body"].(map[string]any) + file := body["properties"].(map[string]any)["file"].(map[string]any) + props := file["properties"].(map[string]any) + for name, limit := range map[string]int{"fileName": 255, "objectId": 1024} { + p := props[name].(map[string]any) + if p["type"] != "string" || p["maxLength"] != limit { + t.Fatalf("wrong official %s schema: %v", name, p) + } + } + required := file["required"].([]string) + if len(required) != 2 { + t.Fatalf("missing FileInfo requirements: %v", required) + } +} diff --git a/pkg/domain/testing_voc_contract_test.go b/pkg/domain/testing_voc_contract_test.go new file mode 100644 index 0000000..2cb7b41 --- /dev/null +++ b/pkg/domain/testing_voc_contract_test.go @@ -0,0 +1,29 @@ +package domain + +import ( + "strings" + "testing" +) + +func TestTestingResolvedIssueContractIncludesReviewedModel(t *testing.T) { + e, _ := EndpointByID("testing", "test-api-modify-test-version") + for _, p := range e.Parameters { + if p.Name != "versionVocReq" { + continue + } + if p.MaxItems != 1000 || len(p.ItemsProperties) != 3 { + t.Fatalf("incomplete issue contract: %+v", p) + } + for _, child := range p.ItemsProperties { + if !child.Required || child.Type != "string" || child.MaxLength != 32 || !strings.Contains(child.SourceURL, "versionvocreq") { + t.Fatalf("wrong issue identifier contract: %+v", child) + } + } + raw, _ := EndpointReference(e.FamilyID, e.ID) + if !strings.Contains(string(raw), `"title":"VersionVocReq"`) { + t.Fatal("Agent docs omit the reviewed issue model") + } + return + } + t.Fatal("missing versionVocReq") +} diff --git a/pkg/domain/upload_contract_test.go b/pkg/domain/upload_contract_test.go new file mode 100644 index 0000000..2e91459 --- /dev/null +++ b/pkg/domain/upload_contract_test.go @@ -0,0 +1,36 @@ +package domain + +import "testing" + +func TestMultipartInitDeclaresPackageKindAndOBBKind(t *testing.T) { + e, _ := EndpointByID("upload", "obbfile-init") + for _, name := range []string{"fileType", "obbType"} { + found := false + for _, p := range e.Parameters { + if p.Name == name && p.In == "query" && p.Type == "integer" && !p.Required { + found = true + } + } + if !found { + t.Errorf("official init query parameter %s missing", name) + } + } +} + +func TestMultipartQueryContracts(t *testing.T) { + for _, c := range []struct{ id, name string }{ + {"obbfile-init", "appId"}, {"obbfile-init", "fileName"}, + {"obbfile-uploadurl", "objectId"}, {"obbfile-uploadurl", "nspUploadId"}, + {"obbfile-compose", "objectId"}, {"obbfile-compose", "nspUploadId"}, + } { + t.Run(c.id+"/"+c.name, func(t *testing.T) { + e, _ := EndpointByID("upload", c.id) + for _, p := range e.Parameters { + if p.Name == c.name && p.In == "query" && p.Required { + return + } + } + t.Fatalf("missing required query %s", c.name) + }) + } +} diff --git a/pkg/hvigor/build.go b/pkg/hvigor/build.go new file mode 100644 index 0000000..444af8f --- /dev/null +++ b/pkg/hvigor/build.go @@ -0,0 +1,153 @@ +// Package hvigor executes local HarmonyOS builds without shell interpolation. +package hvigor + +import ( + "archive/zip" + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "strings" +) + +type Request struct { + Project string `json:"project"` + Executable string `json:"hvigorPath,omitempty"` + Product string `json:"product,omitempty"` + BuildMode string `json:"buildMode,omitempty"` + Task string `json:"task,omitempty"` +} + +type Artifact struct { + Path string `json:"path"` + Size int64 `json:"size"` + SHA256 string `json:"sha256"` +} + +type Result struct { + Project string `json:"project"` + Artifacts []Artifact `json:"artifacts"` +} + +// Build 执行固定 assembleHap 任务;项目路径作为工作目录而非 shell 命令。 +// 构建输出可能包含签名配置,不能原样写入 API 响应或错误信息。 +func Build(ctx context.Context, request Request) (Result, error) { + project, err := filepath.Abs(request.Project) + if err != nil || request.Project == "" { + return Result{}, fmt.Errorf("project directory required") + } + if info, err := os.Stat(filepath.Join(project, "build-profile.json5")); err != nil || !info.Mode().IsRegular() { + return Result{}, fmt.Errorf("project must contain build-profile.json5") + } + executable := request.Executable + if executable == "" { + executable = "/Applications/DevEco-Studio.app/Contents/tools/hvigor/bin/hvigorw" + if _, err := os.Stat(executable); err != nil { + executable = "hvigorw" + } + } + product := request.Product + if product == "" { + product = "default" + } + mode := request.BuildMode + if mode == "" { + mode = "debug" + } + if mode != "debug" && mode != "release" { + return Result{}, fmt.Errorf("buildMode must be debug or release") + } + task, buildScope, extension := request.Task, "module", ".hap" + if task == "" { + task = "assembleHap" + } + if task == "assembleApp" { + buildScope, extension = "project", ".app" + } else if task != "assembleHap" { + return Result{}, fmt.Errorf("task must be assembleHap or assembleApp") + } + command := exec.CommandContext(ctx, executable, "--mode", buildScope, "-p", "product="+product, "-p", "buildMode="+mode, task, "--no-daemon") + command.Dir = project + command.Env = os.Environ() + if os.Getenv("JAVA_HOME") == "" { + if _, err := os.Stat("/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home"); err == nil { + command.Env = append(command.Env, "JAVA_HOME=/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home") + } + } + if os.Getenv("DEVECO_SDK_HOME") == "" { + if _, err := os.Stat("/Applications/DevEco-Studio.app/Contents/sdk"); err == nil { + command.Env = append(command.Env, "DEVECO_SDK_HOME=/Applications/DevEco-Studio.app/Contents/sdk") + } + } + if err := command.Run(); err != nil { + if ctx.Err() != nil { + return Result{}, ctx.Err() + } + return Result{}, fmt.Errorf("Hvigor build failed: %T (build output withheld)", err) + } + result := Result{Project: project, Artifacts: []Artifact{}} + err = filepath.WalkDir(project, func(path string, entry os.DirEntry, walkErr error) error { + if walkErr != nil { + return walkErr + } + if entry.IsDir() && (entry.Name() == "oh_modules" || entry.Name() == ".git" || entry.Name() == ".hvigor") { + return filepath.SkipDir + } + if entry.IsDir() || filepath.Ext(path) != extension { + return nil + } + // 只返回所选产品的标准构建输出,排除其他产品缓存和项目中的样例 HAP。 + relative, err := filepath.Rel(project, path) + if err != nil { + return err + } + parts := strings.Split(relative, string(filepath.Separator)) + selected := false + for index := 0; index+3 < len(parts); index++ { + if (task == "assembleHap" && parts[index] == "build" && parts[index+1] == product && parts[index+2] == "outputs") || (task == "assembleApp" && parts[index] == "build" && parts[index+1] == "outputs" && parts[index+2] == product) { + selected = true + break + } + } + if !selected { + return nil + } + info, err := entry.Info() + if err != nil { + return err + } + if !info.Mode().IsRegular() { + return nil + } + archive, err := zip.OpenReader(path) + if err != nil { + return fmt.Errorf("build artifact is not a valid ZIP archive") + } + archive.Close() + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + digest := sha256.New() + if _, err := io.Copy(digest, file); err != nil { + return err + } + result.Artifacts = append(result.Artifacts, Artifact{Path: path, Size: info.Size(), SHA256: hex.EncodeToString(digest.Sum(nil))}) + return nil + }) + if err != nil { + return Result{}, err + } + if len(result.Artifacts) == 0 { + if task == "assembleHap" { + return Result{}, fmt.Errorf("Hvigor exited successfully but produced no HAP artifacts") + } + return Result{}, fmt.Errorf("Hvigor exited successfully but produced no APP artifacts") + } + return result, nil +} diff --git a/pkg/hvigor/build_test.go b/pkg/hvigor/build_test.go new file mode 100644 index 0000000..907b5ee --- /dev/null +++ b/pkg/hvigor/build_test.go @@ -0,0 +1,141 @@ +package hvigor + +import ( + "archive/zip" + "context" + "encoding/json" + "fmt" + "os" + "path/filepath" + "strings" + "testing" +) + +func TestBuildReturnsOnlySelectedProductOutputArtifacts(t *testing.T) { + project := t.TempDir() + if err := os.WriteFile(filepath.Join(project, "build-profile.json5"), []byte("{}"), 0600); err != nil { + t.Fatal(err) + } + executable := offlineHvigor(t, false) + selected := filepath.Join(project, "entry", "build", "default", "outputs", "default", "entry.hap") + for _, path := range []string{selected, filepath.Join(project, "entry", "build", "other", "outputs", "other", "entry.hap"), filepath.Join(project, "unrelated.hap")} { + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { + t.Fatal(err) + } + file, err := os.Create(path) + if err != nil { + t.Fatal(err) + } + archive := zip.NewWriter(file) + entry, err := archive.Create("module.json") + if err != nil { + t.Fatal(err) + } + if _, err := entry.Write([]byte("{}")); err != nil { + t.Fatal(err) + } + if err := archive.Close(); err != nil { + t.Fatal(err) + } + if err := file.Close(); err != nil { + t.Fatal(err) + } + } + result, err := Build(context.Background(), Request{Project: project, Executable: executable}) + if err != nil { + t.Fatal(err) + } + if len(result.Artifacts) != 1 || result.Artifacts[0].Path != selected { + t.Fatalf("unexpected product artifacts: %+v", result.Artifacts) + } +} + +func TestAppBuildSelectsProjectAPPInsteadOfModuleHAP(t *testing.T) { + project := t.TempDir() + if err := os.WriteFile(filepath.Join(project, "build-profile.json5"), []byte("{}"), 0600); err != nil { + t.Fatal(err) + } + executable := offlineHvigor(t, false) + for _, relative := range []string{"build/outputs/default/fixture.app", "entry/build/default/outputs/default/entry.hap", "build/outputs/other/fixture.app"} { + path := filepath.Join(project, relative) + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { + t.Fatal(err) + } + file, err := os.Create(path) + if err != nil { + t.Fatal(err) + } + archive := zip.NewWriter(file) + entry, err := archive.Create("pack.info") + if err != nil { + t.Fatal(err) + } + if _, err := entry.Write([]byte("{}")); err != nil { + t.Fatal(err) + } + if err := archive.Close(); err != nil { + t.Fatal(err) + } + if err := file.Close(); err != nil { + t.Fatal(err) + } + } + // JSON 输入与 CLI 一样,避免测试直接依赖新增 Go 字段而无法先复现旧行为。 + var request Request + if err := json.Unmarshal([]byte(`{"task":"assembleApp"}`), &request); err != nil { + t.Fatal(err) + } + request.Project, request.Executable = project, executable + result, err := Build(context.Background(), request) + if err != nil { + t.Fatal(err) + } + if len(result.Artifacts) != 1 || !strings.HasSuffix(result.Artifacts[0].Path, "fixture.app") { + t.Fatalf("APP build returned wrong artifacts: %+v", result.Artifacts) + } +} + +func TestBuildDoesNotAcceptSuccessfulProcessWithoutArtifact(t *testing.T) { + project := t.TempDir() + if err := os.WriteFile(filepath.Join(project, "build-profile.json5"), []byte("{}"), 0600); err != nil { + t.Fatal(err) + } + executable := offlineHvigor(t, false) + _, err := Build(context.Background(), Request{Project: project, Executable: executable}) + if err == nil || !strings.Contains(err.Error(), "no HAP") { + t.Fatalf("expected missing artifact error, got %v", err) + } +} + +func TestBuildFailureDoesNotExposeBuildOutput(t *testing.T) { + project := t.TempDir() + os.WriteFile(filepath.Join(project, "build-profile.json5"), []byte("{}"), 0600) + executable := offlineHvigor(t, true) + _, err := Build(context.Background(), Request{Project: project, Executable: executable}) + if err == nil || strings.Contains(err.Error(), "SECRET") { + t.Fatalf("expected sanitized build failure: %v", err) + } +} + +func offlineHvigor(t *testing.T, fail bool) string { + t.Helper() + t.Setenv("AGC_OFFLINE_HVIGOR_STUB", "success") + if fail { + t.Setenv("AGC_OFFLINE_HVIGOR_STUB", "failure") + } + executable, err := os.Executable() + if err != nil { + t.Fatal(err) + } + return executable +} +func TestMain(m *testing.M) { + if len(os.Args) > 1 && os.Args[1] == "--mode" && os.Getenv("AGC_OFFLINE_HVIGOR_STUB") != "" { + if os.Getenv("AGC_OFFLINE_HVIGOR_STUB") == "failure" { + fmt.Fprintln(os.Stderr, "SECRET_SIGNING_CONFIGURATION") + os.Exit(1) + } + os.Exit(0) + } + os.Exit(m.Run()) +} diff --git a/pkg/server/management_transport_test.go b/pkg/server/management_transport_test.go new file mode 100644 index 0000000..01d2710 --- /dev/null +++ b/pkg/server/management_transport_test.go @@ -0,0 +1,78 @@ +package server + +import ( + "bytes" + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + "github.com/Createitv/agc-cli/internal/managementtest" + "github.com/Createitv/agc-cli/pkg/domain" +) + +func testReviewedManagementREST(t *testing.T, e domain.Endpoint) { + if e.FamilyID == "templates" && e.ID == "deploy" { + testTemplateDeployREST(t) + return + } + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + f, ok := managementtest.Fixtures()[e.FamilyID+"/"+e.ID] + if !ok { + t.Fatal("source fixture missing") + } + for _, scenario := range []struct { + name, body string + status int + fail bool + }{{"success", `{"code":0,"result":{"marker":"received"}}`, 200, false}, {"business-error", `{"code":17,"message":"denied"}`, 200, true}, {"http-error", `{"code":19,"message":"forbidden"}`, 403, true}} { + t.Run(scenario.name, func(t *testing.T) { + calls := 0 + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + calls++ + managementtest.AssertRequest(t, r, f) + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(scenario.status) + w.Write([]byte(scenario.body)) + })) + defer srv.Close() + payload := map[string]any{"params": f.Params, "query": f.Query, "body": f.Body, "sessionFile": managementtest.SessionFile(t, srv.URL), "dryRun": false} + if f.Body == nil { + delete(payload, "body") + } + b, _ := json.Marshal(payload) + w := httptest.NewRecorder() + Handler().ServeHTTP(w, httptest.NewRequest("POST", "/api/v1/"+e.FamilyID+"/endpoints/"+e.ID+"/invoke", bytes.NewReader(b))) + if calls != 1 || (w.Code != 200) != scenario.fail { + t.Fatalf("calls=%d status=%d %s", calls, w.Code, w.Body.String()) + } + }) + } + }) +} + +func testTemplateDeployREST(t *testing.T) { + t.Run("templates/deploy", func(t *testing.T) { + srv, body := managementtest.Deployment(t) + defer srv.Close() + p := map[string]any{"body": body, "sessionFile": managementtest.SessionFile(t, srv.URL), "dryRun": false} + b, _ := json.Marshal(p) + w := httptest.NewRecorder() + Handler().ServeHTTP(w, httptest.NewRequest("POST", "/api/v1/templates/endpoints/deploy/invoke", bytes.NewReader(b))) + if w.Code != 200 { + t.Fatalf("%d %s", w.Code, w.Body.String()) + } + }) +} + +func testPrefetchDeviceREST(t *testing.T, e domain.Endpoint) { + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + payload := map[string]any{"body": map[string]string{"bundleName": "com.example.offline", "deviceId": "offline-device", "hdcPath": managementtest.HDCFile(t)}, "dryRun": false} + b, _ := json.Marshal(payload) + w := httptest.NewRecorder() + Handler().ServeHTTP(w, httptest.NewRequest("POST", "/api/v1/prefetch/endpoints/device-getcache/invoke", bytes.NewReader(b))) + if w.Code != 200 { + t.Fatalf("%d %s", w.Code, w.Body.String()) + } + }) +} diff --git a/pkg/server/offline_process_test.go b/pkg/server/offline_process_test.go new file mode 100644 index 0000000..4058806 --- /dev/null +++ b/pkg/server/offline_process_test.go @@ -0,0 +1,9 @@ +package server + +import ( + "github.com/Createitv/agc-cli/internal/managementtest" + "os" + "testing" +) + +func TestMain(m *testing.M) { managementtest.ExitIfHDCStub(); os.Exit(m.Run()) } diff --git a/pkg/server/pms_resource_upload_test.go b/pkg/server/pms_resource_upload_test.go new file mode 100644 index 0000000..b1d2d85 --- /dev/null +++ b/pkg/server/pms_resource_upload_test.go @@ -0,0 +1,75 @@ +package server + +import ( + "bytes" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" +) + +func TestRESTPMSResourceForwardsSelectedLocalFileAsMultipart(t *testing.T) { + file := filepath.Join(t.TempDir(), "fixture.png") + if err := os.WriteFile(file, []byte("offline-image"), 0600); err != nil { + t.Fatal(err) + } + called := false + upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + if err := r.ParseMultipartForm(1024); err != nil { + t.Error(err) + return + } + defer r.MultipartForm.RemoveAll() + if r.FormValue("requestId") != "fixture" || r.FormValue("fileType") != "1" { + t.Error("multipart fields changed") + } + part, _, err := r.FormFile("file") + if err != nil { + t.Error(err) + return + } + defer part.Close() + data, _ := io.ReadAll(part) + if string(data) != "offline-image" { + t.Error("file bytes changed") + } + w.Header().Set("Content-Type", "application/json") + io.WriteString(w, `{"error":{"errorCode":0},"resourceId":"fixture"}`) + })) + defer upstream.Close() + payload, _ := json.Marshal(map[string]any{"baseUrl": upstream.URL, "filePath": file, "headers": map[string]string{"appId": "dedicated"}, "fields": map[string]string{"requestId": "fixture", "fileType": "1", "zoneId": "1", "fileName": "fixture.png"}, "dryRun": false}) + rec := httptest.NewRecorder() + Handler().ServeHTTP(rec, httptest.NewRequest(http.MethodPost, "/api/v1/pms/endpoints/resourcemanage-harmonyosnext/invoke", bytes.NewReader(payload))) + if rec.Code != http.StatusOK || !called { + t.Fatalf("REST upload failed: %d %s", rec.Code, rec.Body.String()) + } +} + +func TestRESTMissingResourceFileReturnsAgentCorrection(t *testing.T) { + rec := httptest.NewRecorder() + Handler().ServeHTTP(rec, httptest.NewRequest(http.MethodPost, "/api/v1/pms/endpoints/resourcemanage-harmonyosnext/invoke", strings.NewReader(`{"headers":{"appId":"dedicated"},"fields":{"requestId":"fixture","fileType":"1","zoneId":"1","fileName":"fixture.png"},"dryRun":true}`))) + if rec.Code != http.StatusBadRequest { + t.Fatalf("missing file classified incorrectly: %d %s", rec.Code, rec.Body.String()) + } + var response struct { + Error struct { + Code, Endpoint, DocumentationCommand string + Violations []struct{ Field, SourceURL, Suggestion string } + } + } + if err := json.Unmarshal(rec.Body.Bytes(), &response); err != nil { + t.Fatal(err) + } + if response.Error.Code != "invalid_request" || response.Error.Endpoint != "pms/resourcemanage-harmonyosnext" || response.Error.DocumentationCommand == "" || len(response.Error.Violations) != 1 { + t.Fatalf("incomplete Agent correction: %s", rec.Body.String()) + } + v := response.Error.Violations[0] + if v.Field != "filePath" || v.SourceURL == "" || v.Suggestion == "" { + t.Fatalf("missing file guidance: %+v", v) + } +} diff --git a/pkg/server/publishing_privacy_test.go b/pkg/server/publishing_privacy_test.go new file mode 100644 index 0000000..30949ba --- /dev/null +++ b/pkg/server/publishing_privacy_test.go @@ -0,0 +1,34 @@ +package server + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +func TestPrivacyRESTRejectsDeepInputBeforeNetwork(t *testing.T) { + called := false + upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + t.Error("invalid input reached transport") + })) + defer upstream.Close() + payload := `{"baseUrl":"` + upstream.URL + `","token":"offline-fixture","headers":{"appId":"fixture"},"dryRun":false,"body":{"id":"fixture","agreementInfos":[{"lang":"zh","extInfo":{"storageInfo":{"isCrossBorder":"false"}}}]}}` + request := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(payload)) + response := httptest.NewRecorder() + invokeEndpoint(response, request, "publishing", "privacy-agreement-update") + if response.Code != http.StatusBadRequest || called { + t.Fatalf("invalid input should fail before HTTP: %d %s", response.Code, response.Body.String()) + } + var result map[string]any + if json.Unmarshal(response.Body.Bytes(), &result) != nil { + t.Fatal("REST feedback not JSON") + } + for _, want := range []string{"agreementInfos[0].extInfo.storageInfo.isCrossBorder", "data-storageinfo", "invalid_request", "documentationCommand", "suggestion"} { + if !strings.Contains(response.Body.String(), want) { + t.Errorf("missing %s: %s", want, response.Body.String()) + } + } +} diff --git a/pkg/server/result_codes_test.go b/pkg/server/result_codes_test.go new file mode 100644 index 0000000..f3621bf --- /dev/null +++ b/pkg/server/result_codes_test.go @@ -0,0 +1,23 @@ +package server + +import ( + "encoding/json" + "github.com/Createitv/agc-cli/pkg/agcapi" + "github.com/Createitv/agc-cli/pkg/domain" + "net/http/httptest" + "strings" + "testing" +) + +func TestRESTPreservesCodeOriginWithoutRawResponse(t *testing.T) { + recorder := httptest.NewRecorder() + err := agcapi.ParseAGCError(200, []byte(`{"rtnCode":2,"businessCode":0,"invitationCode":"raw-secret"}`)) + writeInvokeError(recorder, agcapi.InvokeResponse{URL: "https://example.com"}, err) + var envelope domain.ErrorEnvelope + if json.Unmarshal(recorder.Body.Bytes(), &envelope) != nil || envelope.Error.CodeField != "rtnCode" || envelope.Error.ResultCodes["businessCode"] != "0" { + t.Fatal("REST discarded original result codes") + } + if strings.Contains(recorder.Body.String(), "raw-secret") { + t.Fatal("REST leaked raw response") + } +} diff --git a/pkg/server/server.go b/pkg/server/server.go index 2bbc1b9..6c4467d 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -5,12 +5,14 @@ import ( "crypto/sha256" "crypto/subtle" "encoding/json" + "errors" "fmt" "net/http" "strings" "time" "github.com/Createitv/agc-cli/pkg/agcapi" + "github.com/Createitv/agc-cli/pkg/cloudfunctions" "github.com/Createitv/agc-cli/pkg/domain" ) @@ -139,14 +141,18 @@ func resourceEndpoints(w http.ResponseWriter, r *http.Request, segments []string } type invokeEndpointRequest struct { - BaseURL string `json:"baseUrl,omitempty"` - Params map[string]string `json:"params,omitempty"` - Query map[string]string `json:"query,omitempty"` - Headers map[string]string `json:"headers,omitempty"` - Fields map[string]string `json:"fields,omitempty"` - Body json.RawMessage `json:"body,omitempty"` - Token string `json:"token,omitempty"` - DryRun *bool `json:"dryRun,omitempty"` + SessionFile string `json:"sessionFile,omitempty"` + ProjectID string `json:"projectId,omitempty"` + FilePath string `json:"filePath,omitempty"` + QueryValues map[string][]string `json:"queryValues,omitempty"` + BaseURL string `json:"baseUrl,omitempty"` + Params map[string]string `json:"params,omitempty"` + Query map[string]string `json:"query,omitempty"` + Headers map[string]string `json:"headers,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + Body json.RawMessage `json:"body,omitempty"` + Token string `json:"token,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` } func invokeEndpoint(w http.ResponseWriter, r *http.Request, familyID, endpointID string) { @@ -159,11 +165,36 @@ func invokeEndpoint(w http.ResponseWriter, r *http.Request, familyID, endpointID writeJSON(w, http.StatusNotFound, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: "not_found", Message: "unknown endpoint"}}) return } + if endpoint.Authentication == "agcli-user-oauth" { + payload := domain.FunctionRequest{DryRun: true} + dec := json.NewDecoder(r.Body) + dec.DisallowUnknownFields() + if dec.Decode(&payload) != nil { + writeJSON(w, 400, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: "invalid_json", Message: "Invalid native function request"}}) + return + } + result, err := (&cloudfunctions.Client{}).Execute(r.Context(), endpointID, payload) + if err != nil { + detail := cloudfunctions.Feedback(endpointID, err) + status := http.StatusBadGateway + if detail.Code == "invalid_request" { + status = http.StatusBadRequest + } + if detail.Code == "authentication_required" { + status = http.StatusUnauthorized + } + writeJSON(w, status, domain.ErrorEnvelope{Error: detail}) + return + } + writeJSON(w, 200, domain.Envelope[cloudfunctions.Response]{Data: result}) + return + } var payload invokeEndpointRequest if err := json.NewDecoder(r.Body).Decode(&payload); err != nil { writeJSON(w, http.StatusBadRequest, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: "invalid_json", Message: "request body must be JSON", Details: err.Error()}}) return } + payload.Query = agcapi.ScalarQuery(payload.Query, payload.QueryValues) body, err := requestBody(payload) if len(payload.Body) == 0 && len(payload.Fields) > 0 { body, err = agcapi.MarshalEndpointFields(endpoint, payload.Fields) @@ -176,6 +207,22 @@ func invokeEndpoint(w http.ResponseWriter, r *http.Request, familyID, endpointID writeJSON(w, http.StatusBadRequest, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: "missing_parameter", Message: err.Error()}}) return } + validationErr := agcapi.ValidateEndpointRequest(endpoint, payload.Query, payload.Headers, body, payload.QueryValues) + if validationErr == nil { + validationErr = agcapi.ValidateEndpointPathInput(endpoint, payload.Params) + } + if validationErr == nil { + validationErr = agcapi.ValidateEndpointFileInput(endpoint, payload.FilePath, payload.Headers) + } + if err := validationErr; err != nil { + detail := domain.ErrorDetail{Code: "invalid_request", Message: err.Error(), Endpoint: endpoint.FamilyID + "/" + endpoint.ID, SourceURL: endpoint.SourceURL, Suggestion: "Correct the fields using the documented requirements before retrying.", DocumentationCommand: endpoint.Command + " --docs --pretty"} + var invalid *agcapi.RequestValidationError + if errors.As(err, &invalid) { + detail.Violations = invalid.Violations + } + writeJSON(w, http.StatusBadRequest, domain.ErrorEnvelope{Error: detail}) + return + } if err := agcapi.ValidateEndpointBody(endpoint, body); err != nil { writeJSON(w, http.StatusBadRequest, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: "invalid_body", Message: err.Error()}}) return @@ -187,16 +234,25 @@ func invokeEndpoint(w http.ResponseWriter, r *http.Request, familyID, endpointID ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second) defer cancel() resp, err := agcapi.InvokeEndpoint(ctx, nil, agcapi.InvokeRequest{ + SessionFile: payload.SessionFile, + ProjectID: payload.ProjectID, + FilePath: payload.FilePath, Endpoint: endpoint, BaseURL: payload.BaseURL, Params: payload.Params, Query: payload.Query, + QueryValues: payload.QueryValues, Headers: payload.Headers, Body: body, AccessToken: payload.Token, DryRun: dryRun, }) if err != nil { + var invalid *agcapi.RequestValidationError + if errors.As(err, &invalid) { + writeJSON(w, 400, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: "invalid_request", Message: err.Error(), Endpoint: endpoint.FamilyID + "/" + endpoint.ID, SourceURL: endpoint.SourceURL, Violations: invalid.Violations, DocumentationCommand: endpoint.Command + " --docs --pretty", Suggestion: "Correct the affected field before invoking."}}) + return + } writeInvokeError(w, resp, err) return } @@ -244,10 +300,13 @@ func validateInvokeParameters(endpoint domain.Endpoint, params, query, headers, } case "body": var object map[string]json.RawMessage - if json.Unmarshal(body, &object) != nil || len(object[parameter.Name]) == 0 || string(object[parameter.Name]) == "null" || string(object[parameter.Name]) == `""` { + if json.Unmarshal(body, &object) != nil || len(object[parameter.Name]) == 0 || string(object[parameter.Name]) == "null" || (!parameter.AllowEmpty && string(object[parameter.Name]) == `""`) { return endpointParamError("fields", parameter.Name) } case "file": + if domain.IsServerlessFamily(endpoint.FamilyID) { + continue + } // validated through explicit filePath if params[parameter.Name] == "" && fields[parameter.Name] == "" && len(body) == 0 { return endpointParamError("fields", parameter.Name) } @@ -261,8 +320,13 @@ func endpointParamError(location, name string) error { } func writeInvokeError(w http.ResponseWriter, resp agcapi.InvokeResponse, err error) { + var authErr *agcapi.AuthenticationError + if errors.As(err, &authErr) { + writeJSON(w, 401, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: "authentication_failed", Message: authErr.Message}}) + return + } if agcErr, ok := err.(agcapi.AGCError); ok { - writeJSON(w, http.StatusBadGateway, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: agcErr.Code, Message: agcErr.Message, Details: resp.URL}}) + writeJSON(w, http.StatusBadGateway, domain.ErrorEnvelope{Error: domain.ErrorDetail{Code: agcErr.Code, CodeField: agcErr.CodeField, ResultCodes: agcErr.ResultCodes, Message: agcErr.Message, Details: resp.URL}}) return } status := http.StatusBadGateway diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index a36edd9..3787497 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -22,8 +22,8 @@ func TestCapabilitiesRoute(t *testing.T) { if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { t.Fatal(err) } - if len(body.Data) != 13 { - t.Fatalf("capabilities = %d, want 13", len(body.Data)) + if len(body.Data) != 21 { + t.Fatalf("capabilities = %d, want 21", len(body.Data)) } } diff --git a/pkg/server/serverless_test.go b/pkg/server/serverless_test.go new file mode 100644 index 0000000..f143293 --- /dev/null +++ b/pkg/server/serverless_test.go @@ -0,0 +1,203 @@ +package server + +import ( + "archive/zip" + "bytes" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/Createitv/agc-cli/pkg/agcapi" + "github.com/Createitv/agc-cli/pkg/domain" +) + +func slValue(p domain.Parameter) any { + if p.Name == "fileSha256" { + return strings.Repeat("0", 64) + } + if len(p.Enum) > 0 { + if p.Type == "integer" { + return json.Number(p.Enum[0]) + } + return p.Enum[0] + } + if p.EncodedJSON != nil { + b, _ := json.Marshal(slValue(*p.EncodedJSON)) + return string(b) + } + switch p.Type { + case "integer", "number": + return 1 + case "boolean": + return false + case "object": + m := map[string]any{} + for _, c := range p.Properties { + if c.Required { + m[c.Name] = slValue(c) + } + } + return m + case "array": + if p.ItemsType == "object" { + m := map[string]any{} + for _, c := range p.ItemsProperties { + if c.Required { + m[c.Name] = slValue(c) + } + } + return []any{m} + } + return []any{"test"} + } + return "test" +} +func TestEveryServerlessOperationREST(t *testing.T) { + for _, e := range domain.AllEndpoints() { + if !domain.IsServerlessFamily(e.FamilyID) { + continue + } + if e.FamilyID == "prefetch" && e.Direction == "local" { + testPrefetchDeviceREST(t, e) + continue + } + if agcapi.IsManagementEndpoint(e) { + testReviewedManagementREST(t, e) + continue + } + t.Run(e.FamilyID+"/"+e.ID, func(t *testing.T) { + seen := 0 + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + seen++ + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"ret":{"code":0},"function":{"revisionId":"r1","handler":"handler.myHandler"}}`)) + })) + defer srv.Close() + params, query, headers := map[string]string{}, map[string]string{}, map[string]string{"client_id": "offline"} + body := map[string]any{} + for _, p := range e.Parameters { + if !p.Required { + continue + } + v := slValue(p) + switch p.In { + case "body": + body[p.Name] = v + case "header": + headers[p.Name] = fmt.Sprint(v) + case "query": + query[p.Name] = fmt.Sprint(v) + case "path": + value := fmt.Sprint(v) + if p.Name == "uploadUrl" || p.Name == "callbackUrl" { + value = srv.URL + "/test" + } + params[p.Name] = value + } + } + if e.FamilyID == "cloud-auth" { + switch e.ID { + case "request-code", "register": + body["email"] = "test@example.test" + case "update-account": + body["newEmail"] = "test@example.test" + } + } + if e.FamilyID == "clouddb" && (e.ID == "update-data" || e.ID == "delete-data") { + body["schemas"] = []any{} + body["opData"] = []any{} + } + payload := map[string]any{"baseUrl": srv.URL, "params": params, "query": query, "headers": headers, "body": body, "dryRun": false, "token": "offline"} + if e.ID == "upload-file" || e.ID == "upload-version" { + p := filepath.Join(t.TempDir(), "test.zip") + os.WriteFile(p, []byte("offline"), 0600) + payload["filePath"] = p + } + if e.Authentication == "signed-upload" { + sum := sha256.Sum256([]byte("offline")) + headers["Authorization"] = "AWS4-HMAC-SHA256 offline" + headers["x-amz-content-sha256"] = hex.EncodeToString(sum[:]) + headers["x-amz-client-request-id"] = "offline" + headers["x-amz-date"] = "20261026T000000Z" + headers["Host"] = strings.TrimPrefix(srv.URL, "http://") + headers["Content-Type"] = "application/zip" + delete(payload, "body") + } + if e.ID == "upload-file" { + delete(payload, "body") + } + if e.Authentication == "agcli-user-oauth" { + dir := t.TempDir() + session := filepath.Join(dir, "session.json") + b, _ := json.Marshal(map[string]any{"uid": "offline", "teamId": "offline", "productId": "offline", "accessToken": "offline-oauth", "expiresAt": time.Now().Add(time.Hour), "projectBaseUrl": srv.URL}) + os.WriteFile(session, b, 0600) + payload = map[string]any{"name": "test-func", "sessionFile": session, "dryRun": false, "versionDescription": "test"} + if e.ID == "create-function" || e.ID == "update-function-code" || e.ID == "update-and-publish-function" { + p := filepath.Join(dir, "test.zip") + f, _ := os.Create(p) + z := zip.NewWriter(f) + entry, _ := z.Create("handler.js") + entry.Write([]byte("test")) + z.Close() + f.Close() + payload["codePath"] = p + } + if e.ID == "update-function-config" { + payload["memory"] = 1000 + } + } + b, _ := json.Marshal(payload) + request := httptest.NewRequest("POST", "/api/v1/"+e.FamilyID+"/endpoints/"+e.ID+"/invoke", bytes.NewReader(b)) + response := httptest.NewRecorder() + Handler().ServeHTTP(response, request) + if response.Code != 200 || seen == 0 { + t.Fatalf("REST did not execute operation: status=%d calls=%d %s", response.Code, seen, response.Body.String()) + } + var parsed any + if json.Unmarshal(response.Body.Bytes(), &parsed) != nil { + t.Fatal("REST output is not JSON") + } + }) + } +} +func TestServerlessRESTInvalidNestedInputNeverCallsUpstream(t *testing.T) { + calls := 0 + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { calls++; io.WriteString(w, `{}`) })) + defer srv.Close() + payload := `{"baseUrl":"` + srv.URL + `","headers":{"productId":"p","service":"hosting","requestid":"test"},"body":{"siteId":"s","version":"v","materialInfos":[{"sceneId":"p","fileName":"x.zip","fileSha256":"s","fileSize":1,"contentType":1}]},"dryRun":false}` + r := httptest.NewRequest("POST", "/api/v1/hosting/endpoints/upload-url/invoke", strings.NewReader(payload)) + w := httptest.NewRecorder() + Handler().ServeHTTP(w, r) + if w.Code != 400 || calls != 0 || !strings.Contains(w.Body.String(), "body.materialInfos[0].contentType") { + t.Fatalf("invalid request sent upstream: %d %d %s", w.Code, calls, w.Body.String()) + } +} + +func TestNativeRESTPreservesUpstreamErrorCode(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(403) + w.Write([]byte(`{"code":"ROLE_DENIED","message":"permission denied"}`)) + })) + defer s.Close() + p := filepath.Join(t.TempDir(), "session.json") + b, _ := json.Marshal(map[string]any{"uid": "test", "teamId": "test", "productId": "test", "accessToken": "offline", "expiresAt": time.Now().Add(time.Hour), "projectBaseUrl": s.URL}) + os.WriteFile(p, b, 0600) + b, _ = json.Marshal(map[string]any{"name": "test-func", "sessionFile": p, "dryRun": false}) + r := httptest.NewRequest("POST", "/api/v1/functions/endpoints/invoke/invoke", bytes.NewReader(b)) + w := httptest.NewRecorder() + Handler().ServeHTTP(w, r) + var result domain.ErrorEnvelope + json.Unmarshal(w.Body.Bytes(), &result) + if result.Error.Code != "ROLE_DENIED" || result.Error.ResultCodes["code"] != "ROLE_DENIED" { + t.Fatalf("upstream code lost: %s", w.Body.String()) + } +} diff --git a/pkg/server/validation_regression_test.go b/pkg/server/validation_regression_test.go index 393824a..a912486 100644 --- a/pkg/server/validation_regression_test.go +++ b/pkg/server/validation_regression_test.go @@ -2,6 +2,9 @@ package server import ( "github.com/Createitv/agc-cli/pkg/domain" + "net/http" + "net/http/httptest" + "strings" "testing" ) @@ -25,3 +28,41 @@ func TestRequiredHeaderNamesAreCaseInsensitive(t *testing.T) { t.Fatal(err) } } + +func TestRESTAgentGetsConditionalRuleAndSource(t *testing.T) { + request := httptest.NewRequest(http.MethodPost, "/api/v1/publishing/endpoints/app-info-query-v3/invoke", strings.NewReader(`{"query":{"appId":"fixture","releaseType":"6"},"dryRun":true}`)) + response := httptest.NewRecorder() + Handler().ServeHTTP(response, request) + if response.Code != http.StatusBadRequest { + t.Fatalf("got %d: %s", response.Code, response.Body.String()) + } + for _, want := range []string{"versionId", "sourceUrl", "suggestion"} { + if !strings.Contains(response.Body.String(), want) { + t.Errorf("feedback missing %s", want) + } + } +} + +func TestReportRESTPreservesOrderedQueryValues(t *testing.T) { + called := false + upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + called = true + for key, want := range map[string][]string{"filterCondition": {"countryId", "businessType"}, "filterConditionValue": {"CN", "AppGallery"}} { + if got := r.URL.Query()[key]; strings.Join(got, "|") != strings.Join(want, "|") { + t.Errorf("%s lost ordered values: %v", key, got) + } + } + _, _ = w.Write([]byte(`{"code":0}`)) + })) + defer upstream.Close() + payload := `{"baseUrl":"` + upstream.URL + `","params":{"appId":"fixture"},"queryValues":{"language":["en-US"],"startTime":["20260901"],"endTime":["20261001"],"filterCondition":["countryId","businessType"],"filterConditionValue":["CN","AppGallery"]},"dryRun":false}` + request := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(payload)) + response := httptest.NewRecorder() + invokeEndpoint(response, request, "reports", "appdownloadexport") + if response.Code != http.StatusOK { + t.Fatalf("REST invocation failed: %s", response.Body.String()) + } + if !called { + t.Fatal("REST did not invoke upstream") + } +} diff --git a/scripts/audit-publishing-contracts.py b/scripts/audit-publishing-contracts.py new file mode 100644 index 0000000..f56416e --- /dev/null +++ b/scripts/audit-publishing-contracts.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +"""Compare offline CLI contracts with independently captured Huawei parameter tables. + +Does not read credentials or call Huawei. Prints JSON; use --cli-json to inspect +an existing `agc publishing endpoints` result, or invokes the local Go CLI. +""" +import argparse +import json +from pathlib import Path +import subprocess + +ROOT = Path(__file__).resolve().parents[1] +ALIASES = { + '更新应用基本信息': 'app-info-update', '更新应用语言信息': 'language-info-update', + '更新应用文件信息': 'app-file-info', '更新分阶段发布': 'phased-release', + '查询软件包编译状态': 'query-aabfile', '提交发布': 'app-submit', +} +AUTH = {'Authorization', 'client_id', 'teamId', 'oauth2Token'} + + +def kind(value): + if value.startswith('String'): return 'string' + if value.startswith('Integer'): return 'integer' + if value.startswith('List<'): return 'array' + return 'object' + + +def audit(reference, local): + results = [] + for official in reference['endpoints']: + exact = [e for e in local if (e['method'], e['path']) == (official['method'], official['path'])] + # User and privacy agreements share method/path while using separate + # models and commands. Preserve the official document's identity. + exact.sort(key=lambda e: e.get('sourceUrl') != official.get('sourceUrl')) + legacy = next((e for e in local if e['id'] == ALIASES.get(official['name'])), None) + matched = exact[0] if exact else legacy + status = 'path-matched' if exact else ('legacy-path' if legacy else 'missing') + issues = [] + reviewed = [] + if exact: + known = {(p['in'], p['name']): p for p in matched.get('parameters', [])} + for p in official['parameters']: + if p['in'] == 'header' and p['name'] in AUTH: continue + actual = known.get((p['in'], p['name'])) + label = p['name'] + '@' + p['in'] + if actual is None: + issues.append(label + ': absent from declared contract') + continue + required, expected_type = p['required'], kind(p['type']) + # 表格与说明/示例冲突时,保留精确的官方原文依据。 + if official['name'] == '查询应用所有版本类型的版本列表' and label == 'appId@header': + required = False + reviewed.append({'field': label, 'reason': 'appId和packageName至少传一个', 'sourceUrl': 'https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-query-brief-info-list-0000002236201254#section2357705386'}) + if official['name'] == '新建用户协议' and label == 'agreementInfos@body': + expected_type = 'array' + reviewed.append({'field': label, 'reason': '请求示例使用对象数组,说明规定数组长度不超过100', 'sourceUrl': 'https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-create-user-agreement-0000002271160581#section1945115411389'}) + if actual['required'] != required: + issues.append(label + ': requiredness differs') + if actual.get('type') != expected_type: + issues.append(label + ': type missing or differs') + results.append({**official, 'command': matched['id'] if matched else None, + 'localMethod': matched['method'] if matched else None, + 'localPath': matched['path'] if matched else None, + 'status': status, 'parameterIssues': issues, 'reviewedExceptions': reviewed}) + return {'checkedAt': reference['checkedAt'], 'scope': 'method, path, top-level parameter location/requiredness/type; authentication alternatives and nested model constraints require separate validation', + 'summary': {s: sum(e['status'] == s for e in results) for s in ('path-matched', 'legacy-path', 'missing')}, + 'endpoints': results} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--cli-json', type=Path) + args = parser.parse_args() + reference = json.loads((ROOT / 'docs/verification/publishing-browser-reference-20261007.json').read_text()) + raw = args.cli_json.read_text() if args.cli_json else subprocess.check_output( + ['go', 'run', './cmd/agc', 'publishing', 'endpoints'], cwd=ROOT, text=True) + print(json.dumps(audit(reference, json.loads(raw)['data']), ensure_ascii=False, indent=2)) + + +if __name__ == '__main__': + main() diff --git a/scripts/audit-publishing-models.py b/scripts/audit-publishing-models.py new file mode 100644 index 0000000..3b3568e --- /dev/null +++ b/scripts/audit-publishing-models.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python3 +"""Audit request-model fields against browser-read source tables, offline. + +Never read user authorization or call Huawei. This checks nested shape, scalar +types, requiredness and explicit string/array bounds. It does not certify +resource-dependent rules, signatures, roles, dates, files or real operations. +""" +import argparse +from datetime import datetime, timezone +import json +from pathlib import Path +import re +import subprocess + +ROOT = Path(__file__).resolve().parents[1] + + +def kind(value): + if value.startswith('String'): return 'string' + if value.startswith('Integer'): return 'integer' + if value.lower() == 'boolean': return 'boolean' + if value.startswith('List<'): return 'array' + return 'object' + + +def audit_model(model, fields, path, documents, endpoint_id, stack=()): + issues = [] + actual = {field['name']: field for field in fields} + for table in model.get('tables', []): + for row in table.get('rows', []): + if len(row) < 4 or row[1] not in ('M', 'O'): continue + name, required, typ, description = row[:4] + field_path = path + '.' + name + source = table.get('sourceUrl', model['sourceUrl']) + + def issue(code, expected=None, got=None): + issues.append({'field': field_path, 'code': code, 'sourceUrl': source, + 'expected': expected, 'actual': got}) + + field = actual.get(name) + if field is None: + issue('missing_field', typ) + continue + expected_kind = kind(typ) + if field.get('type') != expected_kind: + issue('type', expected_kind, field.get('type')) + expected_required = required == 'M' + # TagQualInfo explicitly makes taskId required when modifying. + if endpoint_id == 'qualification-review-update' and name == 'taskId': + expected_required = True + if field.get('required', False) != expected_required: + issue('requiredness', expected_required, field.get('required', False)) + match = re.fullmatch(r'String\((\d+)\)', typ) + if match and field.get('maxLength') != int(match[1]): + issue('max_length', int(match[1]), field.get('maxLength')) + match = re.search(r'数组长度不超过(\d+)', description) + if match and field.get('maxItems') != int(match[1]): + issue('max_items', int(match[1]), field.get('maxItems')) + match = re.search(r'数组长度为(\d+)~(\d+)', description) + if match: + for key, value in [('minItems', int(match[1])), ('maxItems', int(match[2]))]: + if field.get(key, 0) != value: issue(key, value, field.get(key, 0)) + if expected_kind == 'array': + item_type = typ[5:-1] + item_kind = kind(item_type) + if field.get('itemsType') != item_kind: + issue('items_type', item_kind, field.get('itemsType')) + match = re.fullmatch(r'String\((\d+)\)', item_type) + if match and field.get('itemsMaxLength') != int(match[1]): + issue('item_max_length', int(match[1]), field.get('itemsMaxLength')) + nested_fields = field.get('itemsProperties', []) + nested_path = field_path + '[]' + else: + item_type = typ + nested_fields = field.get('properties', []) + nested_path = field_path + if kind(item_type) != 'object': continue + # Resolve by the table's actual model link, never by sidebar or + # previous/next labels; user/privacy model names can be identical. + link = next((link for link in model.get('links', []) if link['title'] == item_type), None) + if link is None: + issue('missing_model_link', item_type) + continue + url = link['sourceUrl'].split('#', 1)[0] + nested = documents.get(url) + if nested is None: + issue('model_not_captured', url) + continue + if url in stack: + issue('recursive_model_requires_review', url) + continue + issues += audit_model(nested, nested_fields, nested_path, documents, endpoint_id, (*stack, url)) + return issues + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--cli-json', type=Path) + args = parser.parse_args() + raw = args.cli_json.read_text() if args.cli_json else subprocess.check_output( + ['go', 'run', './cmd/agc', 'publishing', 'endpoints'], cwd=ROOT, text=True) + local = {endpoint['id']: endpoint for endpoint in json.loads(raw)['data']} + documents = {} + for file in sorted((ROOT / 'pkg/domain/reference/supplemental').glob('*.json')): + doc = json.loads(file.read_text()) + if doc.get('status') != 'browser-read' or 'tables' not in doc: continue + url = doc.get('sourceUrl') + if url not in documents or doc.get('checkedAt', '') > documents[url].get('checkedAt', ''): + documents[url] = doc + coverage = json.loads((ROOT / 'docs/verification/publishing-contract-audit-current.json').read_text()) + results = [] + for operation in coverage['endpoints']: + endpoint = local[operation['command']] + doc = json.loads((ROOT / 'pkg/domain/reference/publishing' / (endpoint['id'] + '.json')).read_text()) + roots = [] + for table in doc.get('tables', []): + if table.get('section') != '请求参数' or table.get('location') != 'body': continue + for row in table.get('rows', []): + if len(row) < 4 or row[1] not in ('M', 'O'): continue + typ = row[2] + is_list = typ.startswith('List<') or (endpoint['id'] == 'user-agreement-create' and row[0] == 'agreementInfos') + model_type = typ[5:-1] if typ.startswith('List<') else typ + if kind(model_type) != 'object': continue + roots.append((row[0], model_type, is_list)) + issues = [] + for name, model_type, is_list in roots: + field = next((field for field in endpoint['parameters'] if field['in'] == 'body' and field['name'] == name), {}) + link = next((link for link in doc['links'] if link['title'] == model_type), None) + model = documents.get(link['sourceUrl'].split('#', 1)[0]) if link else None + if model is None: + issues.append({'field': 'body.' + name, 'code': 'model_not_captured', 'expected': model_type}) + continue + nested = field.get('itemsProperties' if is_list else 'properties', []) + issues += audit_model(model, nested, 'body.' + name + ('[]' if is_list else ''), documents, endpoint['id']) + results.append({'endpoint': endpoint['id'], 'sourceUrl': doc['sourceUrl'], 'requestModelRoots': len(roots), 'issues': issues}) + print(json.dumps({'checkedAt': datetime.now(timezone.utc).isoformat(), + 'scope': 'nested request-model field shape, type, requiredness and explicit string/array bounds; other rules and live operations require separate validation', + 'summary': {'endpoints': len(results), 'endpointsWithModelIssues': sum(bool(r['issues']) for r in results), 'issues': sum(len(r['issues']) for r in results)}, + 'endpoints': results}, ensure_ascii=False, indent=2)) + + +if __name__ == '__main__': + main() diff --git a/scripts/browser-capture-reference.mjs b/scripts/browser-capture-reference.mjs new file mode 100644 index 0000000..554f7d0 --- /dev/null +++ b/scripts/browser-capture-reference.mjs @@ -0,0 +1,58 @@ +// Run from the browser skill's Node session with a connected Tab handle. +// Reads the rendered official page, never hidden state or credential stores. +export async function captureReference(tab, sourceUrl) { + if (await tab.url() !== sourceUrl) await tab.goto(sourceUrl); + await tab.playwright.getByRole('heading', { level: 1 }).first().waitFor({state:'visible', timeoutMs:15000}); + return await tab.playwright.evaluate((url) => { + const root = document.querySelector('.layout-right'); + const title = root?.querySelector('h1')?.innerText; + if (!root || !title) throw new Error('Official document body is unavailable'); + const normalize = s => s.replace(/\s+/g, ' ').trim(); + let section = '', location = '', sectionUrl = url, authenticationBranch = '', example = null; + const tables = [], notes = [], examples = [], links = [], seen = new Set(); + for (const element of root.querySelectorAll('h2,h3,h4,table,p,li,pre')) { + if (/^H[234]$/.test(element.tagName)) { + if (element.tagName === 'H2') { section = normalize(element.innerText); location = ''; authenticationBranch = ''; example = null; } + else if (['Header','Query','Body','Path'].includes(element.innerText.trim())) location = element.innerText.trim().toLowerCase(); + sectionUrl = element.id ? `${url}#${element.id}` : sectionUrl; + if (/请求.*[例样]|响应.*[例样]/.test(section) && element.tagName==='H2') { + // A heading's parent may contain only that heading, while examples + // live in sibling application-kind subsections. Accumulate visible + // code blocks until the next H2 instead of guessing a container. + example = {section, sourceUrl:sectionUrl, text:element.innerText.trim()}; + examples.push(example); + } else if (example) { + example.text += '\n' + element.innerText.trim(); + } + } else if (element.tagName === 'PRE' && example) { + example.text += '\n' + element.innerText.trim(); + } else if (element.tagName === 'TABLE') { + const rows = [], spans = []; + for (const tr of element.querySelectorAll('tr')) { + const row = []; let column = 0; + const copySpans = () => { while (spans[column]?.left > 0) { row[column] = spans[column].text; spans[column].left--; column++; } }; + for (const cell of tr.querySelectorAll(':scope > td,:scope > th')) { + copySpans(); + const text = normalize(cell.innerText); + for (let j = 0; j < (cell.colSpan || 1); j++) { + row[column] = text; + if (cell.rowSpan > 1) spans[column] = {text, left:cell.rowSpan - 1}; + column++; + } + } + copySpans(); rows.push(row); + } + tables.push({section, location, sourceUrl:sectionUrl, ...(location === 'header' && authenticationBranch ? {authenticationBranch} : {}), rows}); + } else if (!element.closest('table') && !/[例样]/.test(section)) { + const text = normalize(element.innerText); + if (/^(Service Account|API客户端|OAuth客户端)方式[::]?$/.test(text)) authenticationBranch = text; + if (text && !seen.has(text)) { notes.push({section:section || '文档说明', sourceUrl:sectionUrl, text}); seen.add(text); } + } + } + for (const a of root.querySelectorAll('a[href]')) { + if (a.href.includes('/doc/') && a.innerText.trim()) links.push({title:normalize(a.innerText),sourceUrl:a.href}); + } + const updatedAt = root.innerText.match(/更新时间[::]\s*([\d-]+\s+[\d:]+)/)?.[1]; + return {title,sourceUrl:url,updatedAt,checkedAt:new Date().toISOString().slice(0,10),renderedText:root.innerText,status:'browser-read',tables,notes,examples,links}; + }, sourceUrl); +} diff --git a/scripts/build-comment-parameter-contracts.py b/scripts/build-comment-parameter-contracts.py new file mode 100644 index 0000000..7edbcd6 --- /dev/null +++ b/scripts/build-comment-parameter-contracts.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Normalize all eight reviewed Android/HarmonyOS comment contracts.""" +import json +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1]/'pkg/domain/reference/comments' +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem:continue + doc=json.loads(path.read_text());fields={};rules=[] + for table in doc['tables']: + loc=table['location'] + if table['section']!='请求参数' or loc not in ('query','path','header','body'):continue + for name,required,typ,description in table['rows'][1:]: + if name in ('client_id','Authorization'):continue + kind='string' if typ.startswith('String') else 'integer' if typ in ('Integer','Long') else None + if kind is None or required not in ('M','O'):raise ValueError(f'Unreviewed comment type {typ}') + p={'name':name,'in':loc,'type':kind,'required':required=='M','description':description,'sourceUrl':table['sourceUrl']} + if typ=='Long':p['format']='int64' + if name=='limit':p['maximum']=100 + if name=='sort':p['enum']=['0','1','2'] + if name=='requestId':p['maxLength']=64 + if loc=='body' and name=='lang' and path.stem=='com-reviewreply-harmonyos':p['enum']=['zh','en','bo','ug'] + fields[loc+'.'+name]=p + if path.stem=='com-reviewreply': + rules.append({'id':'reply-target-exclusive','kind':'at_most_one','fields':['body.toReplyId','body.updateReplyId'],'sourceUrl':fields['body.updateReplyId']['sourceUrl'],'message':'toReplyId and updateReplyId cannot both be supplied.','suggestion':'Choose whether to reply to a user reply or modify an existing developer reply, and provide only its corresponding ID.'}) + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(list(fields.values()),ensure_ascii=False,indent=2)+'\n') + if rules:path.with_name(path.stem+'.rules.json').write_text(json.dumps(rules,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-domain-parameter-contracts.py b/scripts/build-domain-parameter-contracts.py new file mode 100644 index 0000000..ec293e7 --- /dev/null +++ b/scripts/build-domain-parameter-contracts.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +"""Normalize the five browser-reviewed domain endpoint root tables.""" +import json +import re +from pathlib import Path +ROOT = Path(__file__).resolve().parents[1] / 'pkg/domain/reference/domains' +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem: + continue + doc = json.loads(path.read_text()) + fields = {} + for table in doc['tables']: + location = table['location'] + if table['section'] != '请求参数' or location not in ('header', 'query', 'body'): + continue + for name, required, typ, description in table['rows'][1:]: + if name.lower() in ('authorization', 'client_id'): + continue + kind = 'string' if typ.startswith('String') else 'array' if typ == 'List' else 'object' if typ == 'DomainInfo' else None + if kind is None or required not in ('M', 'O'): + raise ValueError(f'Unreviewed domain field: {path}, {name}, {typ}') + field = {'name': name, 'in': location, 'type': kind, 'required': required == 'M', 'description': description, 'sourceUrl': table['sourceUrl']} + length = re.fullmatch(r'String\((\d+)\)', typ) + if length: + field['maxLength'] = int(length[1]) + if kind == 'array': + field['itemsType'] = 'object' + maximum = re.search(r'集合长度最大(\d+)', description) + if maximum: + field['maxItems'] = int(maximum[1]) + if name == 'category': + field['enum'] = ['server', 'business'] + if kind in ('array', 'object'): + model_name = 'domain-info-server' if kind == 'array' else 'domain-info-business' + model = json.loads((ROOT.parent / 'supplemental' / (model_name+'.json')).read_text()) + nested = [] + for child_name, child_required, child_type, child_description in model['tables'][0]['rows'][1:]: + # errorCode/errorMsg describe responses, not submitted inputs. + if child_name in ('errorCode', 'errorMsg'): + continue + child = {'name':child_name,'in':'body','type':'string','required':child_required=='M','description':child_description,'sourceUrl':model['sourceUrl']} + child['maxLength'] = int(re.fullmatch(r'String\((\d+)\)',child_type)[1]) + if child_name == 'type': + child['enum'] = ['webView'] if path.stem == 'domain-api-precheck' else ['httpRequest','upload','download','webSocket','webView'] + nested.append(child) + field['itemsProperties' if kind == 'array' else 'properties'] = nested + fields[location+'.'+name] = field + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(list(fields.values()), ensure_ascii=False, indent=2)+'\n') diff --git a/scripts/build-game-item-parameter-contracts.py b/scripts/build-game-item-parameter-contracts.py new file mode 100644 index 0000000..f3f396e --- /dev/null +++ b/scripts/build-game-item-parameter-contracts.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Normalize the two reviewed form callback parameter tables.""" +import json +import re +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] / 'pkg/domain/reference/game-items' +for endpoint in ('propapi-getroleinfo', 'propapi-order'): + doc = json.loads((ROOT / f'{endpoint}.json').read_text()) + fields = [] + for table in doc['tables']: + if table['section'] != '请求参数': + continue + for name, required, typ, description in table['rows'][1:]: + if required not in ('M', 'O') or not (typ.startswith('String') or typ in ('Int', 'Long')): + raise ValueError(f'Unreviewed callback field: {endpoint}, {name}, {typ}') + field = {'name': name, 'in': 'body', 'required': required == 'M', 'type': 'string' if typ.startswith('String') else 'integer', 'description': description, 'sourceUrl': table['sourceUrl']} + length = re.fullmatch(r'String\((\d+)\)', typ) + if length: + field['maxLength'] = int(length[1]) + if name == 'userIdType': + field['enum'] = ['1', '2', '3', '4', '5', '6'] + fields.append(field) + if not fields: + raise ValueError(f'Missing reviewed parameter table: {endpoint}') + (ROOT / f'{endpoint}.parameters.json').write_text(json.dumps(fields, ensure_ascii=False, indent=2) + '\n') diff --git a/scripts/build-gameplay-parameter-contracts.py b/scripts/build-gameplay-parameter-contracts.py new file mode 100644 index 0000000..77155f2 --- /dev/null +++ b/scripts/build-gameplay-parameter-contracts.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +"""Normalize reviewed Chinese Header/Body sections without flattening models.""" +import json +import re +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1]/'pkg/domain/reference/gameplay' + +def field(row,loc,source): + name,required,typ,description=row + kind='string' if typ.startswith('String') else 'integer' if typ in ('Integer','Long') else 'array' if typ=='List' else None + if kind is None or required not in ('是','否'):raise ValueError(f'Unreviewed gameplay field {name}:{typ}') + p={'name':name,'in':loc,'type':kind,'required':required=='是','description':description,'sourceUrl':source} + length=re.fullmatch(r'String\((\d+)\)',typ) + if length:p['maxLength']=int(length[1]) + if typ=='Long':p['format']='int64' + if name=='userIdType':p['enum']=['1','2','3','4','5','6'] + if name=='pageNo':p['minimum']=1 + if name=='pageSize':p['maximum']=100 + if kind=='array':p.update(itemsType='object') + if name=='method':p['enum']=['external.hms.gs.syncGameResources'] + return p + +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem:continue + doc=json.loads(path.read_text());tables=[t for t in doc['tables'] if t['section']=='请求参数'];fields=[] + if path.stem=='resources': + if 'application/x-www-form-urlencoded' not in doc['examples'][0]['text']:raise ValueError('Resource wire format needs review') + fields=[field(row,'body',tables[0]['sourceUrl']) for row in tables[0]['rows'][1:]] + children=[] + for row in tables[1]['rows'][1:]: + child=field(row,'body',tables[1]['sourceUrl']) + if child['name']=='type':child['enum']=['1','2'] + if child['name']=='operType':child['enum']=['0','1'] + children.append(child) + for p in fields: + if p['name']=='resources': + p['encodedJson']={'type':'array','itemsType':'object','maxItems':50,'itemsProperties':children,'sourceUrl':tables[1]['sourceUrl'],'itemsRules':[{'id':'upload-resource-url','kind':'required_if','field':'body.url','when':{'field':'body.operType','equals':'0'},'sourceUrl':tables[1]['sourceUrl'],'message':'url is required when uploading a resource.','suggestion':'Supply a publicly downloadable resource URL with its file extension.'}]} + + else: + if [row[0] for row in tables[0]['rows'][1:]]!=['appId','timestamp','nonce','sign']:raise ValueError('Callback header section needs review') + example=next(x['text'] for x in doc['examples'] if x['section']=='请求示例') + if 'headers:' not in example or 'Content-Type: application/json' not in example:raise ValueError('Callback Header/Body example needs review') + fields=[field(row,'header',tables[0]['sourceUrl']) for row in tables[0]['rows'][1:]]+[field(row,'body',tables[1]['sourceUrl']) for row in tables[1]['rows'][1:]] + if path.stem=='basic-info': + for p in fields: + if p['name']=='userIds':p['itemsProperties']=[field(row,'body',tables[2]['sourceUrl']) for row in tables[2]['rows'][1:]] + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(fields,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-legacy-publishing-contracts.py b/scripts/build-legacy-publishing-contracts.py new file mode 100644 index 0000000..912f3c6 --- /dev/null +++ b/scripts/build-legacy-publishing-contracts.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +"""Normalize reviewed legacy root tables; retain explicit nested model boundaries.""" +import json +import re +from pathlib import Path +REPO=Path(__file__).resolve().parents[1] +ROOT=REPO/'pkg/domain/reference/publishing' +current={e['id'] for e in json.loads((REPO/'cmd/agc/command/testdata/publishing-current.json').read_text())['endpoints']} +# The bare submit body and file-list example require further wire-shape review. +PENDING={'app-file-info'} + +def field(row,loc,source): + name,required,typ,description=row + kind='string' if typ.startswith('String') else 'integer' if typ.startswith('Integer') else 'boolean' if typ=='boolean' else 'array' if typ=='List' else 'object' if typ=='PhasedReleaseInfo' else None + if kind is None or required not in ('M','O'):raise ValueError(f'Unreviewed legacy field {name}:{typ}') + p={'name':name,'in':loc,'type':kind,'required':required=='M','description':description,'sourceUrl':source} + length=re.fullmatch(r'String\((\d+)\)',typ) + if length:p['maxLength']=int(length[1]) + if kind=='integer' and '取值范围:' in description: + enum_text=description.split('取值范围:',1)[1] + enum_text=re.split(r'默认值|注意|说明|如果|该参数',enum_text)[0] + values=re.findall(r'(?:^|\s)(-?\d+):',enum_text) + if values:p['enum']=sorted(set(values),key=int) + if kind=='array':p['itemsType']='object' + return p + +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem or path.stem in current or path.stem in PENDING:continue + doc=json.loads(path.read_text());fields={};rules=[] + tables=[t for t in doc['tables'] if t['section']=='请求参数'] + for table in tables: + if table['location'] not in ('header','query','path'):continue + for row in table['rows'][1:]: + if row[0] in ('client_id','Authorization','oauth2Token'):continue + p=field(row,table['location'],table['sourceUrl']) + if p['name']=='teamId': + p['required']=False + rules.append({'id':'oauth-team','kind':'required_with','field':'header.teamId','fields':['header.oauth2Token'],'sourceUrl':table['sourceUrl'],'message':'OAuth authorization requires its selected teamId.','suggestion':'Supply the selected OAuth team ID in the teamId header.'}) + fields[p['in']+'.'+p['name']]=p + bodies=[t for t in tables if t['location']=='body'] + if bodies: + for row in bodies[0]['rows'][1:]: + p=field(row,'body',bodies[0]['sourceUrl']) + if path.stem=='app-info-update': + condition=None + if p['name'] in ('price','priceDetail') and '当isFree为0时,此参数必选' in p['description']: + condition='isFree' + if p['name'] in ('registeredEntity','registeredEntityName') and '当registeredDclType值为0' in p['description'] and '该字段必填' in p['description']: + condition='registeredDclType' + if condition: + rules.append({'id':'conditional-'+p['name'],'kind':'required_if','field':'body.'+p['name'],'when':{'field':'body.'+condition,'equals':'0'},'sourceUrl':p['sourceUrl'],'message':p['name']+' is required when '+condition+'=0.','suggestion':'Supply '+p['name']+' for the selected application settings.'}) + if path.stem in ('app-info-update','app-submit-with-file') and p['name'] in ('deviceTypes','phasedReleaseInfo'): + if len(bodies)!=2:raise ValueError('Nested legacy model needs review') + key='itemsProperties' if p['type']=='array' else 'properties' + p[key]=[field(child,'body',bodies[1]['sourceUrl']) for child in bodies[1]['rows'][1:]] + if path.stem=='app-submit' and p['required']: + # The page explicitly makes Body release fields conditional on + # Query releaseType=3; the empty commercial request is its example. + if not any('当releaseType为3时' in note['text'] for note in doc['notes']): + raise ValueError('Conditional legacy submit Body needs review') + p['required']=False + rules.append({'id':'phased-'+p['name'],'kind':'required_if','field':'body.'+p['name'],'when':{'field':'query.releaseType','equals':'3'},'sourceUrl':bodies[0]['sourceUrl'],'message':p['name']+' is required for phased releaseType=3.','suggestion':'Supply this documented phased-release field or choose the intended release type.'}) + fields['body.'+p['name']]=p + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(list(fields.values()),ensure_ascii=False,indent=2)+'\n') + if rules:path.with_name(path.stem+'.rules.json').write_text(json.dumps(rules,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-pms-parameter-contracts.py b/scripts/build-pms-parameter-contracts.py new file mode 100644 index 0000000..b3a67a9 --- /dev/null +++ b/scripts/build-pms-parameter-contracts.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +"""Normalize browser-reviewed PMS root parameter tables. + +PMS pages list literal request properties; linked models stay separate. +The multipart resource endpoint is deliberately handled by its file adapter. +Authentication alternatives belong to credential handling, not required inputs. +""" +import json +import re +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] / 'pkg/domain/reference/pms' +AUTH_FIELDS = {'authorization', 'client_id', 'oauth2token', 'teamid'} +for path in sorted(ROOT.glob('*.json')): + if path.stem.count('.'): + continue + doc = json.loads(path.read_text()) + parameters = {} + for table in doc['tables']: + location = table['location'] + if table['section'] != '请求参数' or location not in ('header', 'query', 'body', 'path'): + continue + for row in table['rows'][1:]: + if len(row) != 4 or row[1] not in ('M', 'O'): + raise ValueError(f'Unexpected parameter row in {path}: {row}') + name, required, typ, description = row + if location == 'header' and name.lower() in AUTH_FIELDS: + continue + if typ == 'MultipartFile': + kind = 'file' + elif typ.startswith('String'): + kind = 'string' + elif typ.startswith('Integer') or typ == 'Long': + kind = 'integer' + elif typ.startswith('List<'): + kind = 'array' + elif any(link['title'] == typ for link in doc['links']): + kind = 'object' + else: + raise ValueError(f'Unreviewed parameter type {typ} in {path}') + field = {'name': name, 'in': 'file' if kind == 'file' else location, 'type': kind, 'required': required == 'M', 'description': description, 'sourceUrl': table['sourceUrl']} + if kind == 'array': + field['itemsType'] = 'string' if typ.startswith('List', typ) + inner = array[1] if array else typ + length = re.fullmatch(r'String(?:\((\d+)\))?', inner) + if length: + kind = 'string' + if length[1]: + p['itemsMaxLength' if array else 'maxLength'] = int(length[1]) + elif inner.startswith('Integer'): + kind = 'integer' + elif inner == 'boolean': + kind = 'boolean' + else: + kind = 'object' + links = {x['sourceUrl'].split('#')[0] for x in doc['links'] + if x['title'] == inner or x['title'].startswith(inner + '(')} + if len(links) != 1 or next(iter(links)) not in documents: + raise ValueError(f'Uncaptured or ambiguous model {inner} in {url}') + p['itemsProperties' if array else 'properties'] = fields(next(iter(links)), stack + (url,)) + p['type'] = 'array' if array else kind + if array: + p['itemsType'] = kind + maximum = re.search(r'数组长度不超过(\d+)', description) + interval = re.search(r'数组长度为(\d+)~(\d+)', description) + if maximum: + p['maxItems'] = int(maximum[1]) + if interval: + p.update(minItems=int(interval[1]), maxItems=int(interval[2])) + if kind == 'integer' and '取值范围:' in description: + text = re.split(r'默认值|说明|注意', description.split('取值范围:', 1)[1])[0] + values = re.findall(r'(?:^|\s)(-?\d+):', text) + if values: + p['itemsEnum' if array else 'enum'] = sorted(set(values), key=int) + if name == 'lang' and doc['title'] == 'AgreementInfo(隐私政策协议)': + p['enum'] = re.findall(r'(?:^|\s)([a-zA-Z-]+):', description.split('取值范围:', 1)[1]) + result.append(p) + return result + + +source = 'https://developer.huawei.com/consumer/cn/doc/doccenter-submission/agc-help-publish-api-data-agreementinfo-privacy-0000002294845630' +(ROOT / 'privacy-agreement-info.contract.json').write_text( + json.dumps({'sourceUrl': source, 'parameters': fields(source)}, ensure_ascii=False, indent=2) + '\n') diff --git a/scripts/build-product-import-contracts.py b/scripts/build-product-import-contracts.py new file mode 100644 index 0000000..1e57870 --- /dev/null +++ b/scripts/build-product-import-contracts.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +"""Build reviewed ProductImportInfo contracts from browser-captured model tables. + +Only explicit types, String(N) lengths and manually reviewed enums/conditions +are encoded. Referenced models with no reviewed schema retain object shape. +""" +import json +import re +from pathlib import Path + +REFERENCE = Path(__file__).resolve().parents[1] / 'pkg/domain/reference/supplemental' +MODELS = {'defaultPriceInfo': 'defaultproductpriceinfo', 'languages': 'productlanguageinfo', 'prices': 'productpriceinfo', 'promotion': 'promotioninfo'} + + +def fields(document): + result = [] + for name, required, typ, description in document['tables'][0]['rows'][1:]: + if typ.startswith('String'): + kind = 'string' + elif typ.startswith('Integer') or typ == 'Long': + kind = 'integer' + elif typ.startswith('List<'): + kind = 'array' + else: + # These named objects are explicit model references in the table. + if not any(link['title'] == typ for link in document['links']): + raise ValueError(f'Unreviewed type {typ} in {document["sourceUrl"]}') + kind = 'object' + field = {'name': name, 'in': 'body', 'type': kind, 'required': required == 'M', 'description': description, 'sourceUrl': document['sourceUrl']} + if kind == 'array': + field['itemsType'] = 'string' if typ.startswith('List') or required not in ('M','O'): + raise ValueError(f'Unreviewed project field: {path}, {name}, {typ}') + p={'name':name,'in':loc,'type':{'String':'string','Integer':'integer','List':'array'}[typ],'required':required=='M','description':description,'sourceUrl':table['sourceUrl']} + if typ=='List': + p['itemsType']='string' + if path.stem=='queryprojectlist' and name=='teamId': + p['required']=False + rules.append({'id':'oauth-team','kind':'required_with','field':'header.teamId','fields':['header.oauth2Token'],'sourceUrl':table['sourceUrl'],'message':'teamId is required with OAuth authorization.','suggestion':'Supply the selected OAuth team ID in the teamId header.'}) + if name=='fromRecCount': p['minimum']=1 + if name=='maxReqCount': p['maximum']=1000 + if name=='queryFlag': p['enum']=['0','1'] + if path.stem=='appbriefinfo' and name=='appType': + values=re.findall(r'(?:^|\s)(\d+):',description) + if not values:raise ValueError('Application types require a reviewed enumeration') + p['enum']=list(dict.fromkeys(values)) + if name=='addCertFingerprints': + p['maxItems']=5 + p['itemsPattern']='^[^:]*$' + fields[loc+'.'+name]=p + if path.stem=='appbriefinfo': + source=fields['query.appId']['sourceUrl'] + if '最大100个' not in fields['query.packageNames']['description'] or '以appId为准' not in fields['query.packageNames']['description']:raise ValueError('Package list limit and precedence need review') + rules.append({'id':'application-package-count','kind':'csv_count','field':'query.packageNames','minItems':1,'maxItems':100,'unlessPresent':'query.appId','sourceUrl':fields['query.packageNames']['sourceUrl'],'message':'packageNames accepts at most 100 nonempty comma-separated package names.','suggestion':'Use at most 100 package names, or select applications with appId, which takes precedence.'}) + rules.append({'id':'application-identity','kind':'at_least_one','fields':['query.appId','query.packageNames'],'sourceUrl':source,'message':'Supply appId or packageNames to select applications.','suggestion':'Provide a comma-separated appId list or packageNames list; appId takes precedence when both exist.'}) + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(list(fields.values()),ensure_ascii=False,indent=2)+'\n') + if rules: + path.with_name(path.stem+'.rules.json').write_text(json.dumps(rules,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-provisioning-parameter-contracts.py b/scripts/build-provisioning-parameter-contracts.py new file mode 100644 index 0000000..44f9cde --- /dev/null +++ b/scripts/build-provisioning-parameter-contracts.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +"""Build Provisioning root and linked model contracts from reviewed pages.""" +import json +import re +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1]/'pkg/domain/reference/provisioning' + +def parameter(name,required,typ,description,location,source): + kind='string' if typ.startswith('String') else 'integer' if typ.startswith('Integer') else 'array' if typ.startswith('List<') else None + if kind is None or required not in ('M','O'): + raise ValueError(f'Unreviewed type {typ}: {source}') + p={'name':name,'in':location,'type':kind,'required':required=='M','description':description,'sourceUrl':source} + length=re.fullmatch(r'String\((\d+)\)',typ) + if length:p['maxLength']=int(length[1]) + if kind=='array': + p['itemsType']='string' if typ.startswith('List',typ) + if length:p['itemsMaxLength']=int(length[1]) + bounds=re.search(r'数组长度为(\d+)~(\d+)',description) + maximum=re.search(r'(?:数组长度不超过|最大长度)(\d+)',description) + if bounds:p.update(minItems=int(bounds[1]),maxItems=int(bounds[2])) + elif maximum:p['maxItems']=int(maximum[1]) + if kind=='integer': + bounds=re.search(r'取值范围:\[(\d+),(\d+)\]',description) + minimum=re.search(r'(?:最小值:|最小为)(\d+)',description) + if bounds:p.update(minimum=int(bounds[1]),maximum=int(bounds[2])) + elif minimum:p['minimum']=int(minimum[1]) + return p + +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem:continue + doc=json.loads(path.read_text());fields={};rules=[] + for table in doc['tables']: + loc=table['location'] + if table['section']!='请求参数' or loc not in ('header','query','body','path'):continue + for name,required,typ,description in table['rows'][1:]: + if name.lower() in ('authorization','client_id','oauth2token'):continue + if name=='aclPermissionList' and path.stem=='provision-api-applyacl': + # The table's singular model label contradicts its actual JSON example. + if not any(re.search(r'"aclPermissionList"\s*:\s*\[',x['text']) for x in doc['examples']): + raise ValueError('ACL request array needs a reviewed wire example') + typ='List' + p=parameter(name,required,typ,description,loc,table['sourceUrl']) + if name=='teamId': + p['required']=False + rules.append({'id':'oauth-team','kind':'required_with','field':'header.teamId','fields':['header.oauth2Token'],'sourceUrl':table['sourceUrl'],'message':'OAuth authorization requires its selected teamId.','suggestion':'Supply the selected OAuth team ID in the teamId header.'}) + if name=='certType':p['enum']=['1','2','3','4'] + if name=='provisionType':p['enum']=['1','2','3','6'] + if name=='order':p['enum']=['1','2'] + if name=='lang':p['enum']=['zh','en','ru'] + model_name='add-device-info' if typ=='List' else 'acl-apply-permission-info' if typ=='List' else None + if model_name: + model=json.loads((ROOT.parent/'supplemental'/f'{model_name}.json').read_text()) + children=[parameter(*row,'body',model['sourceUrl']) for row in model['tables'][0]['rows'][1:]] + for child in children: + if child['name']=='deviceType':child['enum']=['1','2','4','5','8','19'] + p['itemsProperties']=children + fields[loc+'.'+name]=p + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(list(fields.values()),ensure_ascii=False,indent=2)+'\n') + if rules:path.with_name(path.stem+'.rules.json').write_text(json.dumps(rules,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-report-parameter-contracts.py b/scripts/build-report-parameter-contracts.py new file mode 100644 index 0000000..e4040b8 --- /dev/null +++ b/scripts/build-report-parameter-contracts.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +"""Normalize each browser-reviewed report table and its explicit date rules.""" +import json +import re +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] / 'pkg/domain/reference/reports' +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem: + continue + doc = json.loads(path.read_text()) + parameters, rules = [], [] + for table in doc['tables']: + location = table['location'] + if table['section'] != '请求参数' or location not in ('path', 'query'): + continue + for name, required, typ, description in table['rows'][1:]: + kind = 'array' if typ.startswith('List') else 'integer' if typ.startswith('Integer') else 'string' if typ.startswith('String') else None + if kind is None or required not in ('M', 'O'): + raise ValueError(f'Unreviewed report parameter: {path}, {name}, {typ}') + p = {'name': name, 'in': location, 'type': kind, 'required': required == 'M', 'description': description, 'sourceUrl': table['sourceUrl']} + if kind == 'array': p['itemsType'] = 'string' + maximum = re.fullmatch(r'String\((\d+)\)', typ) + if maximum: p['maxLength'] = int(maximum[1]) + if name == 'language': p['enum'] = ['zh-CN'] if path.stem == 'gamereservationexport' else ['zh-CN', 'en-US', 'ru-RU'] + if name == 'currency': p['enum'] = ['CNY', 'EUR', 'USD'] + if name == 'exportType': p['enum'] = ['CSV', 'EXCEL'] + if name in ('userTag', 'queryType'): p['enum'] = ['0', '1'] + if name == 'startTime': + days = re.search(r'不超过(\d+)天', description) + if not days: raise ValueError(f'Missing explicit interval limit: {path}') + rules.append({'id':'report-date-window','kind':'date_window','fields':['query.startTime','query.endTime'],'maxDays':int(days[1]),'sourceUrl':table['sourceUrl'],'message':'Report dates must be real YYYYMMDD dates in chronological order within the documented query interval.','suggestion':f'Use YYYYMMDD dates with endTime at or after startTime and no more than {days[1]} days apart.'}) + parameters.append(p) + if any(p['name']=='filterConditionValue' for p in parameters): + rules.append({'id':'ordered-filter-pairs','kind':'equal_length','fields':['query.filterCondition','query.filterConditionValue'],'sourceUrl':next(p['sourceUrl'] for p in parameters if p['name']=='filterConditionValue'),'message':'Each filterCondition must have a filterConditionValue at the same position.','suggestion':'Repeat both query keys once per filter, preserving matching order.'}) + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(parameters,ensure_ascii=False,indent=2)+'\n') + path.with_name(path.stem+'.rules.json').write_text(json.dumps(rules,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-resource-parameter-contracts.py b/scripts/build-resource-parameter-contracts.py new file mode 100644 index 0000000..0937615 --- /dev/null +++ b/scripts/build-resource-parameter-contracts.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +"""Normalize reviewed resource tables using their actual request-model nesting.""" +import json +import re +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1]/'pkg/domain/reference/resources' +NESTED={'respackapi-addversion':('resourceVersion','properties'),'respackapi-modifyversion':('resourceVersion','properties'),'respackapi-uploadapplyfor':('filePartApplyInfo','itemsProperties'),'respackapi-uploadconfirm':('filePartConfirmInfos','itemsProperties')} + +def field(row,loc,source): + name,required,typ,description=row + kind='string' if typ=='String' else 'integer' if typ.startswith('Int') or typ=='Long' else 'array' if typ.startswith('List<') else 'object' if typ in ('GWOpPackageVersion','GWOpPackageVersionEntity') else None + if kind is None or required not in ('M','O'):raise ValueError(f'Unreviewed resource field {name}:{typ}') + p={'name':name,'in':loc,'type':kind,'required':required=='M','description':description,'sourceUrl':source} + maximum=re.search(r'(?:最大长度为?|最长)(\d+)个?字符',description) + if kind=='string' and maximum:p['maxLength']=int(maximum[1]) + if name=='fileName' and '名称不能包含特殊字符' in description: + p['pattern']=r'^[^|:/\\*?"<>]+$' + if kind=='array':p['itemsType']='object' + if name in ('isDraft','uploadResult'):p['enum']=['0','1'] + if name=='fileType':p['enum']=['0'] + if kind=='integer': + bounds=re.search(r'取值范围[::]?\[(\d+),(\d+)\]',description) + if bounds:p.update(minimum=int(bounds[1]),maximum=int(bounds[2])) + if name=='version' and '不超过9位' in description:p['maximum']=999999999 + if name=='filePartApplyInfo':p['maxItems']=1000 + return p + +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem:continue + doc=json.loads(path.read_text());fields={};rules=[] + tables=[t for t in doc['tables'] if t['section']=='请求参数'] + for table in tables: + if table['location'] not in ('header','query','path'):continue + for row in table['rows'][1:]: + if row[0] in ('client_id','Authorization'):continue + p=field(row,table['location'],table['sourceUrl']);fields[p['in']+'.'+p['name']]=p + bodies=[t for t in tables if t['location']=='body'] + if path.stem in NESTED: + if len(bodies)!=3:raise ValueError(f'Resource model tables need review: {path}') + # Table 0 names a logical request model. Table 1 is the JSON root; + # table 2 defines its object/list member, as shown by request examples. + name,property_key=NESTED[path.stem] + if not any('"'+name+'"' in x['text'] for x in doc['examples'] if x['section']=='请求示例'):raise ValueError('Missing reviewed literal root request example') + for row in bodies[1]['rows'][1:]: + p=field(row,'body',bodies[1]['sourceUrl']) + if row[0]==name:p[property_key]=[field(child,'body',bodies[2]['sourceUrl']) for child in bodies[2]['rows'][1:]] + fields['body.'+p['name']]=p + if path.stem=='respackapi-queryfile': + if '取值范围:[1,500]' not in fields['query.fileIds']['description']:raise ValueError('Resource CSV limit needs review') + rules.append({'id':'resource-file-id-count','kind':'csv_count','field':'query.fileIds','minItems':1,'maxItems':500,'sourceUrl':fields['query.fileIds']['sourceUrl'],'message':'fileIds requires 1 to 500 nonempty comma-separated file IDs.','suggestion':'Supply at most 500 file IDs separated by commas without empty entries, or select a versionId.'}) + rules.append({'id':'resource-file-identity','kind':'at_least_one','fields':['query.versionId','query.fileIds'],'sourceUrl':fields['query.fileIds']['sourceUrl'],'message':'Supply versionId or fileIds to select resource files.','suggestion':'Provide the resource version ID or a comma-separated file ID list.'}) + if '选择一个传入' not in fields['query.fileIds']['description']:raise ValueError('Resource identity selection needs review') + rules.append({'id':'resource-file-identity-exclusive','kind':'at_most_one','fields':['query.versionId','query.fileIds'],'sourceUrl':fields['query.fileIds']['sourceUrl'],'message':'Select either versionId or fileIds, as documented.','suggestion':'Keep one resource-file selector and remove the other.'}) + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(list(fields.values()),ensure_ascii=False,indent=2)+'\n') + if rules:path.with_name(path.stem+'.rules.json').write_text(json.dumps(rules,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-testing-feedback-contracts.py b/scripts/build-testing-feedback-contracts.py new file mode 100644 index 0000000..39b8b7c --- /dev/null +++ b/scripts/build-testing-feedback-contracts.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +"""Replace logical wrapper labels with browser-reviewed literal root fields.""" +import json +import re +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1]/'pkg/domain/reference' +for endpoint,model_name in [('test-api-query-feedback','testing-feedback-list-request'),('test-api-delete-feedback','testing-delete-feedback-request')]: + doc=json.loads((ROOT/'testing'/f'{endpoint}.json').read_text()) + model=json.loads((ROOT/'supplemental'/f'{model_name}.json').read_text()) + fields={} + for table in doc['tables']: + if table['section']=='请求参数' and table['location']=='header': + for name,required,typ,description in table['rows'][1:]: + if name=='appId':fields['header.appId']={'name':name,'in':'header','type':'string','required':required=='M','description':description,'sourceUrl':table['sourceUrl'],'maxLength':32} + for name,required,typ,description in model['tables'][0]['rows'][1:]: + kind='string' if typ.startswith('String') else 'integer' if typ=='Integer' else 'array' if typ.startswith('List',typ) + if length:p['itemsMaxLength']=int(length[1]) + if name=='deleteMode':p['enum']=['1','2'] + if name=='delFeedBackInfos': + if not any(re.search(r'"delFeedBackInfos"\s*:\s*\[',x['text']) for x in doc['examples']):raise ValueError('Deletion array requires a reviewed request example') + child=json.loads((ROOT/'supplemental/testing-delete-feedback-info.json').read_text()) + p['itemsProperties']=[{'name':row[0],'in':'body','type':'string','required':row[1]=='M','maxLength':int(re.fullmatch(r'String\((\d+)\)',row[2])[1]),'description':row[3],'sourceUrl':child['sourceUrl']} for row in child['tables'][0]['rows'][1:]] + fields['body.'+name]=p + (ROOT/'testing'/f'{endpoint}.parameters.json').write_text(json.dumps(list(fields.values()),ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-testing-parameter-contracts.py b/scripts/build-testing-parameter-contracts.py new file mode 100644 index 0000000..3e77b13 --- /dev/null +++ b/scripts/build-testing-parameter-contracts.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +"""Normalize literal Testing request tables; logical wrappers need model review.""" +import json +import re +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1]/'pkg/domain/reference/testing' +WRAPPERS={'test-api-create-open-test-link','test-api-delete-feedback','test-api-query-feedback'} + +def extension_fields(model_name): + model=json.loads((ROOT.parent/'supplemental'/f'{model_name}.json').read_text()) + result=[] + for name,required,typ,description in model['tables'][0]['rows'][1:]: + kind='string' if typ.startswith('String') else 'integer' if typ.startswith('Integer') else 'array' if typ.startswith('List<') else 'object' if typ=='AppReviewContact' else None + if kind is None:raise ValueError(f'Unreviewed extension type {typ}') + p={'name':name,'in':'body','type':kind,'required':required=='M','description':description,'sourceUrl':model['sourceUrl']} + length=re.fullmatch(r'String\((\d+)\)',typ) + if length:p['maxLength']=int(length[1]) + if kind=='integer' and '取值范围:' in description: + enum_text=re.split(r'说明|注意|默认值',description.split('取值范围:',1)[1])[0] + values=re.findall(r'(?:^|\s)(-?\d+):',enum_text) + if values:p['enum']=sorted(set(values),key=int) + if kind=='array': + p['itemsType']='integer' if typ.startswith('List' else 'string' + if typ=='List':p['itemsProperties']=extension_fields('testing-group-info') + if p['itemsType']=='integer' and '取值范围:' in description: + enum_text=re.split(r'说明|注意|默认值',description.split('取值范围:',1)[1])[0] + values=re.findall(r'(?:^|\s)(-?\d+):',enum_text) + if values:p['itemsEnum']=sorted(set(values),key=int) + item_length=re.fullmatch(r'List',typ) + if item_length:p['itemsMaxLength']=int(item_length[1]) + maximum=re.search(r'数组长度不超过(\d+)',description) + if maximum:p['maxItems']=int(maximum[1]) + if kind=='object':p['properties']=extension_fields('testing-app-review-contact') + result.append(p) + return result +for path in sorted(ROOT.glob('*.json')): + if '.' in path.stem or path.stem in WRAPPERS-{'test-api-create-open-test-link'}:continue + doc=json.loads(path.read_text());fields={};rules=[] + for table in doc['tables']: + loc=table['location'] + if table['section']!='请求参数' or loc not in ('header','query','body','path'):continue + # This page calls Body "request" but its example has an unwrapped + # groupId/limit object. Requiredness is undocumented: review headers only + # rather than inventing a wrapper or mandatory example fields. + if path.stem=='test-api-create-open-test-link' and loc=='body':continue + for name,required,typ,description in table['rows'][1:]: + if name.lower() in ('authorization','client_id','oauth2token'):continue + kind='string' if typ.startswith('String') else 'integer' if typ.lower().startswith('integer') else 'array' if typ.startswith('List<') else 'object' if any(x['title']==typ for x in doc['links']) else None + if kind is None or required not in ('M','O'):raise ValueError(f'Unreviewed Testing field {name}:{typ} in {path}') + p={'name':name,'in':loc,'type':kind,'required':required=='M','description':description,'sourceUrl':table['sourceUrl']} + if name=='teamId': + p['required']=False + rules.append({'id':'oauth-team','kind':'required_with','field':'header.teamId','fields':['header.oauth2Token'],'sourceUrl':table['sourceUrl'],'message':'OAuth authorization requires its selected teamId.','suggestion':'Supply the selected OAuth team ID in the teamId header.'}) + length=re.fullmatch(r'String\((\d+)\)',typ) + if length:p['maxLength']=int(length[1]) + if kind=='array': + p['itemsType']='string' if typ.startswith('List',typ) + if length:p['itemsMaxLength']=int(length[1]) + maximum=re.search(r'数组长度不超过(\d+)',description) + if maximum:p['maxItems']=int(maximum[1]) + if kind=='integer': + bounds=re.search(r'\[(\d+),(\d+)\]',description) + if bounds:p.update(minimum=int(bounds[1]),maximum=int(bounds[2])) + text=description.split('默认值')[0].split('说明')[0] + enums=re.findall(r'(?:取值范围:|\s)(\d+)[::]',text) + if enums:p['enum']=list(dict.fromkeys(enums)) + if path.stem=='test-api-modify-test-version' and name=='languages': + model=json.loads((ROOT.parent/'supplemental/testing-app-language.json').read_text()) + children=[] + for child_name,child_required,child_type,child_description in model['tables'][0]['rows'][1:]: + child_kind='array' if child_type=='List' else 'string' + child={'name':child_name,'in':'body','type':child_kind,'required':child_required=='M','description':child_description,'sourceUrl':model['sourceUrl']} + length=re.fullmatch(r'String\((\d+)\)',child_type) + if length:child['maxLength']=int(length[1]) + minimum=re.search(r'不少于(\d+)个字符',child_description) + if minimum:child['minLength']=int(minimum[1]) + if child_kind=='array': + child.update(itemsType='object',maxItems=6) + material=json.loads((ROOT.parent/'supplemental/testing-device-material.json').read_text()) + material_fields=[] + for field_name,field_required,field_type,field_description in material['tables'][0]['rows'][1:]: + field_kind='integer' if field_type=='Integer' else 'array' if field_type.startswith('List<') else 'string' if field_type.startswith('String(') else None + if field_kind is None:raise ValueError(f'Unreviewed DeviceMaterial type: {field_type}') + field={'name':field_name,'in':'body','type':field_kind,'required':field_required=='M','description':field_description,'sourceUrl':material['sourceUrl']} + if field_kind=='integer': + field['enum']=re.findall(r'(\d+):',field_description) + elif field_kind=='array': + field.update(itemsType='string',itemsMaxLength=300,maxItems=10) + if field_name=='screenShots':field['minItems']=3 + else: + field.update(maxLength=300,minLength=1) + material_fields.append(field) + child['itemsProperties']=material_fields + children.append(child) + p['itemsProperties']=children + if path.stem=='test-api-add-test-package' and name=='file': + model=json.loads((ROOT.parent/'supplemental/testing-package-file-info.json').read_text()) + p['properties']=[] + for field_name,field_required,field_type,field_description in model['tables'][0]['rows'][1:]: + length=re.fullmatch(r'String\((\d+)\)',field_type) + if not length:raise ValueError(f'Unreviewed FileInfo type: {field_type}') + p['properties'].append({'name':field_name,'in':'body','type':'string','required':field_required=='M','maxLength':int(length[1]),'description':field_description,'sourceUrl':model['sourceUrl']}) + if path.stem=='test-api-modify-test-version' and name in ('deviceTypes','openTestInfo','packagePermissionIntroVideoList'): + model_name={'deviceTypes':'testing-device-type-info','openTestInfo':'testing-open-test-info','packagePermissionIntroVideoList':'testing-package-permission-intro-video'}[name] + model=json.loads((ROOT.parent/'supplemental'/f'{model_name}.json').read_text()) + children=[] + for field_name,field_required,field_type,field_description in model['tables'][0]['rows'][1:]: + field_kind='integer' if field_type.startswith('Integer') else 'string' if field_type.startswith('String') else 'object' if field_type=='TestTaskInfo' else None + if field_kind is None:raise ValueError(f'Unreviewed {model_name} type: {field_type}') + child={'name':field_name,'in':'body','type':field_kind,'required':field_required=='M','description':field_description,'sourceUrl':model['sourceUrl']} + length=re.fullmatch(r'String\((\d+)\)',field_type) + if length:child['maxLength']=int(length[1]) + if field_name=='deviceType': + child['enum']=re.findall(r'(\d+):',field_description.split('说明')[0]) + if field_type=='TestTaskInfo': + child['properties']=extension_fields('testing-test-task-info') + children.append(child) + p['properties' if name=='openTestInfo' else 'itemsProperties']=children + if path.stem=='test-api-modify-test-version' and name=='extInfo': + p['properties']=extension_fields('testing-version-ext-info') + source=next(child['sourceUrl'] for child in p['properties'] if child['name']=='aiTypes') + rules.append({'id':'testing-ai-types','kind':'required_if','field':'body.extInfo.aiTypes','when':{'field':'body.extInfo.isAiGenerate','equals':'1'},'sourceUrl':source,'message':'AI-generated services require aiTypes.','suggestion':'Supply the documented AI service types in extInfo.aiTypes.'}) + if path.stem=='test-api-modify-test-version' and name=='versionVocReq': + p['itemsProperties']=extension_fields('testing-version-voc-req') + fields[loc+'.'+name]=p + if path.stem=='test-api-delete-invite-code': + example=next(x for x in doc['examples'] if x['section']=='请求示例') + if 'invitationCodeId=' not in example['text']: + raise ValueError('Invitation deletion query needs a reviewed wire example') + # The parameter table omits this existing verified required identifier; + # the official request example confirms its Query location. + fields['query.invitationCodeId']={'name':'invitationCodeId','in':'query','type':'string','required':True,'description':'待删除的邀请码ID;参数表缺漏,Query位置由官方请求示例确认。','sourceUrl':example['sourceUrl']} + path.with_name(path.stem+'.parameters.json').write_text(json.dumps(list(fields.values()),ensure_ascii=False,indent=2)+'\n') + if rules:path.with_name(path.stem+'.rules.json').write_text(json.dumps(rules,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/build-upload-address-contract.py b/scripts/build-upload-address-contract.py new file mode 100644 index 0000000..c933065 --- /dev/null +++ b/scripts/build-upload-address-contract.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +"""Normalize the browser-reviewed OBS upload address query table.""" +import json +import re +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1]/'pkg/domain/reference/upload' +doc=json.loads((ROOT/'upload-url-new.json').read_text()) +fields=[] +for table in doc['tables']: + if table['section']!='请求参数' or table['location']!='query':continue + for name,required,typ,description in table['rows'][1:]: + kind='string' if typ.startswith('String') else 'integer' if typ=='Integer' else None + if kind is None:raise ValueError(f'Unreviewed upload type {typ}') + p={'name':name,'in':'query','type':kind,'required':required=='M','description':description,'sourceUrl':table['sourceUrl']} + length=re.fullmatch(r'String\((\d+)\)',typ) + if length:p['maxLength']=int(length[1]) + if name=='releaseType':p['enum']=['1'] + if name=='chineseMainlandFlag':p['enum']=['0','1'] + fields.append(p) +(ROOT/'upload-url-new.parameters.json').write_text(json.dumps(fields,ensure_ascii=False,indent=2)+'\n') diff --git a/scripts/capture-functions-source.py b/scripts/capture-functions-source.py new file mode 100644 index 0000000..5ee6f14 --- /dev/null +++ b/scripts/capture-functions-source.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +"""Capture an allowlist of public vendor source files, never scratch or sessions.""" +import argparse,hashlib,json +from pathlib import Path +p=argparse.ArgumentParser(description=__doc__);p.add_argument('--package-root',type=Path,required=True);p.add_argument('--checked-at',required=True);a=p.parse_args();root=Path(__file__).resolve().parents[1] +meta=json.loads((a.package_root/'package.json').read_text());assert meta['name']=='@hw-agconnect/agc-cli' and meta['version']=='1.12.0','Review a changed vendor version before changing the native contract' +shared=['commands/cloudfunction/api/functionApi.js','commands/cloudfunction/api/layerApi.js','commands/cloudfunction/option/options.js','commands/cloudfunction/option/verify.js','commands/cloudfunction/option/parse.js','commands/cloudfunction/util/tools.js','modules/request/edge.js'] +commands={'create-function':'createFunctionCmd.js','update-function-code':'updateFunctionCodeCmd.js','update-function-config':'updateFunctionConfigCmd.js','publish-function':'publishFunctionCmd.js','update-and-publish-function':'updateAndPublishFunctionCmd.js','invoke':'invokeCmd.js','list-functions':'listFunctionsCmd.js','query-function-version':'queryFunctionVersionCmd.js','list-function-versions':'listFunctionVersionsCmd.js'} +for op,command in commands.items(): + evidence=[] + for relative in shared+['commands/cloudfunction/cmd/function/'+command]: + raw=(a.package_root/relative).read_bytes();evidence.append({'packagePath':relative,'sha256':hashlib.sha256(raw).hexdigest(),'source':raw.decode()}) + doc={'title':op,'sourceUrl':'https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0','checkedAt':a.checked_at,'status':'vendor-source-reviewed','package':meta['name'],'version':meta['version'],'sourceFiles':evidence,'notes':[{'text':'Public vendor CLI source is evidence of HTTP behavior, not a published REST specification or live validation. Explicit OAuth session required. Native Go preserves TLS verification, revision workflows and original file bytes; it does not read vendor scratch or invoke Node.'}],'limitations':['The reviewed vendor package advertises older runtimes; current cloud runtime availability needs dedicated-resource verification.','Function trigger/alias/layer lifecycle and template deployment are not implied by these nine function workflows.','Management responses omit environment/session values; invocation application results remain unchanged.','Native responses above 16 MiB return an explicit local-limit error.']} + target=root/'pkg/domain/reference/functions'/f'{op}.json';target.parent.mkdir(exist_ok=True);target.write_text(json.dumps(doc,ensure_ascii=False,indent=2)+'\n') +print('Captured 9 native function workflows with public vendor source hashes.') diff --git a/scripts/certificate-fingerprint.py b/scripts/certificate-fingerprint.py new file mode 100644 index 0000000..76c0384 --- /dev/null +++ b/scripts/certificate-fingerprint.py @@ -0,0 +1,32 @@ +"""Select a signing certificate by CSR public key, independently of chain order.""" +import subprocess +import hashlib +import re +import ssl + + +def certificate_fingerprint_for_csr(certificate_path, csr_path): + """证书链无序;只对与本次 CSR 公钥一致的实体证书计算指纹。""" + key = subprocess.run(["openssl", "req", "-in", str(csr_path), "-pubkey", "-noout"], capture_output=True, timeout=20) + if key.returncode or not key.stdout.strip(): + raise RuntimeError("CSR public key extraction failed") + content = certificate_path.read_bytes() + pattern = rb"-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----" + blocks = re.findall(pattern, content, re.DOTALL) + if not blocks: + for command in (["openssl", "pkcs7", "-inform", "DER", "-in", str(certificate_path), "-print_certs"], ["openssl", "x509", "-inform", "DER", "-in", str(certificate_path), "-outform", "PEM"]): + decoded = subprocess.run(command, capture_output=True, timeout=20) + if decoded.returncode == 0: + blocks = re.findall(pattern, decoded.stdout, re.DOTALL) + if blocks: break + matches = [] + for block in blocks: + public = subprocess.run(["openssl", "x509", "-pubkey", "-noout"], input=block, capture_output=True, timeout=20) + if public.returncode: + raise RuntimeError("Malformed certificate in downloaded chain") + if public.stdout.strip() == key.stdout.strip(): + matches.append(hashlib.sha256(ssl.PEM_cert_to_DER_cert(block.decode("ascii"))).hexdigest().upper()) + if len(matches) != 1: + raise RuntimeError("Certificate chain must contain exactly one CSR-matching signing certificate") + return matches[0] + diff --git a/scripts/check-coverage.py b/scripts/check-coverage.py new file mode 100644 index 0000000..bfc8739 --- /dev/null +++ b/scripts/check-coverage.py @@ -0,0 +1,44 @@ +"""Keep each coverage run isolated; publish the complete profile atomically.""" +import argparse +import os +import pathlib +import re +import shlex +import subprocess +import tempfile + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--go', default='go') + parser.add_argument('--minimum', type=float) + args = parser.parse_args() + command = shlex.split(args.go) + with tempfile.TemporaryDirectory(prefix='agc-coverage-') as work: + profile = pathlib.Path(work)/'coverage.out' + result = subprocess.run([*command,'test','./...','-coverprofile='+str(profile)]) + if result.returncode: return result.returncode + result = subprocess.run([*command,'tool','cover','-func='+str(profile)],capture_output=True,text=True) + print(result.stdout,end='') + if result.returncode: + print(result.stderr,end='') + return result.returncode + matches = re.findall(r'^total:\s+.*?([\d.]+)%\s*$',result.stdout,re.MULTILINE) + if len(matches)!=1: raise RuntimeError('Missing unambiguous total coverage') + total = float(matches[0]) + # 兼容已有本地报告路径;独立校验完成后才保存,读者不会看到半写文件。 + fd, temporary = tempfile.mkstemp(prefix='.coverage-',dir='.') + try: + with os.fdopen(fd,'wb') as output: output.write(profile.read_bytes()) + os.replace(temporary,'coverage.out') + finally: + pathlib.Path(temporary).unlink(missing_ok=True) + if args.minimum is not None: + if total < args.minimum: + print(f'coverage {total:.1f}% is below {args.minimum:.1f}%') + return 1 + print(f'coverage {total:.1f}% >= {args.minimum:.1f}%') + return 0 + + +if __name__=='__main__': raise SystemExit(main()) diff --git a/scripts/check-docs.py b/scripts/check-docs.py index 5595216..befa6cd 100644 --- a/scripts/check-docs.py +++ b/scripts/check-docs.py @@ -91,7 +91,7 @@ def main() -> int: if args.files: files = [Path(name).resolve() for name in args.files] else: - patterns = ("README*.md", "CONTRIBUTING.md", "CHANGELOG.md", "docs/README.md", "docs/CLOUD_TESTING.md", "AGENTS.md", "docs/CLI_USAGE*.md", "docs/AGC_CLI_FULL_PLAN.md", "docs/features/**/*.md", ".github/pull_request_template.md") + patterns = ("README*.md", "CONTRIBUTING.md", "CHANGELOG.md", "docs/README.md", "docs/CLOUD_TESTING.md", "AGENTS.md", "docs/CLI_USAGE*.md", "docs/PUBLISHING*.md", "docs/AGC_CLI_FULL_PLAN.md", "docs/features/**/*.md", ".github/pull_request_template.md") files = sorted({file for pattern in patterns for file in ROOT.glob(pattern)}) errors = check(files) for error in errors: diff --git a/scripts/goal-progress.py b/scripts/goal-progress.py new file mode 100644 index 0000000..9913290 --- /dev/null +++ b/scripts/goal-progress.py @@ -0,0 +1,86 @@ +"""从原始接口清单与真实生命周期断言重建进度,不使用报告自报的成功数量。""" +import datetime +import importlib.util +import json +import pathlib +import re + +ROOT = pathlib.Path(__file__).resolve().parents[1] +spec = importlib.util.spec_from_file_location("lifecycle", pathlib.Path(__file__).with_name("live-lifecycle.py")) +lifecycle = importlib.util.module_from_spec(spec) +spec.loader.exec_module(lifecycle) + + +def collect(baseline, records): + original = {(r["family"], r["endpoint"]) for r in baseline["originalBlocked"]} + sources = {ledger["runId"]: ledger for _, ledger in records if ledger.get("runId")} + completed = {} + for filename, ledger in records: + features = lifecycle.verified_features(ledger) + if ledger.get("flow") == "domain-precheck-custom-host" and ledger.get("status") == "verified-precheck" and ledger.get("cleanupVerified") is True: + artifact = ledger.get("verificationFile", {}) + owned = ledger.get("owned", {}) + reads = ledger.get("publicReadbacks", []) + digest = artifact.get("sha256", "") + size = artifact.get("bytes") + valid_file = bool(ledger.get("appId")) and artifact.get("fileName") == ledger["appId"] + ".txt" and artifact.get("downloadHTTPStatus") == 200 and type(size) is int and size > 0 and re.fullmatch(r"[a-f0-9]{64}", digest) and artifact.get("sourceURL") == "https://connect-api.cloud.huawei.com/api/dms/domain-manage/v1/app/domain/verify-file" + valid_host = owned.get("workerName") and owned.get("hostname") and ledger.get("hostedDomain") == "https://" + owned["hostname"] + valid_reads = reads and all(r.get("httpStatus") == 200 and r.get("bytes") == size and r.get("sha256") == digest and r.get("matchesDownloadedFile") is True for r in reads) + passed = [s for s in ledger.get("steps", []) if s.get("family") == "domains" and s.get("endpoint") == "domain-api-precheck" and s.get("status") == "passed" and s.get("exitCode") == 0 and s.get("httpStatus") == 200 and s.get("businessCode") == 0] + if valid_file and valid_host and valid_reads and passed: + features["domains/domain-api-precheck"] = {"status": "verified-precheck", "cleanupVerified": True, "assertion": "Owned host served the exact downloaded verification file before successful precheck"} + if ledger.get("flow") == "multipart-upload" and ledger.get("status") == "verified-part-upload-and-compose": + steps = ledger.get("steps", []) + names = ("obbfile-init", "obbfile-uploadurl", "obbfile-upload") + selected = [next((s for s in steps if s.get("endpoint") == name and s.get("status") == "passed"), {}) for name in names] + receipts = ledger.get("partReceipts", {}) + source = ledger.get("sourceArtifact", {}) + valid_receipts = len(receipts) > 1 and all(r.get("httpStatus") == 200 and re.fullmatch(r"[a-f0-9]{32}", r.get("expectedMD5", "")) and r.get("etag", "").lower() == r["expectedMD5"] and re.fullmatch(r"[a-f0-9]{64}", r.get("sha256", "")) and type(r.get("bytes")) is int and r["bytes"] > 0 for r in receipts.values()) + valid_steps = all(selected) and all(s.get("httpStatus") == 200 and s.get("businessCode") == 0 for s in selected[:2]) and selected[2].get("partCount") == len(receipts) + ordered = valid_steps and all(steps.index(selected[i]) < steps.index(selected[i+1]) for i in range(2)) + if ordered and valid_receipts and sum(r["bytes"] for r in receipts.values()) == source.get("bytes") and re.fullmatch(r"[a-f0-9]{64}", source.get("sha256", "")) and ledger.get("owned", {}).get("objectId") and ledger.get("owned", {}).get("nspUploadId"): + for name, step in zip(names, selected): + features["upload/"+name] = {"status": "verified-part-upload", "operationAt": step.get("checkedAt"), "assertion": "Owned multipart session produced signed addresses and exact part ETags", "cleanupVerified": False, "retention": ledger.get("retention"), "limitations": ledger.get("limitations")} + # compose 未独立下载整文件,不计入原始闭环数。 + if ledger.get("flow") == "legacy-compile-readback" and ledger.get("status") == "verified-read" and ledger.get("exitCode") == 0 and ledger.get("businessCode") == 0 and 200 <= ledger.get("httpStatus", 0) < 300: + source = sources.get(ledger.get("sourcePackageEvidence"), {}) + package_id, expected = ledger.get("packageId"), ledger.get("expectedParseState") + states = ledger.get("packageStates", []) + independent = any(s.get("endpoint") == "package-compile-status-v3" and s.get("status") == "passed" and s.get("packageId") == package_id and s.get("parseState") == expected for s in source.get("steps", [])) + if source.get("appId") == ledger.get("appId") and source.get("owned", {}).get("pkgId") == package_id and package_id and type(expected) is int and expected in (0, 1, 2) and len(states) == 1 and states[0].get("pkgId") == package_id and type(states[0].get("successStatus")) is int and states[0]["successStatus"] == expected and independent: + features["publishing/query-aabfile"] = {"status": "verified-read", "operationAt": ledger.get("checkedAt"), "assertion": "Exact owned package status agrees with independent V3 readback", "statesVerified": [expected], "sourcePackageEvidence": ledger.get("sourcePackageEvidence"), "retention": "Dedicated package retained; this query performs no mutation"} + if ledger.get("flow") == "pms-group-create" and ledger.get("status") == "verified-retained" and ledger.get("owned", {}).get("groupId"): + steps = ledger.get("steps", []) + for index, step in enumerate(steps): + if step.get("endpoint") == "addproductgroup-harmonyosnext" and step.get("status") == "passed" and step.get("businessCode") == 0: + readbacks = [s for s in steps[index + 1:] if s.get("endpoint") == "getproductgroup-harmonyosnext" and s.get("status") == "passed" and s.get("assertion") == "dedicated empty subscription group read back"] + if readbacks: + features["pms/addproductgroup-harmonyosnext"] = {"status": "verified-retained", "operationAt": step.get("checkedAt"), "readbackAt": readbacks[0].get("checkedAt"), "assertion": readbacks[0]["assertion"], "cleanupVerified": False, "retention": ledger.get("retention")} + if ledger.get("flow") == "hvigor-cli-build" and ledger.get("status") == "verified-build" and ledger.get("exitCode") == 0 and ledger.get("assertion") == "CLI generated new HAP; independent ZIP, size and SHA256 readback match": + artifacts = ledger.get("artifacts", []) + if artifacts and all(a.get("path", "").endswith(".hap") and a.get("size", 0) > 0 and len(a.get("sha256", "")) == 64 for a in artifacts): + features["cicd/build-hvigor"] = {"status": "verified-build", "assertion": ledger["assertion"], "operationAt": ledger.get("checkedAt"), "artifacts": artifacts, "retention": "Dedicated local fixture and unsigned HAP retained for further package verification"} + if ledger.get("flow") == "signed-file-upload" and ledger.get("status") == "verified-upload": + steps = ledger.get("steps", []) + uploads = [s for s in steps if s.get("endpoint") == "upload-file-new" and s.get("status") == "passed" and s.get("assertion") == "server ETag matches uploaded fixture MD5" and 200 <= s.get("httpStatus", 0) < 300] + addresses = [s for s in steps if s.get("endpoint") == "upload-url-new" and s.get("status") == "passed" and s.get("businessCode") == 0] + if uploads and addresses and ledger.get("objectId") and ledger.get("sha256") and ledger.get("contentLength", 0) > 0 and uploads[0].get("etag"): + features["upload/upload-file-new"] = {"status": "verified-upload", "assertion": uploads[0]["assertion"], "operationAt": ledger.get("checkedAt"), "cleanupVerified": False, "retention": ledger.get("retention")} + for key, evidence in features.items(): + family, endpoint = key.split("/", 1) + if (family, endpoint) in original: + completed[(family, endpoint)] = {"family": family, "endpoint": endpoint, "file": filename, **evidence} + return {"checkedAt": datetime.datetime.now(datetime.timezone.utc).isoformat(), + "originalBlocked": len(original), "verifiedOriginalLifecycles": len(completed), + "remainingOriginal": len(original) - len(completed), + "completed": [completed[k] for k in sorted(completed)], + "scope": "Original 109 endpoint objective remains active. Newly registered helper APIs do not substitute for these endpoints."} + + +if __name__ == "__main__": + directory = ROOT / "docs/verification" + baseline = json.loads((directory / "goal-verification-baseline.json").read_text()) + records = [(str(p.relative_to(ROOT)), json.loads(p.read_text())) for p in sorted((directory / "lifecycles").glob("*.json"))] + report = collect(baseline, records) + (directory / "goal-progress.json").write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n") + print(f"verified {report['verifiedOriginalLifecycles']}/{report['originalBlocked']}; remaining {report['remainingOriginal']}") diff --git a/scripts/import-management-reference.py b/scripts/import-management-reference.py new file mode 100644 index 0000000..fec1134 --- /dev/null +++ b/scripts/import-management-reference.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 +"""Reproduce reviewed management contracts from public AGCLI source + CUA captures. + +Usage: python3 scripts/import-management-reference.py PACKAGE_DIR CAPTURE_JSON +No network, user sessions, package execution or contract inference. +""" +import copy +import hashlib +import json +import pathlib +import sys + +ROOT = pathlib.Path(__file__).resolve().parents[1] +PACKAGE = pathlib.Path(sys.argv[1]) +PAGES = json.loads(pathlib.Path(sys.argv[2]).read_text()) +SOURCE = 'https://www.npmjs.com/package/@hw-agconnect/agc-cli/v/1.12.0' +assert json.loads((PACKAGE/'package.json').read_text())['version'] == '1.12.0' + +def save(path, obj): + p=ROOT/path; p.parent.mkdir(parents=True,exist_ok=True) + p.write_text(json.dumps(obj,ensure_ascii=False,indent=2)+'\n') + +def p(name, where='body', typ='string', required=True, **kw): + return dict(name=name, **{'in':where}, type=typ, required=required, sourceUrl=SOURCE, **kw) + +def s(name, **kw): return p(name, **kw) +def obj(name, children, **kw): return p(name,typ='object',properties=children,**kw) +def arr(name, children=None, items='object', **kw): + return p(name,typ='array',itemsType=items,**({'itemsProperties':children} if children else {}),**kw) +def optional(name,where='query',typ='string',**kw):return p(name,where,typ,False,**kw) +def path(name, **kw):return p(name,'path',**kw) + +defs=[] +def add(family,id,method,url,params,files,auth='agcli-management-oauth',notes=None,pages=None): + evidence=[] + for name in files+['modules/request/edge.js']+(['modules/request/RequestService.js'] if auth=='agcli-management-cookie' else []): + raw=(PACKAGE/name).read_bytes() + evidence.append(dict(packagePath=name,sha256=hashlib.sha256(raw).hexdigest(),source=raw.decode())) + doc=dict(title=id,sourceUrl=SOURCE,checkedAt='2026-10-26',status='vendor-source-reviewed',package='@hw-agconnect/agc-cli',version='1.12.0',sourceFiles=evidence, + notes=notes or [], reviewedPages=[d for d in PAGES if any(x in d['sourceUrl'] for x in (pages or []))]) + save(pathlib.Path('pkg/domain/reference')/family/(id+'.json'),doc) + defs.append(dict(id=id,familyId=family,name=id,description='Reviewed native management transport; explicit user session required. '+ ' '.join(notes or []),method=method,path=url,command=f'agc {family} {id}',authentication=auth,direction='developer-to-huawei',status='registered',source='Huawei official AGCLI 1.12.0 source; not a public REST specification',sourceUrl=SOURCE,parameters=params,documentation=dict(title=id,sourceUrl=SOURCE,checkedAt='2026-10-26',status='vendor-source-reviewed',readCommand=f'agc {family} {id} --docs --pretty'))) + +cookie='agcli-management-cookie' +cache=['commands/cloudcache/util/constants.js','commands/cloudcache/util/Validation.js','commands/cloudcache/cmd/infoUsageStatistics.js'] +def cache_op(id,method,url,params,file,notes=None): + add('cache',id,method,url,params,cache+['commands/cloudcache/api/'+file],cookie,notes,pages=['cloudcache-']) +cache_op('execute-command','POST','/agc/edge/scs/scs-service/v1/eval',[s('command',maxLength=4096)],'execCommand.js') +cache_op('connection-info','GET','/agc/edge/scs/scs-service/v1/cache-invoke-address',[],'cacheInvokeAdress.js', ['projectId header comes from session.']) +cache_op('usage','POST','/agc/edge/spms/v1/query/metric/scs-metric',[p('views','query',enum=['query_cache_metric_trend']),p('startTime','query','integer',minimum=12960000,maximum=2158876800000),p('endTime','query','integer',minimum=12960000,maximum=2158876800000)],'getInfoOfUsageStatistics.js',['Epoch timestamps are milliseconds; interval at most three days, per source cmd/infoUsageStatistics.js.']) +cache_op('enable-service','POST','/agc/edge/cpms/project-service/v1/services/order',[p('projectId','query'),s('serviceName',enum=['cloudCache'])],'enableCache.js',['Does not configure a password or prove the service is ready.']) +for id,method,file in [('set-password','POST','setPassword.js'),('reset-password','PUT','changePassword.js')]: + cache_op(id,method,'/agc/edge/scs/scs-service/v1/cache-password',[s('password',minLength=8,maxLength=32)],file,['Password is write-only; resetting a used cache password can disrupt applications.']) + +name_pattern=r'^[A-Za-z](?:[A-Za-z0-9_]{0,28}[A-Za-z0-9])?$' +field=[s('fieldName',pattern=name_pattern,maxLength=30),s('fieldType',enum=['String','Boolean','Byte','Short','Integer','Long','Float','Double','ByteArray','Text','Date','IntAutoIncrement','LongAutoIncrement'])] +field += [optional(n,'body','boolean') for n in ['belongPrimaryKey','notNull','isNeedEncrypt','isSensitive']] +field += [p('defaultValue',required=False,typ='')] +index=[s('indexName',pattern=r'^[A-Za-z][A-Za-z0-9_]{0,29}$'),arr('indexList',[s('fieldName'),s('sortType',enum=['ASC','DESC'])],minItems=1,maxItems=5)] +permission=[s('role',enum=['World','Authenticated','Creator','Administrator']),arr('rights',items='string',itemsEnum=['Read','Upsert','Delete'],required=False)] +object_fields=[s('objectTypeName',pattern=name_pattern,maxLength=30),arr('fields',field,minItems=1),arr('indexes',index,required=False,maxItems=16),arr('permissions',permission,required=False)] +db=['commands/clouddb/util/constants.js','commands/clouddb/model/PermissionRole.js','commands/clouddb/model/PermissionRight.js','commands/clouddb/model/ObjectField.js','commands/clouddb/model/ObjectIndexField.js','commands/clouddb/cmd/createObject.js','commands/clouddb/cmd/modifyObject.js','commands/clouddb/cmd/createZone.js','commands/clouddb/cmd/deleteZone.js'] +def dbop(id,method,url,params,file,notes=None): + add('clouddb',id,method,'/agc/edge/clouddb/clouddbservice/v1/'+url,params,db+['commands/clouddb/api/'+file],cookie,notes,pages=['agcconsole-objecttypes','aboutclouddb']) +dbop('schema-versions','GET','schemaVersion',[],'getSchemeVersions.js') +dbop('get-object-type','GET','objectType',[p('schemaVersion','query','integer'),p('objectTypeName','query',pattern=name_pattern)],'getObjectTypeAPI.js') +dbop('create-object-type','POST','objectType',[obj('objectType',object_fields)],'createObjectTypes.js',['Creation is asynchronous; query process-status and independently read back schema before reporting completion.']) +dbop('update-object-type','PUT','objectType',[obj('objectType',object_fields),obj('originObjectType',copy.deepcopy(object_fields))],'modifyObjectTypes.js',['originObjectType must be the exact prior definition; this is not a patch or a migration of existing data.']) +dbop('delete-object-type','DELETE','objectType',[s('objectTypeName',pattern=name_pattern)],'deleteObjectType.js') +# Exported import format differs from the editor wrapper, including its permission map. +dbop('import-object-types','POST','importObjectType',[p('schemaVersion',typ='integer'),arr('objectTypes',[x for x in object_fields if x['name']!='permissions'],minItems=1),arr('permissions',[s('objectTypeName'),arr('permissions',permission)],required=False)],'importObjectTypes.js',['Raw JSON document, not a JSON string wrapper; only new object types may be imported; local size limit 20MB.']) +defs[-1]['requestContentType']='application/x-www-form-urlencoded' +dbop('export-object-types','POST','exportObjectType',[p('schemaVersion',typ='integer'),s('type',enum=['json','js','java','objective-c']),optional('jsFileType','body'),optional('javaFileType','body'),optional('packageName','body',maxLength=1024)],'exportObjectTypes.js',['Non-JSON formats return source-encoded Base64; no local extraction or execution.']) +for id,method,file in [('list-zones','GET','listDbZone.js'),('create-zone','POST','createDbZone.js'),('delete-zone','DELETE','deleteDbZone.js')]: + dbop(id,method,'naturalStore',[] if method=='GET' else [s('cloudDBZoneName',maxLength=20,pattern=r'^[A-Za-z][A-Za-z0-9]{0,19}$')],file) +dbop('process-status','POST','processPercentage',[s('processId')],'checkProcessPertentage.js') + +fn='/api/wisefunction/serverless/v1/' +fnname=path('functionName',pattern=r'^[a-z][a-z0-9-]{0,30}[a-z0-9]$') +aliasname=path('aliasName',pattern=r'^[a-z][a-z0-9-]{0,14}[a-z0-9]$') +pagination=[optional('pageSize',typ='integer',minimum=1,maximum=1000),optional('pageIndex',typ='integer',minimum=1)] +def fnop(id,method,url,params,file,notes=None,pages=None): + files=['commands/cloudfunction/api/'+file,'commands/cloudfunction/option/verify.js'] + if file=='triggerApi.js': files+=['commands/cloudfunction/boundary/triggerService.js','commands/cloudfunction/api/functionApi.js'] + if file=='layerApi.js': files+=['commands/cloudfunction/cmd/layer/createLayerVersionCmd.js'] + add('functions',id,method,fn+url,params,files,notes=notes,pages=pages or ['function-aliasname']) +weights=obj('routingConfig',[],additionalProperties=p('weight',typ='integer',minimum=0,maximum=100),propertyNamesPattern=r'^(\$latest|[1-9][0-9]{0,2}|1000)$',minProperties=1,maxProperties=2,description='One or two version weights totaling 100; explicit complete routing required by this CLI.') +aliasbody=[s('name',pattern=r'^[a-z][a-z0-9-]{0,14}[a-z0-9]$'),s('functionVersion'),optional('description','body',maxLength=64),weights] +for id,method in [('get-alias','GET'),('delete-alias','DELETE')]:fnop(id,method,'functions/{functionName}/aliases/{aliasName}',[fnname,aliasname],'aliasApi.js') +fnop('list-aliases','GET','functions/{functionName}/aliases',[fnname,optional('functionVersion')]+pagination,'aliasApi.js') +fnop('create-alias','POST','functions/{functionName}/aliases',[fnname]+aliasbody,'aliasApi.js',['Provide one or two explicit version weights totaling 100; no implicit selection of latest published version.']) +fnop('update-alias','PUT','functions/{functionName}/aliases/{aliasName}',[fnname,aliasname,s('functionVersion'),s('revisionId'),p('description',required=False,maxLength=64),weights],'aliasApi.js',['Read get-alias first and provide revisionId plus the full intended routing configuration.']) +triggerfile='triggerApi.js' +httpbody=[s('funcId'),s('mode',enum=['NO_PATH']),p('authFlag',typ='boolean'),s('authAlgor',enum=['HDA-SYSTEM']),s('authType',enum=['apigw-client','cloudgw-client','internal-auth']),p('enableUrlDecode',typ='boolean')] +cronbody=[s('funcId'),s('triggerType',enum=['Cron']),s('triggerMode',enum=['Sync','ASync']),p('triggerSwitch',typ='boolean'),obj('spec',[s('schedule'),p('payload',typ='',required=False)])] +fnop('create-http-trigger','POST','trigger',httpbody,triggerfile,['funcId is obtained from query-function-version and must include the intended qualifier; create policy separately if required.'],['httptrigger']) +fnop('create-cron-trigger','POST','triggers',cronbody,triggerfile,['Default AGCLI create switch is false; an explicit triggerSwitch is required. Current guide says switch cannot be changed later, unlike AGCLI update; cloud support is unverified.'],['crontrigger']) +for kind,route in [('http-trigger','trigger'),('trigger','triggers')]: + for verb,method in [('get','GET'),('delete','DELETE')]:fnop(verb+'-'+kind,method,route+'/{triggerId}',[path('triggerId')],triggerfile,pages=['trigger-']) + fnop('list-'+('http-triggers' if kind=='http-trigger' else 'triggers'),'GET',route+'/list/{funcId}',[path('funcId')]+pagination,triggerfile,['Listing path is also reviewed in boundary/triggerService.js.'],['trigger-']) + defs[-1]['description']+=' Endpoint list uses exact funcId, no automatic qualifier discovery.' +fnop('update-cron-trigger','PUT','triggers/{triggerId}',[path('triggerId')]+[x for x in cronbody if x['name']!='triggerType']+[s('revisionId')],triggerfile,['Read get-trigger first; preserve funcId, spec, triggerMode and revisionId.'],['crontrigger']) +fnop('get-function-policy','GET','functions/{functionName}/policy',[fnname,p('qualifier','query')],triggerfile,pages=['trigger-']) +fnop('create-function-policy','POST','functions/{functionName}/policy',[fnname,p('qualifier','query'),s('effect',enum=['Allow']),s('action',enum=['InvokeFunction']),s('sourceProvider'),s('sourceId'),s('revisionId',required=False)],triggerfile,['Read policy first; no automatic grants or silent retries.'],['trigger-']) +layer=path('layerName',pattern=r'^[a-z][a-z0-9-]{0,30}[a-z0-9]$') +fnop('list-layers','GET','layers',[optional('layerName'),optional('ownerFlag',enum=['all','self','other']),optional('compatibleRuntime')]+pagination,'layerApi.js',pages=['function-layer']) +fnop('list-layer-versions','GET','layers/{layerName}/versions',[layer,optional('compatibleRuntime')]+pagination,'layerApi.js',pages=['function-layer']) +fnop('get-layer-version','GET','layers/{layerName}/versions/{layerVersion}',[layer,path('layerVersion',pattern=r'^[1-9][0-9]*$')],'layerApi.js',pages=['function-layer']) +fnop('create-layer-version','POST','layers/{layerName}/versions',[layer,arr('compatibleRuntimes',items='string',minItems=1,itemsEnum=['nodejs14.x','java1.8','python3','custom-runtime']),p('sharedScope',typ='integer',enum=['0','1']),s('zipFile',format='byte'),optional('description','body',maxLength=1024),optional('licenseInfo','body',maxLength=64)],'layerApi.js',['zipFile contains Base64 ZIP bytes; validate compressed/decompressed limits and entry count before authorization. Layer name creates the initial version or appends a version. AGCLI 1.12.0 local ZIP validation caps files below 50MiB; this direct API adapter uses the current browser-reviewed guide limits of 150MiB compressed, 300MiB expanded and 30000 entries. This difference and modern runtime wire values still require cloud verification.'],['function-layer']) + +# SAM applications are distinct from gallery templates. These are the exact +# deployment primitives provided by the vendor; codeUri must already be uploaded. +sam_files=['commands/serverlessModel/api/admApi.js','commands/serverlessModel/validator/templateJSON.js','commands/serverlessModel/validator/cloudFunctionValidator.js','commands/serverlessModel/validator/httpTriggerValidator.js','commands/serverlessModel/validator/cronTriggerValidator.js'] +prop=[s('codeUri'),s('runtime'),p('memorySize',typ='integer',enum=['500','1000','2000','4000']),p('timeout',typ='integer',minimum=1,maximum=1800),s('handler',maxLength=64,pattern=r'^[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*$'),p('instanceConcurrency',typ='integer',minimum=1,maximum=1000),optional('description','body',maxLength=64,description='Vendor display width <=64; non-ASCII UTF-16 units count twice.'),arr('layers',items='string',required=False,maxItems=5),arr('env',[s('name',maxLength=64,pattern=r'^[-._a-zA-Z][-._a-zA-Z0-9]*$'),s('value',maxLength=2048)],required=False)] +event_fields=[s('name',pattern=r'^[a-z][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$'),s('type',enum=['http','cron']),obj('properties',[optional('authType','body',enum=['apigw-client','cloudgw-client']),optional('enableUrlDecode','body','boolean'),optional('schedule','body'),p('input',required=False,encodedJson=p('value',typ='',required=False))])] +event_rules=[] +for kind,fields in [('http',['authType','enableUrlDecode']),('cron',['schedule','input'])]: + for field in fields: + event_rules.append(dict(id='sam-'+kind+'-'+field,kind='required_if',field='body.properties.'+field,when=dict(field='body.type',equals=kind),sourceUrl=SOURCE,message='SAM '+kind+' events require properties.'+field,suggestion='Supply the conditional event property using the source-defined type.')) +prop += [optional('alias','body',pattern=r'^[a-z][a-z0-9-]{0,14}[a-z0-9]$'),arr('events',event_fields,required=False,itemsRules=event_rules)] +component=[s('name',pattern=r'^[a-z][a-z0-9-]{0,30}[a-z0-9]$'),s('type',enum=['Huawei::AGC::CloudFunctions']),obj('properties',prop)] +sam_body=[s('name'),arr('components',component,minItems=1)] +sam_notes=['SAM CloudFunctions application transport, not deployment of the console gallery templates. codeUri is a pre-uploaded bucket/object key. Creation/application acceptance does not prove ready state; search/get-plan must be read back.'] +for id,method,url,params in [ + ('search-applications','GET','/api/adm/v1/applications/search',[p('appName','query')]), + ('create-application','POST','/api/adm/v1/applications',sam_body), + ('create-plan','POST','/api/adm/v1/applications/{applicationId}/plans',[path('applicationId')]+sam_body), + ('get-plan','GET','/api/adm/v1/applications/plans/{planId}',[path('planId')]), + ('apply-plan','PUT','/api/adm/v1/applications/{applicationId}/plans/{planId}',[path('applicationId'),path('planId')])]: + add('templates',id,method,url,params,sam_files,notes=sam_notes,pages=['serverless-']) +add('templates','deploy','POST','native:templates/deploy',copy.deepcopy(sam_body)+[s('storageInstance'),optional('waitForReady','body','boolean')],sam_files+['commands/serverlessModel/api/cloudStorageApi.js','commands/serverlessModel/cmd/deploy/create.js','commands/serverlessModel/cmd/deploy/cmd.js','commands/serverlessModel/cmd/deploy/output.js'],notes=['Create-only SAM deployment: validate every local codeUri ZIP, search exact application name, upload code, create application, then independently query readiness. Existing applications are refused; use explicit create-plan/get-plan/apply-plan for updates. Local-only storageInstance and waitForReady are not sent to ADM. Uploaded artifacts may be retained after failure. Not a console gallery deployment.'],pages=['serverless-']) +defs[-1]['direction']='native-workflow' + +for id,extra in [('fetch-install',[]),('fetch-periodic',[optional('token',maxLength=2048),optional('params',maxLength=1024)]),('fetch-deferred',[optional('link')])]: + doc=next(d for d in PAGES if d['sourceUrl'].endswith('cloudfoundation-prefetch-cloud-interdev')) + save(pathlib.Path('pkg/domain/reference/prefetch')/(id+'.json'),dict(doc,relatedDocuments=[d for d in PAGES if ('cloudfoundation-prefetch' in d['sourceUrl'] or 'cloudfoundation-commandtool' in d['sourceUrl']) and d['sourceUrl']!=doc['sourceUrl']],implementationNotes=['Developer-server GET simulation; does not configure Huawei prefetch or prove device delivery. Never loads developer credentials. Installation response limit follows the overview quota of 2MiB; periodic and deferred responses are limited to 3MiB. The configuration guide gives a generic 3MB server-response limit; that does not override the smaller installation quota.'])) + defs.append(dict(id=id,familyId='prefetch',name=id,method='GET',path='{callbackUrl}',command='agc prefetch '+id,authentication='callback-none',direction='inbound-callback',status='registered',source='Huawei browser-reviewed developer server protocol',sourceUrl=doc['sourceUrl'],parameters=[path('callbackUrl'),p('appId','query')]+extra,documentation=dict(title=doc['title'],sourceUrl=doc['sourceUrl'],checkedAt='2026-10-26',status='browser-read',readCommand='agc prefetch '+id+' --docs --pretty'))) + +device_doc=next(d for d in PAGES if d['sourceUrl'].endswith('cloudfoundation-commandtool-debug')) +save('pkg/domain/reference/prefetch/device-getcache.json',dict(device_doc,relatedDocuments=[d for d in PAGES if d['sourceUrl'].endswith('cloudfoundation-commandtool-errorcode')],implementationNotes=['Runs hdc -t DEVICE shell cf_prefetch getcache -m BUNDLE with separate argv. A successful process is not proof of a new fetch data timestamp. Debug HAP, supported ROM and an explicitly connected test device are prerequisites.'])) +defs.append(dict(id='device-getcache',familyId='prefetch',name='Debug periodic prefetch on an explicit device',method='POST',path='local:prefetch/device-getcache',command='agc prefetch device-getcache',authentication='local-device',direction='local',status='registered',source='Huawei browser-reviewed hdc command',sourceUrl=device_doc['sourceUrl'],parameters=[s('bundleName',pattern=r'^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)+$'),s('deviceId',pattern=r'^[A-Za-z0-9._:-]+$'),optional('hdcPath','body')],documentation=dict(title=device_doc['title'],sourceUrl=device_doc['sourceUrl'],checkedAt='2026-10-26',status='browser-read',readCommand='agc prefetch device-getcache --docs --pretty'))) +for endpoint in defs: + endpoint['officialSlug']=('agcli-1.12.0-'+endpoint['id']) if endpoint['authentication'].startswith('agcli-management-') else endpoint['sourceUrl'].rsplit('/',1)[-1] + if endpoint['familyId']=='prefetch': + for parameter in endpoint['parameters']: parameter['sourceUrl']=endpoint['sourceUrl'] +save('pkg/domain/reference/management/endpoints.json',defs) +save('pkg/domain/reference/management/browser-review.json',PAGES) +print(f'Imported {len(defs)} source-reviewed operations and {len(PAGES)} rendered pages') diff --git a/scripts/import-serverless-reference.py b/scripts/import-serverless-reference.py new file mode 100644 index 0000000..3a039b4 --- /dev/null +++ b/scripts/import-serverless-reference.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python3 +"""Import Computer Use captures from browser-capture-reference.mjs's schema. + +No network, credentials or hidden browser state. Re-run with the JSON array saved +from the browser's rendered documents. Semantic overrides below are source-reviewed; +this is not a general-purpose inference of Huawei API contracts. +""" +import copy,json,re,sys +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1] +D=json.loads(Path(sys.argv[1]).read_text()) +IDS={ + 'agcapi-cloudhost-newapp':'hosting/create-version','agcapi-cloudhost-modifyversion':'hosting/modify-files','agcapi-cloudhost-uploadurl':'hosting/upload-url','agcapi-cloudhost-uploadversion':'hosting/upload-version','agcapi-cloudhost-archivedversion':'hosting/archive-version','agcapi-cloudhost-releaseversion':'hosting/release-version','agcapi-cloudhost-queryversion':'hosting/list-versions','agcapi-cloudhost-queryfile':'hosting/list-version-files','agcapi-cloudhost-deleteversion':'hosting/delete-version','agcapi-cloudhost-createnvir':'hosting/create-environment','agcapi-cloudhost-queryenvir':'hosting/list-environments','agcapi-cloudhost-deletenvir':'hosting/delete-environment','agcapi-cloudhost-createsite':'hosting/create-site','agcapi-cloudhost-querysite':'hosting/list-sites','agcapi-cloudhost-refreshsite':'hosting/update-site','agcapi-cloudhost-deletesite':'hosting/delete-site', + 'server-rest-import':'cloud-auth/import-users','server-rest-export':'cloud-auth/export-users','server-rest-verify':'cloud-auth/verify-token','server-rest-revoke':'cloud-auth/revoke-token', + 'client-rest-auth-obtaintoken':'cloud-auth/client-token','client-rest-auth-verifycode':'cloud-auth/request-code','client-rest-auth-register':'cloud-auth/register','client-rest-auth-signin':'cloud-auth/sign-in-password','client-rest-auth-usersigini':'cloud-auth/sign-in-code','client-rest-auth-modify-phone-email':'cloud-auth/update-account','client-rest-auth-resetpwd':'cloud-auth/reset-password','client-rest-auth-modifypwd':'cloud-auth/update-password','client-rest-auth-userlink':'cloud-auth/link-user','client-rest-auth-unlink':'cloud-auth/unlink-user','client-rest-auth-signout':'cloud-auth/sign-out','client-rest-auth-userdelete':'cloud-auth/delete-user','client-rest-auth-reauthenticate':'cloud-auth/reauthenticate', + 'clouddb-obtaintoken-rest':'clouddb/client-token','clouddb-signin-rest':'clouddb/sign-in','clouddb-query-data-rest':'clouddb/query-data','clouddb-update-data-rest':'clouddb/update-data','clouddb-delete-data-rest':'clouddb/delete-data', + 'storage-restapi-uploadfile':'storage/upload-file','storage-restapi-getfile':'storage/download-file','storage-restapi-deletefile':'storage/delete-file','storage-restapi-getmetadata':'storage/get-metadata','storage-restapi-changemetadata':'storage/update-metadata','storage-restapi-listfile':'storage/list-files', + 'agc-serverless-comm-api-obtainuserid':'templates/user-id','agc-serverless-get-id':'templates/player-id'} +def save(path,obj): + p=ROOT/path;p.parent.mkdir(parents=True,exist_ok=True);p.write_text(json.dumps(obj,ensure_ascii=False,indent=2)+'\n') +def param(row,loc,src): + name=row[0]; req,typ=(row[1],row[2]) if row[1] in ('M','O') else (row[2],row[1]);desc=row[3]; low=typ.lower() + p=dict(name=name,in_=loc,type='string',required=req=='M',description=desc,sourceUrl=src) + p['in']=p.pop('in_') + model=None + if low.startswith(('list<','array<')): + child=re.search(r'<([^>]+)>',typ)[1]; p['type']='array';p['itemsType']='string' if child.lower().startswith('string') else 'object' + if p['itemsType']=='object':model=child + m=re.search(r'>\((\d+)\)',typ) + if m:p['maxItems']=int(m[1]) + elif low in ('integer','int','long','short','byte','int32','int64'):p['type']='integer' + elif low in ('double','float'):p['type']='number' + elif low=='boolean':p['type']='boolean' + elif low=='bytearray':p['type']='' # Wire shape is not illustrated; do not guess base64 vs numeric array. + elif low=='json':p['type']='object' # opStore's explicit request example is an object; recorded below. + elif not low.startswith('string'): + p['type']='object';model=typ + m=re.fullmatch(r'String\((\d+)\)',typ,re.I) + if m:p['maxLength']=int(m[1]) + return p,model +manifest=[] +for doc in D: + slug=doc['sourceUrl'].rsplit('/',1)[1];key=re.sub(r'-\d+$','',slug);target=IDS.get(key) + if not target: + save(Path('pkg/domain/reference/supplemental')/('serverless-'+slug+'.json'),doc);continue + family,id=target.split('/');doc['captureTool']='Computer Use; scripts/browser-capture-reference.mjs-compatible merged-cell capture' + req=[t for t in doc['tables'] if t['section']=='请求参数'];heads=[t for t in req if t['location']=='header'];body=[t for t in req if t['location'] in ('body','')];others=[t for t in req if t['location'] in ('query','path')] + ps=[] + for t in heads+others: + for row in t['rows'][1:]: + p,_=param(row,t['location'],t['sourceUrl']) + # Credential headers are generated/checked by the authorization layer, not + # unconditional input fields before it has had a chance to resolve a profile. + if p['name'].lower() in ('authorization','client_id'):p['required']=False + if not any(v['name']==p['name'] and v['in']==p['in'] for v in ps):ps.append(p) + if body: + pending=[] + for row in body[0]['rows'][1:]: + p,m=param(row,'body',body[0]['sourceUrl']);ps.append(p) + if m:pending.append((p,m)) + # These endpoint pages inline their request models in pre-order. Never read + # response tables to infer request requiredness. + idx=1 + def attach(p,m): + global idx + if idx>=len(body):return + table=body[idx];idx+=1;children=[];nexts=[] + for row in table['rows'][1:]: + c,cm=param(row,'body',table['sourceUrl']);children.append(c) + if cm:nexts.append((c,cm)) + p['itemsProperties' if p['type']=='array' else 'properties']=children + for c,cm in nexts:attach(c,cm) + for p,m in pending: + # delete-data omits MsgInfo's inline table; retain the reviewed query/update model. + if family=='clouddb' and id=='delete-data' and m=='MsgInfo':continue + attach(p,m) + proto=dict(doc['tables'][0]['rows']) + url=proto['接口URL'].split()[0];method=proto['承载协议'].split()[-1];direction='developer-to-huawei';base='https://connect-api.cloud.huawei.com';auth='server-api-client';ctype='application/json' + if url.startswith('https://connect-drcn.'): + base='https://connect-drcn.dbankcloud.cn';path=url.removeprefix(base);auth='client-api-token' + elif family=='storage': + base='https://ops-server-drcn.agcstorage.link/v0';path=url.removeprefix('https://{domain}');ctype='';auth='server-api-client' + elif family=='templates':path='{callbackUrl}';base='';direction='inbound-callback';auth='callback-body';ps.insert(0,dict(name='callbackUrl',**{'in':'path'},type='string',required=True,description='Developer HTTPS authentication callback URL',sourceUrl=doc['sourceUrl'])) + elif id=='upload-version':path='{uploadUrl}';base='';auth='signed-upload';ctype='';ps=[p for p in ps if p['in']!='body'];ps+= [dict(name='uploadUrl',**{'in':'path'},type='string',required=True,sourceUrl=doc['sourceUrl']),dict(name='file',**{'in':'file'},type='string',required=True,sourceUrl=doc['sourceUrl'])] + else:path=url.removeprefix('https://{domain}') + if family=='cloud-auth' and id in ('verify-token','revoke-token'):path=path.split('?')[0] + if family=='hosting' and id=='upload-version': + for p in ps: + if p['name']=='Authorization':p['required']=True + if family=='cloud-auth' and key.startswith('server-rest-'):auth='service-account-or-api-client' + if id=='client-token':auth='body-client-credentials' + if family=='storage': + for n in re.findall(r'{([^}]+)}',path):ps.insert(0,dict(name=n,**{'in':'path'},type='string',required=True,description='Storage instance or object path; percent-encoded exactly once.',sourceUrl=doc['sourceUrl'])) + if id=='upload-file':ps.append(dict(name='file',**{'in':'file'},type='string',required=True,sourceUrl=doc['sourceUrl'])) + # Source conflicts are visible in discovery/docs; do not silently infer new rules. + conflicts=[] + if family=='clouddb' and id in ('query-data','update-data','delete-data'): + conflicts.append('opStore is labelled Json/JSON字符串 in the table, but request examples use an object. The adapter uses the explicit example object; queryCond remains an encoded JSON string. SchemaField.t descriptions enumerate numeric codes while write examples use TYPE_* strings. Delete Schema.fs says one item but its example contains three; no conflicting one-item cap is imposed. FieldValue.ba is labelled byteArray without a wire example; preserve caller JSON rather than guessing base64 or array.') + if family=='cloud-auth' and id=='export-users':conflicts.append('block is labelled String but examples use integer; users and ret response tables say JSON strings while examples use array/object. Both wire shapes are preserved; no conversion is assumed.') + if family=='storage' and id=='update-metadata':doc['implementationNotes']=['GET with metadata=update matches the prototype and Java HttpGet example; the short request example omits the metadata query.'] + if conflicts:doc['unresolvedRules']=conflicts + def walk(params): + for p in params: + n=p['name'] + if n=='service':p['enum']=['hosting'] + if n=='contentType' and family=='hosting':p['enum']=['902'] + if n=='environment' and family=='hosting':p['enum']=['0','1'] + if n=='cleanSuffix':p['enum']=['0','1'] + if n=='querySize':p['maximum']=1000 + if n=='sendInterval':p['minimum']=30;p['maximum']=120 + if n=='action':p['enum']=['1001','1002'] + if n=='os' and family=='clouddb':p['maxItems']=1 + if n=='t' and '操作类型' in p.get('description',''):p['enum']=['1'] + if n=='deleteFiles':p['maxItems']=1000 + if n=='fileSize' and family=='hosting':p['minimum']=0;p['maximum']=10*1024**3 + if n=='fileSha256' and family=='hosting':p['pattern']='^[a-fA-F0-9]{64}$' + if n=='lang' and family=='cloud-auth' and id=='request-code': + lang_path=ROOT/'pkg/domain/reference/supplemental/serverless-agc-auth-verifycode-langtype-0000002563105507.json' + if lang_path.exists():p['enum']=[row[0] for row in json.loads(lang_path.read_text())['tables'][0]['rows'][1:]] + if n=='_v':p['enum']=['4'] + if n=='queryType':p['enum']=[str(i) for i in range(6)] + if n=='provider' and family in ('cloud-auth','clouddb') and p['type']=='integer':p['enum']=[str(i) for i in range(14)] + if n in ('autoCreateUser','useJwt'):p['enum']=['0','1'] + if n=='grant_type':p['enum']=['client_credentials'] + if n=='queryCond':p['encodedJson']={'type':'object','properties':[{'name':'queryConditions','in':'body','type':'array','required':True,'itemsType':'object','itemsProperties':[{'name':'conditionType','in':'body','type':'string','required':True},{'name':'fieldName','in':'body','type':'string'},{'name':'value','in':'body'}]}]} + walk(p.get('properties',[]));walk(p.get('itemsProperties',[])) + walk(ps) + if family=='clouddb' and id=='delete-data': + for p in ps: + if p['name']=='msgInfo':p['properties']=[dict(name='type',**{'in':'body'},type='integer',required=True,enum=['3'],sourceUrl=doc['sourceUrl']),dict(name='opStore',**{'in':'body'},type='object',required=True,properties=[dict(name='storeName',**{'in':'body'},type='string',required=True)],sourceUrl=doc['sourceUrl'])] + if family=='clouddb' and id in ('query-data','update-data'): + for p in ps: + if p['name']=='msgInfo': + for c in p.get('properties',[]): + if c['name']=='type':c['enum']=['5' if id=='query-data' else '3'] + if c['name']=='opStore':c['properties']=[dict(name='storeName',**{'in':'body'},type='string',required=True)] + if family=='cloud-auth' and id=='export-users': + for p in ps: + if p['name']=='block':p['type']='';p['description']+=' Documented String/example integer conflict; accepted without coercion.' + rules=[] + if family=='cloud-auth' and id in ('register','request-code'): + rules.append(dict(id='account_identity',kind='at_least_one',fields=['body.phone','body.email'],sourceUrl=doc['sourceUrl'],message='Supply a phone or email identity.',suggestion='Provide phone with country code, or email.')) + if family=='cloud-auth' and id=='register': + rules.append(dict(id='phone_verify_code',kind='required_with',field='body.verifyCode',fields=['body.phone'],sourceUrl=doc['sourceUrl'],message='Phone registration requires verifyCode.',suggestion='Obtain a test verification code before registering.')) + if family=='cloud-auth' and id=='update-account': + rules.append(dict(id='new_identity',kind='at_least_one',fields=['body.newPhone','body.newEmail'],sourceUrl=doc['sourceUrl'],message='Supply a new phone or email.',suggestion='Specify newPhone or newEmail and its verification code.')) + save(Path('pkg/domain/reference')/family/(id+'.rules.json'),rules) + save(Path('pkg/domain/reference')/family/(id+'.json'),doc) + save(Path('pkg/domain/reference')/family/(id+'.parameters.json'),ps) + desc=next((n['text'] for n in doc['notes'] if n['section']=='功能介绍'),doc['title']) + manifest.append(dict(id=id,familyId=family,name=doc['title'],description=desc,method=method,path=path,command='agc '+family+' '+id,status='registered',source='Huawei AppGallery Connect API reference',sourceUrl=doc['sourceUrl'],officialSlug=slug,direction=direction,defaultBaseUrl=base,authentication=auth,requestContentType=ctype,parameters=ps)) +save('pkg/domain/reference/serverless/endpoints.json',manifest) +print('Imported',len(D),'documents;',len(manifest),'operations') diff --git a/scripts/live-lifecycle.py b/scripts/live-lifecycle.py index b5b512c..424487b 100644 --- a/scripts/live-lifecycle.py +++ b/scripts/live-lifecycle.py @@ -4,6 +4,7 @@ 每一步写入证据,异常后也保留创建的资源 ID 和清理结果。 """ import argparse +import importlib.util import concurrent.futures import datetime import json @@ -16,6 +17,12 @@ import urllib.request import urllib.parse +_certificate_spec = importlib.util.spec_from_file_location("certificate_fingerprint", pathlib.Path(__file__).with_name("certificate-fingerprint.py")) +_certificate_module = importlib.util.module_from_spec(_certificate_spec) +_certificate_spec.loader.exec_module(_certificate_module) +certificate_fingerprint_for_csr = _certificate_module.certificate_fingerprint_for_csr + + ROOT = pathlib.Path(__file__).resolve().parents[1] @@ -35,10 +42,16 @@ def group_matches(groups, group_id, expected_name): def safe_evidence(body): """邀请码、账号信息、下载签名及完整响应均不写入报告。""" result = {} - if isinstance(body.get("ret"), dict): - result["businessCode"] = body["ret"].get("code") + ret = body.get("ret") + if isinstance(ret, str): + try: ret = json.loads(ret) + except ValueError: ret = None + if isinstance(ret, dict): + result["businessCode"] = ret.get("code") else: result["businessCode"] = body.get("rtnCode", body.get("code")) + if result["businessCode"] is None and isinstance(body.get("error"), dict): + result["businessCode"] = body["error"].get("errorCode") if body.get("businessCode") is not None and str(body["businessCode"]) != "0": result["businessCode"] = body["businessCode"] for key in ("appId", "groupId", "versionId", "invitationCodeId"): @@ -63,6 +76,7 @@ def verified_features(ledger): "testing/test-api-delete-invite-code": "deleted code absent", "testing/test-api-add-test-version": "created invitation-test draft visible", "testing/test-api-delete-test-version": "temporary draft absent after deletion", + "testing/test-api-modify-test-version": "owned test draft language update read back", "provisioning/provision-api-apply-cent": "dedicated debug certificate exists", "provisioning/provision-api-add-fingerprints": "new certificate fingerprint read back", "provisioning/provision-api-apply-provision": "new Profile exists under dedicated app", @@ -70,9 +84,17 @@ def verified_features(ledger): "provisioning/provision-api-delete-provision": "dedicated Profile absent after cleanup", "provisioning/provision-api-delete-fingerprints": "only new fingerprint removed", "provisioning/provision-api-delete-cent": "only new certificate removed", + "publishing/language-info-update": "dedicated language description changed", + "publishing/language-info-delete": "temporary language absent after deletion", + "domains/domain-api-post-domain": "dedicated server domain read back", + "pms/updateproductgroup-harmonyosnext": "dedicated subscription group renamed and empty", } features = {} steps = ledger.get("steps", []) + # 查询接口同样需要真实内容断言,不能只凭空列表和业务码记为通过。 + for step in steps: + if step.get("endpoint") == "test-api-get-invite-code" and step.get("status") == "passed" and step.get("assertion") == "new code is active; secret omitted": + features["testing/test-api-get-invite-code"] = {"status": "verified-lifecycle", "operationAt": step.get("checkedAt"), "readbackAt": step.get("checkedAt"), "assertion": step["assertion"], "cleanupVerified": True} for index, step in enumerate(steps): key = step["family"] + "/" + step["endpoint"] if step["status"] != "passed" or key not in readbacks: @@ -98,12 +120,13 @@ def save(self): temporary.write_text(json.dumps(self.ledger, ensure_ascii=False, indent=2) + "\n") temporary.replace(self.output) - def call(self, family, endpoint, *, headers=None, query=None, body=None, assert_fn=None, assertion=None): - cmd = [str(self.args.binary), "--profile", self.args.profile, family, endpoint, "--invoke", "--dry-run=false"] + def call(self, family, endpoint, *, headers=None, query=None, body=None, assert_fn=None, assertion=None, profile=None): + selected_profile = profile or self.args.profile + cmd = [str(self.args.binary), "--profile", selected_profile, family, endpoint, "--invoke", "--dry-run=false"] for values, flag in ((headers or {}, "--header"), (query or {}, "--query")): for key, value in values.items(): cmd += [flag, str(key) + "=" + str(value)] - step = {"family": family, "endpoint": endpoint, "checkedAt": datetime.datetime.now(datetime.timezone.utc).isoformat(), "assertion": assertion, "status": "running"} + step = {"family": family, "endpoint": endpoint, "profile": selected_profile, "checkedAt": datetime.datetime.now(datetime.timezone.utc).isoformat(), "assertion": assertion, "status": "running"} self.ledger["steps"].append(step) self.save() try: @@ -115,7 +138,23 @@ def call(self, family, endpoint, *, headers=None, query=None, body=None, assert_ proc = subprocess.run(cmd, cwd=ROOT, capture_output=True, text=True, timeout=65) step["exitCode"] = proc.returncode if proc.returncode: - match = re.search(r"agc endpoint returned HTTP (\d{3})(?: \(([^)]+)\))?", proc.stderr) + # 只记录已知结果码字段,不保留错误响应中的账号、邀请码或签名。 + error_message = "" + try: + detail = json.loads(proc.stdout).get("error", {}) + if isinstance(detail.get("message"), str): + error_message = detail["message"] + paths = {"ret.code", "rtnCode", "businessCode", "error.errorCode", "code", "errorDetail.code"} + if detail.get("codeField") in paths: + step["codeField"] = detail["codeField"] + codes = detail.get("resultCodes", {}) + if isinstance(codes, dict): + safe_codes = {k: v for k, v in codes.items() if k in paths and isinstance(v, str) and re.fullmatch(r"[A-Za-z0-9_.-]{1,80}", v)} + if safe_codes: step["resultCodes"] = safe_codes + except (ValueError, AttributeError, TypeError): + pass + # JSON 模式会静默 stderr;只从消息提取状态和安全结果码,不保存原消息。 + match = re.search(r"agc endpoint returned HTTP (\d{3})(?: \(([^)]+)\))?", error_message or proc.stderr) step["status"] = "cli-error" if match: step["httpStatus"] = int(match[1]) @@ -215,6 +254,14 @@ def version_flow(args, run_id): version_id = response["versionId"] flow.own("versionId", version_id) flow.call("publishing", "app-version-list", headers=h, body={}, assert_fn=lambda b: any(v.get("versionId") == version_id and v.get("testType") == 3 for v in b.get("versionList", [])), assertion="created invitation-test draft visible") + if args.flows == "draft-update": + fixture = json.loads((ROOT / "docs/verification/dedicated-test-app.json").read_text()) + if not is_dedicated_app(args.app_id, fixture): + raise RuntimeError("Draft metadata update requires dedicated application") + flow.guard("versionId", version_id) + marker = "AGC CLI draft verification " + run_id[-8:] + flow.call("testing", "test-api-modify-test-version", query=app_query, body={"versionId": version_id, "languages": [{"language": "zh-CN", "appName": fixture["appName"], "appDesc": marker, "briefInfo": "专用接口测试草稿"}]}) + flow.call("publishing", "app-info-query-v3", query={**app_query, "releaseType": 6, "versionId": version_id}, assert_fn=lambda b: any(l.get("appDesc") == marker for l in b.get("languages", [])), assertion="owned test draft language update read back") except Exception as error: flow.ledger["failure"] = str(error) finally: @@ -270,16 +317,10 @@ def provisioning_flow(args, run_id): raise RuntimeError("certificate download failed") cert_file = path / "certificate.cer" cert_file.write_bytes(cert) - parsed = subprocess.run(["openssl", "x509", "-inform", "DER", "-in", str(cert_file), "-noout", "-fingerprint", "-sha256"], capture_output=True, text=True, timeout=20) - if parsed.returncode: - parsed = subprocess.run(["openssl", "x509", "-in", str(cert_file), "-noout", "-fingerprint", "-sha256"], capture_output=True, text=True, timeout=20) - match = re.search(r"=([0-9A-Fa-f:]+)", parsed.stdout) - if parsed.returncode or not match: - raise RuntimeError("downloaded certificate is not valid X.509") - fingerprint = match[1].replace(":", "").upper() + fingerprint = certificate_fingerprint_for_csr(cert_file, csr_file) if fingerprint in json.dumps(initial_fingerprints): raise RuntimeError("generated certificate fingerprint unexpectedly already exists") - flow.ledger["certificateDownload"] = {"bytes": len(cert), "sha256": hashlib.sha256(cert).hexdigest(), "parsedX509": True} + flow.ledger["certificateDownload"] = {"bytes": len(cert), "sha256": hashlib.sha256(cert).hexdigest(), "parsedX509": True, "signerCertificateMatchesCSR": True} flow.own("fingerprint", fingerprint) flow.call("provisioning", "provision-api-add-fingerprints", headers=h, body={"fingerprintList": [fingerprint]}) fingerprint_added = True @@ -323,17 +364,126 @@ def provisioning_flow(args, run_id): return flow.finish() +def language_flow(args, run_id): + """只新增并修改专用应用中原先不存在的语言,最后读回确认已删除。""" + flow = Flow(args, "language-metadata", run_id) + fixture_file = ROOT / "docs/verification/dedicated-test-app.json" + fixture = json.loads(fixture_file.read_text()) if fixture_file.exists() else {} + if not is_dedicated_app(args.app_id, fixture): + flow.ledger.update(status="blocked", failure="Language mutations require the dedicated test application") + flow.save() + return flow.ledger + query = {"appId": args.app_id} + lang = "en-US" + created = False + marker = "AGC CLI API Verification " + run_id[-8:] + try: + original = flow.call("publishing", "app-info-query-v3", query=query) + if original.get("appInfo", {}).get("defaultLang") == lang or any(l.get("lang") == lang for l in original.get("languages", [])): + raise RuntimeError("Target language exists already; refuse to overwrite it") + flow.call("publishing", "language-info-update", query=query, body={"lang": lang, "appName": marker, "appDesc": "Dedicated unpublished API validation fixture."}) + created = True + flow.own("language", lang) + flow.call("publishing", "app-info-query-v3", query=query, assert_fn=lambda b: any(l.get("lang") == lang and l.get("appName") == marker for l in b.get("languages", [])), assertion="new dedicated language exists") + description = "Updated dedicated unpublished fixture " + run_id[-8:] + flow.guard("language", lang) + flow.call("publishing", "language-info-update", query=query, body={"lang": lang, "appName": marker, "appDesc": description}) + flow.call("publishing", "app-info-query-v3", query=query, assert_fn=lambda b: any(l.get("lang") == lang and l.get("appDesc") == description for l in b.get("languages", [])), assertion="dedicated language description changed") + except Exception as error: + flow.ledger["failure"] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + finally: + if created and is_owned(flow.ledger, "language", lang): + try: + flow.call("publishing", "language-info-delete", query={**query, "lang": lang}) + flow.call("publishing", "app-info-query-v3", query=query, assert_fn=lambda b: not any(l.get("lang") == lang for l in b.get("languages", [])), assertion="temporary language absent after deletion") + flow.ledger["cleanupVerified"] = True + except Exception as error: + flow.ledger["cleanupFailure"] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + return flow.finish() + + +def domain_flow(args, run_id): + """全量配置接口仅在已确认为空的专用应用上执行,并恢复空列表。""" + flow = Flow(args, "server-domain", run_id) + fixture = json.loads((ROOT / "docs/verification/dedicated-test-app.json").read_text()) + if not is_dedicated_app(args.app_id, fixture): + flow.ledger.update(status="blocked", failure="Dedicated application required") + flow.save() + return flow.ledger + headers, query = {"appId": args.app_id}, {"category": "server"} + changed = False + try: + initial = flow.call("domains", "domain-api-get-domain", headers=headers, query=query) + if initial.get("domains") != []: + raise RuntimeError("Refuse to replace existing server domains") + target = {"type": "httpRequest", "value": "https://agccli.app"} + flow.call("domains", "domain-api-post-domain", headers=headers, query=query, body={"domains": [target]}) + changed = True + flow.call("domains", "domain-api-get-domain", headers=headers, query=query, assert_fn=lambda b: target in b.get("domains", []), assertion="dedicated server domain read back") + except Exception as error: + flow.ledger["failure"] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + finally: + if changed: + try: + flow.call("domains", "domain-api-post-domain", headers=headers, query=query, body={"domains": []}) + flow.call("domains", "domain-api-get-domain", headers=headers, query=query, assert_fn=lambda b: b.get("domains") == [], assertion="dedicated server domains restored empty") + flow.ledger["cleanupVerified"] = True + except Exception as error: + flow.ledger["cleanupFailure"] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + return flow.finish() + + +def pms_group_update_flow(args, run_id): + """仅复用已登记并读回的专用空商品组;修改名称后恢复,不改变分组状态。""" + flow = Flow(args, "pms-group-update", run_id) + fixture_path = ROOT / "docs/verification/pms-test-group.json" + fixture = json.loads(fixture_path.read_text()) if fixture_path.exists() else {} + app = json.loads((ROOT / "docs/verification/dedicated-test-app.json").read_text()) + if not is_dedicated_app(args.app_id, app) or fixture.get("appId") != args.app_id or fixture.get("readbackVerified") is not True or not fixture.get("groupName", "").startswith("AGCCLIVerify_") or args.profile != fixture.get("profile"): + flow.ledger.update(status="blocked", failure="Verified dedicated subscription group and matching profile required") + flow.save() + return flow.ledger + group_id, original = fixture["groupId"], fixture["groupName"] + headers = {"appId": args.app_id} + changed = False + def query(name, assertion): + return flow.call("pms", "getproductgroup-harmonyosnext", headers=headers, body={"requestId": str(uuid.uuid4()), "pageNum": 1, "pageSize": 300}, assert_fn=lambda b: any(g.get("groupId") == group_id and g.get("groupName") == name and g.get("totalProductNumber") == 0 for g in b.get("simpleGroups", [])), assertion=assertion) + def update(name): + return flow.call("pms", "updateproductgroup-harmonyosnext", headers=headers, body={"requestId": str(uuid.uuid4()), "resource": {"groupId": group_id, "groupName": name}}) + try: + query(original, "registered dedicated empty group exists") + flow.ledger["fixtureRunId"] = fixture["runId"] + flow.own("groupId", group_id) + renamed = "AGCCLIVerify_" + run_id[-8:] + update(renamed) + changed = True + query(renamed, "dedicated subscription group renamed and empty") + except Exception as error: + flow.ledger["failure"] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + finally: + if changed: + try: + flow.guard("groupId", group_id) + update(original) + query(original, "dedicated subscription group name restored") + flow.ledger["cleanupVerified"] = True + flow.ledger["retention"] = fixture["retention"] + except Exception as error: + flow.ledger["cleanupFailure"] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + return flow.finish() + + def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--binary", required=True, type=pathlib.Path) parser.add_argument("--profile", required=True) parser.add_argument("--app-id", required=True) - parser.add_argument("--flows", choices=("group", "draft", "both", "provisioning"), default="both") + parser.add_argument("--flows", choices=("group", "draft", "draft-update", "both", "provisioning", "language", "domain", "pms-group-update"), default="both") parser.add_argument("--output-dir", type=pathlib.Path, default=ROOT / "docs/verification/lifecycles") args = parser.parse_args() args.binary = args.binary.resolve() run_id = datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%dT%H%M%SZ") + "-" + uuid.uuid4().hex[:8] - flows = [group_flow, version_flow] if args.flows == "both" else [{"group": group_flow, "draft": version_flow, "provisioning": provisioning_flow}[args.flows]] + flows = [group_flow, version_flow] if args.flows == "both" else [{"group": group_flow, "draft": version_flow, "draft-update": version_flow, "provisioning": provisioning_flow, "language": language_flow, "domain": domain_flow, "pms-group-update": pms_group_update_flow}[args.flows]] with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool: reports = list(pool.map(lambda f: f(args, run_id), flows)) for report in reports: diff --git a/scripts/live-multipart.py b/scripts/live-multipart.py new file mode 100644 index 0000000..52b9978 --- /dev/null +++ b/scripts/live-multipart.py @@ -0,0 +1,116 @@ +"""Continue an owned initialized upload; two part uploads run concurrently. +Only the dedicated APP artifact is used. Signed URLs and headers stay in memory. +No package registration, submission or publication is performed. +""" +import argparse +import concurrent.futures +import datetime +import hashlib +import importlib.util +import json +import pathlib +import subprocess +import tempfile +import zipfile + +ROOT = pathlib.Path(__file__).resolve().parents[1] +spec = importlib.util.spec_from_file_location('lifecycle', pathlib.Path(__file__).with_name('live-lifecycle.py')) +lifecycle = importlib.util.module_from_spec(spec) +spec.loader.exec_module(lifecycle) + + +def validate_addresses(addresses, expected_keys): + # 合并必须使用服务器返回的分片对象 ID;全部地址先核对,再并发上传。 + if not isinstance(addresses, dict) or set(addresses) != set(expected_keys): + raise RuntimeError('Signed addresses do not cover exact owned APP parts') + for address in addresses.values(): + if (not isinstance(address, dict) + or address.get('method') != 'PUT' + or not isinstance(address.get('url'), str) + or not address['url'].startswith('https://') + or not isinstance(address.get('partObjectId'), str) + or not address['partObjectId'].strip() + or len(address['partObjectId']) > 64 + or not isinstance(address.get('headers', {}), dict)): + raise RuntimeError('Incomplete signed part address; response withheld') + + +def upload_part(binary, profile, address, path): + if address.get('method') != 'PUT' or not address.get('url', '').startswith('https://'): + raise RuntimeError('Invalid signed part upload method/address') + command = [str(binary), '--profile', profile, 'upload', 'obbfile-upload', '--invoke', '--dry-run=false', '--param', 'uploadUrl='+address['url'], '--file', str(path)] + for key, value in address.get('headers', {}).items(): + command += ['--header', key+'='+str(value)] + result = subprocess.run(command, cwd=ROOT, capture_output=True, text=True, timeout=90) + if result.returncode: + raise RuntimeError('Part CLI upload failed; sensitive response withheld') + data = json.loads(result.stdout)['data'] + content = path.read_bytes() + expected = hashlib.md5(content).hexdigest() + etag = data.get('etag', '').strip('"') + if data.get('dryRun') is not False or data.get('statusCode') != 200 or etag.lower() != expected: + raise RuntimeError('Part response does not verify exact uploaded bytes') + return {'httpStatus': 200, 'etag': etag, 'expectedMD5': expected, 'bytes': len(content), 'sha256': hashlib.sha256(content).hexdigest()} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--ledger', required=True, type=pathlib.Path) + parser.add_argument('--binary', required=True, type=pathlib.Path) + args = parser.parse_args() + ledger = json.loads(args.ledger.read_text()) + fixture = json.loads((ROOT/'docs/verification/dedicated-test-app.json').read_text()) + if ledger.get('flow') != 'multipart-upload' or ledger.get('status') != 'initialized' or not lifecycle.is_dedicated_app(ledger.get('appId'), fixture): + raise SystemExit('Owned initialized dedicated multipart ledger required') + for key in ('objectId', 'nspUploadId'): + if not ledger.get('owned', {}).get(key): raise SystemExit('Missing owned multipart session') + builds = [json.loads(p.read_text()) for p in args.ledger.parent.glob('*-dedicated-app-package-build.json')] + builds = [b for b in builds if b.get('appId') == fixture['appId'] and b.get('status') == 'verified-unsigned-app'] + artifact = max(builds, key=lambda b: b['checkedAt'])['artifacts'][0] + source = pathlib.Path(artifact['path']) + content = source.read_bytes() + if hashlib.sha256(content).hexdigest() != artifact['sha256']: + raise SystemExit('Dedicated APP changed since verified build') + with zipfile.ZipFile(source) as archive: + if json.loads(archive.read('pack.info'))['summary']['app']['bundleName'] != fixture['packageName']: + raise SystemExit('Dedicated APP bundle mismatch') + chunk_size = ledger['partBounds']['nspPartMinSize'] + if type(chunk_size) is not int or not 0 < chunk_size <= 100*1024*1024 or len(content) <= chunk_size: + raise SystemExit('Require real multi-part APP within documented part bounds') + # Resume the same session: never create a replacement on observation timeout. + flow = object.__new__(lifecycle.Flow) + flow.args = argparse.Namespace(binary=args.binary.resolve(), profile=ledger['profile'], app_id=ledger['appId']) + flow.output, flow.ledger = args.ledger, ledger + ledger['sourceArtifact'] = {'sha256': artifact['sha256'], 'bytes': len(content), 'bundleName': fixture['packageName']} + query = {key: ledger['owned'][key] for key in ('objectId', 'nspUploadId')} + try: + with tempfile.TemporaryDirectory(prefix='agc-multipart-parts-') as work: + parts = {} + for i, start in enumerate(range(0, len(content), chunk_size), 1): + key = 'additionalProp'+str(i) + path = pathlib.Path(work)/('part-'+str(i)) + path.write_bytes(content[start:start+chunk_size]); parts[key] = path + request = {k: {'length': p.stat().st_size, 'sha256': hashlib.sha256(p.read_bytes()).hexdigest()} for k, p in parts.items()} + addresses = flow.call('upload', 'obbfile-uploadurl', query=query, body=request, + assert_fn=lambda b: set(b.get('uploadInfoMap', {})) == set(parts), assertion='signed addresses cover exact owned APP parts')['uploadInfoMap'] + validate_addresses(addresses, parts) + with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool: + pending = {key: pool.submit(upload_part, args.binary.resolve(), ledger['profile'], addresses[key], path) for key, path in parts.items()} + receipts = {key: task.result() for key, task in pending.items()} + ledger['partReceipts'] = receipts + ledger['steps'].append({'family': 'upload', 'endpoint': 'obbfile-upload', 'profile': ledger['profile'], 'status': 'passed', 'checkedAt': datetime.datetime.now(datetime.timezone.utc).isoformat(), 'assertion': 'every owned part HTTP 200 and ETag matches independent local MD5', 'partCount': len(receipts)}) + flow.save() + compose = {key: {'partObjectId': addresses[key]['partObjectId'], 'etag': receipt['etag']} for key, receipt in receipts.items()} + flow.call('upload', 'obbfile-compose', query=query, body=compose, assertion='owned session merged using exact uploaded part receipts') + ledger['status'] = 'verified-part-upload-and-compose' + ledger['retention'] = 'Dedicated remote object retained, not linked to app versions; no delete API available' + ledger['limitations'] = ['Final merged bytes not independently downloaded; compose business success does not prove final byte equality.'] + except Exception as error: + ledger['status'] = 'incomplete' + ledger['failure'] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + finally: + flow.save() + print(ledger['status'], str(flow.output)) + + +if __name__ == '__main__': main() diff --git a/scripts/live-package.py b/scripts/live-package.py new file mode 100644 index 0000000..52a2bdd --- /dev/null +++ b/scripts/live-package.py @@ -0,0 +1,274 @@ +"""专用 .app 的真实签名、上传和异步解析;不提交审核或发布。 + +证书、Profile 与指纹仅使用本次创建的资源。私钥和密码不写入报告。 +上传后的未关联软件包保留,签名资源在结束时清理并逐项读回。 +""" +import argparse +import io +import datetime +import hashlib +import importlib.util +import json +import pathlib +import re +import subprocess +import tempfile +import time +import urllib.request +import uuid +import zipfile +import os +import shutil +import ssl + +_certificate_spec = importlib.util.spec_from_file_location("certificate_fingerprint", pathlib.Path(__file__).with_name("certificate-fingerprint.py")) +_certificate_module = importlib.util.module_from_spec(_certificate_spec) +_certificate_spec.loader.exec_module(_certificate_module) +certificate_fingerprint_for_csr = _certificate_module.certificate_fingerprint_for_csr + + +ROOT = pathlib.Path(__file__).resolve().parents[1] +spec = importlib.util.spec_from_file_location("lifecycle", pathlib.Path(__file__).with_name("live-lifecycle.py")) +lifecycle = importlib.util.module_from_spec(spec) +spec.loader.exec_module(lifecycle) +JAVA = "/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home/bin/java" +SIGNER = "/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/toolchains/lib/hap-sign-tool.jar" +PACKER = "/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/toolchains/lib/app_packing_tool.jar" + + +def inspect_app_modules(source, expected_bundle): + """逐个核对内层 HAP 的应用身份,外层 pack.info 不能替代内层检查。""" + report = [] + with zipfile.ZipFile(source) as archive: + for item in archive.infolist(): + if not item.filename.endswith('.hap'): + continue + with zipfile.ZipFile(io.BytesIO(archive.read(item))) as hap: + config = json.loads(hap.read('module.json')) + app = config.get('app', {}) + if app.get('bundleName') != expected_bundle: + raise RuntimeError('Inner HAP bundle does not match dedicated application') + report.append({'moduleName': config.get('module', {}).get('name'), + 'bundleMatchesDedicated': True, 'debug': app.get('debug'), + 'minAPIVersion': app.get('minAPIVersion'), + 'targetAPIVersion': app.get('targetAPIVersion')}) + if not report: + raise RuntimeError('Dedicated APP contains no HAP modules') + return report + + +def retain_signed_artifact(source, directory): + """仅复制最终 APP,不复制私钥、密码文件或临时签名目录。""" + if source.suffix != ".app": + raise RuntimeError("Only final APP artifacts can be retained") + directory.mkdir(mode=0o700, parents=True, exist_ok=True) + if directory.is_symlink(): + raise RuntimeError("Artifact directory must not be a symlink") + target = directory / source.name + with source.open("rb") as reader, os.fdopen(os.open(target, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600), "wb") as writer: + shutil.copyfileobj(reader, writer) + digest = hashlib.sha256(target.read_bytes()).hexdigest() + if digest != hashlib.sha256(source.read_bytes()).hexdigest(): + raise RuntimeError("Retained signed APP byte verification failed") + return {"path": str(target), "sha256": digest, "bytes": target.stat().st_size} + + + +def run_sdk(arguments, label, tool=SIGNER): + result = subprocess.run([JAVA, "-jar", tool, *arguments], capture_output=True, text=True, timeout=90) + output = result.stdout + result.stderr + # SDK 部分工具报错仍退出 0;错误日志不能当作签名/打包成功。 + if result.returncode or re.search(r"\[Error\]|ERROR:\s*\d+", output, re.IGNORECASE): + match = re.search(r"(?:ERROR:\s*|code:\s*)(\d+)", output, re.IGNORECASE) + raise RuntimeError(label + " failed" + ("; SDK code " + match[1] if match else "")) + + +def download(url, target): + if not isinstance(url, str) or not url.startswith("https://"): + raise RuntimeError("Missing HTTPS signing resource download") + with urllib.request.urlopen(url, timeout=30) as response: + content = response.read(1024 * 1024) + if response.status != 200 or not content: + raise RuntimeError("Signing resource download failed") + target.write_bytes(content) + + +def package_state(body, package_id): + states = [p for p in body.get("pkgStateList", []) if p.get("pkgId") == package_id] + if len(states) != 1 or type(states[0].get("successStatus")) is not int or states[0]["successStatus"] not in (0, 1, 2): + raise RuntimeError("Missing unambiguous owned package parse state") + return states[0]["successStatus"] + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--binary", required=True, type=pathlib.Path) + parser.add_argument("--profile", required=True) + parser.add_argument("--compile-profile", required=True) + parser.add_argument("--sign-compatible-version", choices=("24", "sdk-default"), default="24", help="Controlled signing comparison; sdk-default omits the override (installed SDK default is 9).") + parser.add_argument("--app-id", required=True) + parser.add_argument("--artifact-dir", type=pathlib.Path, default=pathlib.Path(tempfile.gettempdir()) / "agc-signed-package-artifacts") + parser.add_argument("--output-dir", type=pathlib.Path, default=ROOT / "docs/verification/lifecycles") + args = parser.parse_args() + args.binary = args.binary.resolve() + fixture = json.loads((ROOT / "docs/verification/dedicated-test-app.json").read_text()) + if not lifecycle.is_dedicated_app(args.app_id, fixture): + raise SystemExit("Verified dedicated application required") + builds = [json.loads(p.read_text()) for p in args.output_dir.glob("*-dedicated-app-package-build.json")] + builds = [b for b in builds if b.get("status") == "verified-unsigned-app" and b.get("appId") == args.app_id and b.get("bundleName") == fixture["packageName"]] + if not builds: + raise SystemExit("Verified dedicated unsigned APP build required") + build = max(builds, key=lambda b: b["checkedAt"]) + artifact = build["artifacts"][0] + source = pathlib.Path(artifact["path"]) + if hashlib.sha256(source.read_bytes()).hexdigest() != artifact["sha256"]: + raise SystemExit("Build artifact changed since verification") + with zipfile.ZipFile(source) as archive: + if json.loads(archive.read("pack.info"))["summary"]["app"]["bundleName"] != fixture["packageName"]: + raise SystemExit("APP bundle does not match dedicated application") + module_inspection = inspect_app_modules(source, fixture["packageName"]) + run_id = datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%dT%H%M%SZ") + "-" + uuid.uuid4().hex[:8] + flow = lifecycle.Flow(args, "signed-test-package", run_id) + flow.ledger["sourceModuleInspection"] = module_inspection + flow.ledger["signingCompatibleVersion"] = args.sign_compatible_version + compatibility_args = [] if args.sign_compatible_version == "sdk-default" else ["-compatibleVersion", args.sign_compatible_version] + flow.save() + headers = {"appId": args.app_id} + cert_id = profile_id = fingerprint = None + fingerprint_added = False + with tempfile.TemporaryDirectory(prefix="agc-package-signing-") as directory: + tmp = pathlib.Path(directory) + try: + # 缓存的 fixture 不能证明应用现在可访问;先读回,避免为失效应用创建全局证书。 + flow.call("publishing", "app-info-query-v3", query={"appId": args.app_id}, assert_fn=lambda b: b.get("appInfo", {}).get("parentType") == 13 and str(b["appInfo"].get("projectId")) == str(fixture.get("projectId")), assertion="dedicated application live preflight matches fixture project") + flow.call("provisioning", "provision-api-get-fingerprints", headers=headers, assertion="dedicated signing API live preflight") + password = uuid.uuid4().hex + store, csr = tmp / "private.p12", tmp / "public.csr" + run_sdk(["generate-keypair", "-keyAlias", "agcverify", "-keyAlg", "ECC", "-keySize", "NIST-P-256", "-keystoreFile", str(store), "-keystorePwd", password, "-keyPwd", password], "Key generation") + store.chmod(0o600) + run_sdk(["generate-csr", "-keyAlias", "agcverify", "-keyPwd", password, "-subject", "C=CN,O=AGC CLI Verification,CN=AGC CLI Verification", "-signAlg", "SHA256withECDSA", "-keystoreFile", str(store), "-keystorePwd", password, "-outFile", str(csr)], "CSR generation") + certificate = flow.call("provisioning", "provision-api-apply-cent", body={"csr": csr.read_text(), "certName": "AGC CLI 软件包 " + run_id[-8:], "certType": 2}, assert_fn=lambda b: bool(b.get("certInfo", {}).get("id")), assertion="new dedicated release certificate ID") + cert_id = certificate["certInfo"]["id"] + flow.own("certId", cert_id) + cert_file = tmp / "public.cer" + download(certificate["certInfo"].get("certDownloadUrl"), cert_file) + fingerprint = certificate_fingerprint_for_csr(cert_file, csr) + flow.ledger["signerCertificateMatchesCSR"] = True + flow.save() + initial = flow.call("provisioning", "provision-api-get-fingerprints", headers=headers) + if fingerprint in json.dumps(initial): + raise RuntimeError("New certificate unexpectedly already registered") + flow.own("fingerprint", fingerprint) + flow.call("provisioning", "provision-api-add-fingerprints", headers=headers, body={"fingerprintList": [fingerprint]}) + fingerprint_added = True + flow.call("provisioning", "provision-api-get-fingerprints", headers=headers, assert_fn=lambda b: fingerprint in json.dumps(b), assertion="new package signer fingerprint read back") + provision = flow.call("provisioning", "provision-api-apply-provision", body={"provisionName": "AGC CLI 软件包 " + run_id[-8:], "provisionType": 2, "certId": cert_id, "appId": args.app_id}, assert_fn=lambda b: bool(b.get("provisionInfo", {}).get("id")), assertion="new dedicated release Profile ID") + profile_id = provision["provisionInfo"]["id"] + flow.own("provisionId", profile_id) + profile_file = tmp / "release.p7b" + download(provision["provisionInfo"].get("provisionDownloadUrl"), profile_file) + signed = tmp / ("agc-cli-" + run_id + ".app") + hap_metadata = [] + signed_haps = [] + with zipfile.ZipFile(source) as original: + for item in original.infolist(): + content = original.read(item.filename) + if item.filename.endswith(".hap"): + if pathlib.PurePosixPath(item.filename).name != item.filename: + raise RuntimeError("Unexpected non-root HAP entry") + unsigned_hap, signed_hap = tmp / ("unsigned-" + item.filename), tmp / item.filename + unsigned_hap.write_bytes(content) + run_sdk(["sign-app", "-mode", "localSign", "-keyAlias", "agcverify", "-keyPwd", password, "-appCertFile", str(cert_file), "-profileFile", str(profile_file), "-signAlg", "SHA256withECDSA", "-keystoreFile", str(store), "-keystorePwd", password, "-inFile", str(unsigned_hap), "-outFile", str(signed_hap), *compatibility_args], "HAP signing") + run_sdk(["verify-app", "-inFile", str(signed_hap), "-outCertChain", str(tmp / "verified-chain.cer"), "-outProfile", str(tmp / "verified-profile.p7b")], "HAP signature verification") + content = signed_hap.read_bytes() + hap_metadata.append({"fileName": item.filename, "sha256": hashlib.sha256(content).hexdigest(), "bytes": len(content), "sdkSignatureVerified": True}) + signed_haps.append(str(signed_hap)) + elif item.filename in ("pack.info", "pac.json"): + (tmp / item.filename).write_bytes(content) + if not hap_metadata: + raise RuntimeError("APP contains no signed HAP") + # 源 APP 内的 pack.info 已由 Hvigor 生成。保留它,避免重写已经签名的 HAP。 + run_sdk(["--mode", "app", "--pack-info-path", str(tmp / "pack.info"), "--hap-path", ",".join(signed_haps), "--out-path", str(signed), "--force", "true", "--pac-json-path", str(tmp / "pac.json"), "--replace-pack-info", "false"], "APP packing", tool=PACKER) + with zipfile.ZipFile(signed) as packed: + if packed.testzip() is not None or json.loads(packed.read("pack.info"))["summary"]["app"]["bundleName"] != fixture["packageName"]: + raise RuntimeError("Packed APP failed independent bundle/ZIP verification") + for hap in hap_metadata: + content = packed.read(hap["fileName"]) + packed_hap = tmp / ("packed-" + hap["fileName"]) + packed_hap.write_bytes(content) + # 打包工具可能调整包内元信息;必须对最终字节重新验签,不能沿用打包前的结果。 + run_sdk(["verify-app", "-inFile", str(packed_hap), "-outCertChain", str(tmp / "packed-chain.cer"), "-outProfile", str(tmp / "packed-profile.p7b")], "Packed HAP signature verification") + hap["beforePackingSHA256"] = hap["sha256"] + hap["sha256"] = hashlib.sha256(content).hexdigest() + hap["bytes"] = len(content) + hap["finalSDKSignatureVerified"] = True + flow.ledger["signedPackage"] = {"bundleName": fixture["packageName"], "sha256": hashlib.sha256(signed.read_bytes()).hexdigest(), "bytes": signed.stat().st_size, "haps": hap_metadata} + flow.ledger["signedArtifact"] = retain_signed_artifact(signed, args.artifact_dir.absolute()) + flow.save() + address = flow.call("upload", "upload-url-new", query={"appId": args.app_id, "suffix": "app", "fileName": signed.name, "contentLength": signed.stat().st_size})["urlInfo"] + if address.get("method", "").upper() != "PUT" or not address.get("url", "").startswith("https://"): + raise RuntimeError("Invalid package upload address") + command = [str(args.binary), "--profile", args.profile, "upload", "upload-file-new", "--invoke", "--dry-run=false", "--param", "uploadUrl=" + address["url"], "--file", str(signed)] + for key, value in address.get("headers", {}).items(): + command += ["--header", key + "=" + str(value)] + upload = subprocess.run(command, capture_output=True, text=True, timeout=90) + if upload.returncode: + raise RuntimeError("Signed package upload failed; output withheld") + uploaded = json.loads(upload.stdout)["data"] + if uploaded.get("dryRun") is not False or not 200 <= uploaded.get("statusCode", 0) < 300 or uploaded.get("etag", "").strip('"').lower() != hashlib.md5(signed.read_bytes()).hexdigest(): + raise RuntimeError("Signed package upload byte verification failed") + flow.own("objectId", address["objectId"]) + package = flow.call("testing", "test-api-add-test-package", query={"appId": args.app_id}, body={"distributeMode": 1, "file": {"fileName": signed.name, "objectId": address["objectId"]}}, assert_fn=lambda b: isinstance(b.get("pkgVersion"), list) and len(b["pkgVersion"]) == 1 and isinstance(b["pkgVersion"][0], str), assertion="new package ID returned for signed uploaded APP") + package_id = package["pkgVersion"][0] + flow.own("pkgId", package_id) + for attempt in range(40): + body = flow.call("publishing", "package-compile-status-v3", query={"appId": args.app_id, "pkgIds": package_id}) + state = package_state(body, package_id) + flow.ledger["steps"][-1]["packageId"] = package_id + flow.ledger["steps"][-1]["parseState"] = state + row = next(s for s in body["pkgStateList"] if s["pkgId"] == package_id) + error_code = str(row.get("errorCode", "")) + if re.fullmatch(r"[A-Za-z0-9_.-]{1,80}", error_code): + flow.ledger["steps"][-1]["errorCode"] = error_code + flow.save() + if state == 0: + flow.ledger["steps"][-1]["assertion"] = "new package parsed successfully for dedicated app" + flow.ledger["parseVerified"] = True + break + if state == 2: + raise RuntimeError("Server package parser rejected signed APP" + ("; code " + error_code if error_code else "")) + time.sleep(3) + if not flow.ledger.get("parseVerified"): + raise RuntimeError("Package parser remains pending after bounded polling") + try: + flow.call("publishing", "query-aabfile", query={"appId": args.app_id, "pkgIds": package_id}, profile=args.compile_profile, assert_fn=lambda b: package_state(b, package_id) == 0, assertion="legacy compile query confirms owned parsed package") + except RuntimeError: + flow.ledger["legacyCompileVerified"] = False + except Exception as error: + flow.ledger["failure"] = str(error) if isinstance(error, RuntimeError) else type(error).__name__ + finally: + cleanup_ok = True + operations = [] + if profile_id: + operations.append(("provision-api-delete-provision", {"query": {"id": profile_id}}, "provision-api-query-provision", {"headers": headers}, lambda b: not any(p.get("id") == profile_id for p in b.get("provisionList", [])), "new release Profile removed")) + if fingerprint_added: + operations.append(("provision-api-delete-fingerprints", {"headers": headers, "body": {"fingerprintList": [fingerprint]}}, "provision-api-get-fingerprints", {"headers": headers}, lambda b: fingerprint not in json.dumps(b), "new package signer fingerprint removed")) + if cert_id: + operations.append(("provision-api-delete-cent", {"body": {"certIds": [cert_id]}}, "provision-api-query-cent", {"body": {"pageNum": 1, "pageSize": 100}}, lambda b: not any(c.get("id") == cert_id for c in b.get("certList", [])), "new release certificate removed")) + for endpoint, mutation, query_endpoint, query, assertion, description in operations: + try: + flow.call("provisioning", endpoint, **mutation) + flow.call("provisioning", query_endpoint, **query, assert_fn=assertion, assertion=description) + except Exception: + cleanup_ok = False + flow.ledger["signingResourceCleanupVerified"] = cleanup_ok + flow.ledger["secretMaterialDeleted"] = True + flow.ledger["retention"] = "Uploaded unlinked APP/object and package retained; signing resources removed; no review or publication request made" + flow.ledger["status"] = "verified-package" if flow.ledger.get("parseVerified") and flow.ledger.get("signingResourceCleanupVerified") else "incomplete" + flow.save() + print(flow.ledger["status"], flow.ledger.get("failure", ""), str(flow.output.relative_to(ROOT))) + return int(flow.ledger["status"] != "verified-package") + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/live-upload.py b/scripts/live-upload.py new file mode 100644 index 0000000..3b2d47c --- /dev/null +++ b/scripts/live-upload.py @@ -0,0 +1,73 @@ +"""用显式授权和专用应用验证签名上传;不记录签名地址或授权头。""" +import argparse +import base64 +import datetime +import hashlib +import json +import pathlib +import subprocess +import tempfile +import uuid + +ROOT = pathlib.Path(__file__).resolve().parents[1] + + +def invoke(binary, profile, endpoint, extra): + proc = subprocess.run([str(binary), "--profile", profile, "upload", endpoint, "--invoke", "--dry-run=false", *extra], capture_output=True, text=True, timeout=65) + if proc.returncode: + raise RuntimeError(endpoint + " failed; raw output withheld") + result = json.loads(proc.stdout)["data"] + if result.get("dryRun") is not False or not 200 <= result.get("statusCode", 0) < 300: + raise RuntimeError(endpoint + " did not return live HTTP success") + return result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--binary", required=True, type=pathlib.Path) + parser.add_argument("--profile", required=True) + parser.add_argument("--app-id", required=True) + args = parser.parse_args() + fixture = json.loads((ROOT / "docs/verification/dedicated-test-app.json").read_text()) + if fixture.get("appId") != args.app_id or fixture.get("readbackVerified") is not True: + raise SystemExit("Upload requires the dedicated test application") + run = datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%dT%H%M%SZ") + "-" + uuid.uuid4().hex[:8] + report = {"runId": run, "flow": "signed-file-upload", "profile": args.profile, "appId": args.app_id, "status": "running", "steps": [], "retention": "Unlinked test object retained; no object deletion API is registered. Application metadata is not modified."} + output = ROOT / "docs/verification/lifecycles" / (run + "-signed-file-upload.json") + try: + content = base64.b64decode("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+jRL0AAAAASUVORK5CYII=") + report.update(contentLength=len(content), sha256=hashlib.sha256(content).hexdigest()) + with tempfile.TemporaryDirectory(prefix="agc-upload-") as directory: + image = pathlib.Path(directory) / "fixture.png" + image.write_bytes(content) + query = {"appId": args.app_id, "suffix": "png", "fileName": "agc-cli-" + run + ".png", "contentLength": len(content)} + acquired = invoke(args.binary, args.profile, "upload-url-new", [item for k, v in query.items() for item in ("--query", f"{k}={v}")]) + body = acquired.get("body", {}) + info = body.get("urlInfo", {}) + if str(body.get("ret", {}).get("code")) != "0" or info.get("method", "").upper() != "PUT" or not info.get("objectId") or not info.get("url", "").startswith("https://"): + raise RuntimeError("Invalid upload address contract") + report["objectId"] = info["objectId"] + report["steps"].append({"family": "upload", "endpoint": "upload-url-new", "status": "passed", "httpStatus": acquired["statusCode"], "businessCode": 0}) + extra = ["--param", "uploadUrl=" + info["url"], "--file", str(image)] + headers = info.get("headers", {}) + if not isinstance(headers, dict): + raise RuntimeError("Unsupported upload headers format") + for key, value in headers.items(): + extra += ["--header", str(key) + "=" + str(value)] + uploaded = invoke(args.binary, args.profile, "upload-file-new", extra) + etag = uploaded.get("etag", "").strip('"').lower() + if etag != hashlib.md5(content).hexdigest(): + raise RuntimeError("Server ETag differs from fixture MD5") + report["steps"].append({"family": "upload", "endpoint": "upload-file-new", "status": "passed", "httpStatus": uploaded["statusCode"], "assertion": "server ETag matches uploaded fixture MD5", "etag": etag}) + report["status"] = "verified-upload" + except Exception as error: + report.update(status="incomplete", failure=str(error) if isinstance(error, RuntimeError) else type(error).__name__) + finally: + report["checkedAt"] = datetime.datetime.now(datetime.timezone.utc).isoformat() + output.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n") + print(report["status"], report.get("failure", ""), str(output.relative_to(ROOT))) + return 0 if report["status"] == "verified-upload" else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/render-publishing-guide.py b/scripts/render-publishing-guide.py new file mode 100644 index 0000000..667b3b9 --- /dev/null +++ b/scripts/render-publishing-guide.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +"""Render the reviewed Publishing pages as a CLI reference, without network/auth. + +This is documentation rendering, not contract validation. Keep source tables +intact, including conditional-requiredness remarks and authentication branches. +""" +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] + + +def cell(value): + return value.replace('|', r'\|').replace('\n', '
') + + +def render(): + audit = json.loads((ROOT / 'docs/verification/publishing-contract-audit-current.json').read_text()) + output = [ + '# Publishing API 逐项 CLI 参考', '', + '本文从浏览器保存的官方正文生成,每项说明用途、传输位置、参数和前置条件。' + '生成命令:`python3 scripts/render-publishing-guide.py`。', '', + '流程和请求文件示例见 [Publishing 使用与核验](PUBLISHING_WORKFLOWS.md)。' + '表格保留官方必选标记;条件要求和表格/示例冲突需要同时阅读说明。' + '本文件不代表所有模型规则已实现或全部线上操作已验收。', '', + '## 参数位置', '', + '`query` 使用 `--query key=value`,`header` 使用 `--header key=value`,' + '`body` 使用 JSON 文件 `--body request.json` 或已声明类型的 `--field key=value`。' + 'JSON 整数不加引号,对象和数组按实际模型展开。', '', + '实际调用选择 `--profile PROFILE`,先使用 `--invoke --dry-run` 查看请求计划;' + '只有准备实际调用时才使用 `--invoke --dry-run=false`。' + 'dry-run 不证明资源状态、权限或审核结果。', '', + ] + for endpoint in audit['endpoints']: + command = endpoint['command'] + doc = json.loads((ROOT / 'pkg/domain/reference/publishing' / (command + '.json')).read_text()) + output += [f"## {doc['title']}", '', + f"命令:`agc publishing {command}`。请求:`{endpoint['method']} {endpoint['path']}`。", '', + f"[官方正文]({doc['sourceUrl']});官网更新:{doc.get('updatedAt', '未标明')};" + f"浏览器读取:{doc.get('checkedAt', '未标明')}。", ''] + for note in doc.get('notes', []): + if note['section'] in ('功能介绍', '使用约束'): + output += [note['text'], ''] + for table in doc.get('tables', []): + if table.get('section') != '请求参数': + continue + label = table.get('location') or '参数' + if label == 'header': + label += '(' + table.get('authenticationBranch', '认证方式以正文说明为准') + ')' + output += [f"### {label}", '', f"[参数来源]({table['sourceUrl']})", ''] + rows = table['rows'] + if not rows: + continue + output += ['| ' + ' | '.join(cell(x) for x in rows[0]) + ' |', + '| ' + ' | '.join('---' for _ in rows[0]) + ' |'] + output += ['| ' + ' | '.join(cell(x) for x in row) + ' |' for row in rows[1:]] + output += [''] + remarks = [note for note in doc.get('notes', []) if note['section'] == '请求参数' + and not note['text'].endswith('方式:')] + if remarks: + output += ['### 请求说明', ''] + for note in remarks: + output += [note['text'], ''] + output += ['### 完整模型及示例', '', '```sh', + f'agc publishing {command} --docs --pretty', '```', '', + '该命令返回官方请求/响应示例及已捕获的关联模型。' + '业务响应中的 `ret.code` 应与 HTTP 状态分别检查;' + '修改后使用相应查询接口确认目标状态。', ''] + (ROOT / 'docs/PUBLISHING_API_REFERENCE.md').write_text('\n'.join(output), encoding='utf-8') + + +if __name__ == '__main__': + render() diff --git a/scripts/serverless-verification-report.py b/scripts/serverless-verification-report.py new file mode 100644 index 0000000..dfaf5f5 --- /dev/null +++ b/scripts/serverless-verification-report.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +"""Build a per-operation offline matrix from actual go test -json pass events. +No authentication, network calls or raw test output is retained. Live is always +not-run here: only a dedicated-resource lifecycle runner may establish that. +""" +import argparse,datetime,hashlib,json,subprocess +from pathlib import Path +FAMILIES={'functions','cloud-auth','clouddb','storage','hosting','templates'} +def matrix(endpoints,events): + passed={e.get('Test') for e in events if e.get('Action')=='pass' and e.get('Test')} + packages={e.get('Package') for e in events if e.get('Action')=='pass' and not e.get('Test')} + required={'github.com/Createitv/agc-cli/cmd/agc/command','github.com/Createitv/agc-cli/pkg/server'} + package_ok=required<=packages + rows=[] + for endpoint in endpoints: + f,id=endpoint['familyId'],endpoint['id'] + if f not in FAMILIES:continue + suffix=f+'/'+id + row={'family':f,'operation':id,'sourceUrl':endpoint['sourceUrl'],'documentationStatus':endpoint.get('documentation',{}).get('status'),'cliHTTP':'passed' if 'TestEveryEndpointHTTPTransport/'+suffix in passed else 'not-run','restHTTP':'passed' if 'TestEveryServerlessOperationREST/'+suffix in passed else 'not-run','dryRun':'passed' if 'TestEveryRegisteredEndpointCanDryRun/'+suffix in passed else 'not-run','live':{'status':'not-run','reason':'No explicit profile/project and dedicated cloud test resources were selected.'}} + rows.append(row) + complete=package_ok and bool(rows) and all(all(r[k]=='passed' for k in ('cliHTTP','restHTTP','dryRun')) for r in rows) + return {'offlineComplete':complete,'packagesPassed':package_ok,'operationCount':len(rows),'operations':rows,'liveVerified':0} +def main(): + p=argparse.ArgumentParser(description=__doc__);p.add_argument('--binary',default='./bin/agc');p.add_argument('--events',required=True);p.add_argument('--output',required=True);a=p.parse_args();binary=Path(a.binary).resolve() + endpoints=json.loads(subprocess.check_output([str(binary),'endpoints'],text=True))['data'] + events=[json.loads(line) for line in Path(a.events).read_text().splitlines() if line.strip()] + report=matrix(endpoints,events);report.update(generatedAt=datetime.datetime.now(datetime.timezone.utc).isoformat(),binary=str(binary),binarySHA256=hashlib.sha256(binary.read_bytes()).hexdigest(),evidence='Real local httptest transports via CLI and REST; no Huawei cloud verification implied.') + target=Path(a.output);target.parent.mkdir(parents=True,exist_ok=True);target.write_text(json.dumps(report,ensure_ascii=False,indent=2)+'\n') + print(json.dumps({k:report[k] for k in ('offlineComplete','packagesPassed','operationCount','liveVerified')}));return 0 if report['offlineComplete'] else 1 +if __name__=='__main__':raise SystemExit(main()) diff --git a/scripts/test_browser_capture.mjs b/scripts/test_browser_capture.mjs new file mode 100644 index 0000000..45a0b13 --- /dev/null +++ b/scripts/test_browser_capture.mjs @@ -0,0 +1,29 @@ +import assert from 'node:assert/strict'; +import {test} from 'node:test'; +import {JSDOM} from '../apps/web/node_modules/jsdom/lib/api.js'; +import {captureReference} from './browser-capture-reference.mjs'; + +test('captures request examples split across application-kind subsections',async()=>{ + const dom=new JSDOM(`

更新隐私政策协议

+

请求示例

+

HarmonyOS应用

PUT /agreement\n{"agreementInfos":[{"lang":"zh"}]}
+

元服务

PUT /agreement\n{"agreementInfos":[{"lang":"en"}]}
+

响应示例

{"ret":{"code":0}}
+
`); + // jsdom models the DOM, but has no layout engine to supply innerText. + Object.defineProperty(dom.window.HTMLElement.prototype,'innerText',{get(){return this.textContent;}}); + globalThis.document=dom.window.document; + const tab={url:async()=> 'https://official/fixture',playwright:{ + getByRole:()=>({first:()=>({waitFor:async()=>{}})}),evaluate:async(fn,arg)=>fn(arg), + }}; + try { + const doc=await captureReference(tab,'https://official/fixture'); + assert.equal(doc.examples.length,2); + assert.match(doc.examples[0].text,/HarmonyOS应用/); + assert.match(doc.examples[0].text,/"lang":"zh"/); + assert.match(doc.examples[0].text,/元服务/); + assert.match(doc.examples[0].text,/"lang":"en"/); + assert.doesNotMatch(doc.examples[0].text,/"ret"/); + assert.match(doc.examples[1].text,/"ret"/); + } finally {delete globalThis.document;dom.window.close();} +}); diff --git a/scripts/test_certificate_fingerprint.py b/scripts/test_certificate_fingerprint.py new file mode 100644 index 0000000..312f1b9 --- /dev/null +++ b/scripts/test_certificate_fingerprint.py @@ -0,0 +1,31 @@ +"""Real OpenSSL regression: a CA-first chain must select the CSR's leaf.""" +import importlib.util +import pathlib +import subprocess +import tempfile +import unittest + +spec = importlib.util.spec_from_file_location('package', pathlib.Path(__file__).with_name('live-package.py')) +m = importlib.util.module_from_spec(spec);spec.loader.exec_module(m) + +class FingerprintTests(unittest.TestCase): + def run_command(self, command): + return subprocess.run(command, capture_output=True, check=True).stdout + + def test_ca_first_chain_selects_csr_key_and_rejects_unrelated_chain(self): + with tempfile.TemporaryDirectory() as work: + w = pathlib.Path(work) + for name in ('root', 'leaf'): + self.run_command(['openssl', 'req', '-newkey', 'ec', '-pkeyopt', 'ec_paramgen_curve:prime256v1', '-nodes', '-keyout', str(w/(name+'.key')), '-out', str(w/(name+'.csr')), '-subj', '/CN=Offline-'+name]) + self.run_command(['openssl', 'req', '-x509', '-key', str(w/(name+'.key')), '-in', str(w/(name+'.csr')), '-out', str(w/(name+'.pem')), '-days', '1']) + chain = w/'chain.cer';chain.write_bytes((w/'root.pem').read_bytes()+(w/'leaf.pem').read_bytes()) + expected = self.run_command(['openssl', 'x509', '-in', str(w/'leaf.pem'), '-noout', '-fingerprint', '-sha256']).decode().split('=')[1].strip().replace(':', '') + legacy = self.run_command(['openssl', 'x509', '-in', str(chain), '-noout', '-fingerprint', '-sha256']).decode().split('=')[1].strip().replace(':', '') + self.assertNotEqual(legacy, expected) # 原算法取到链首 CA,复现错误。 + self.assertEqual(m.certificate_fingerprint_for_csr(chain, w/'leaf.csr'), expected) + self.assertEqual(m.lifecycle.certificate_fingerprint_for_csr(chain, w/'leaf.csr'), expected) + with self.assertRaises(RuntimeError):m.certificate_fingerprint_for_csr(w/'root.pem', w/'leaf.csr') + chain.write_bytes((w/'leaf.pem').read_bytes()*2) + with self.assertRaises(RuntimeError):m.certificate_fingerprint_for_csr(chain, w/'leaf.csr') + +if __name__ == '__main__':unittest.main() diff --git a/scripts/test_coverage_isolation.py b/scripts/test_coverage_isolation.py new file mode 100644 index 0000000..009bb5d --- /dev/null +++ b/scripts/test_coverage_isolation.py @@ -0,0 +1,37 @@ +"""Two actual Make invocations must not consume one another's profiles.""" +import os +import pathlib +import subprocess +import tempfile +import unittest +import concurrent.futures + +ROOT = pathlib.Path(__file__).resolve().parents[1] + +class CoverageTests(unittest.TestCase): + def test_parallel_coverage_uses_owned_profiles(self): + with tempfile.TemporaryDirectory() as work: + directory = pathlib.Path(work) + fake = directory/'go' + fake.write_text('''#!/usr/bin/env python3 +import sys,os,pathlib,time +args=sys.argv[1:] +if args[0]=='test': + p=pathlib.Path(next(a.split('=',1)[1] for a in args if a.startswith('-coverprofile='))) + p.write_text(os.environ['COVERAGE_TEST_OWNER']) + time.sleep(.3) +elif args[:2]==['tool','cover']: + p=pathlib.Path(next(a.split('=',1)[1] for a in args if a.startswith('-func='))) + if p.read_text()!=os.environ['COVERAGE_TEST_OWNER']:sys.exit(7) + print('total: (statements) 84.0%') +else:sys.exit(8) +''') + fake.chmod(0o700) + def run(owner): + env=dict(os.environ,COVERAGE_TEST_OWNER=owner) + return subprocess.run(['make','-f',str(ROOT/'Makefile'),'coverage-check','GO='+str(fake)],cwd=directory,env=env,capture_output=True,text=True) + with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool: + results=list(pool.map(run,['first','second'])) + self.assertEqual([r.returncode for r in results],[0,0],str([(r.stdout,r.stderr) for r in results])) + +if __name__=='__main__':unittest.main() diff --git a/scripts/test_goal_progress.py b/scripts/test_goal_progress.py new file mode 100644 index 0000000..6a78623 --- /dev/null +++ b/scripts/test_goal_progress.py @@ -0,0 +1,106 @@ +import importlib.util +import pathlib +import unittest +import json +import copy + +spec = importlib.util.spec_from_file_location("progress", pathlib.Path(__file__).with_name("goal-progress.py")) +module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(module) + + +class ProgressTests(unittest.TestCase): + def test_domain_precheck_requires_real_code_file_readback_and_cleanup(self): + baseline = {'originalBlocked': [{'family': 'domains', 'endpoint': 'domain-api-precheck'}]} + ledger = {'flow': 'domain-precheck-custom-host', 'status': 'verified-precheck', 'appId': 'dedicated', + 'owned': {'workerName': 'owned-worker', 'hostname': 'owned.example.test'}, + 'hostedDomain': 'https://owned.example.test', 'cleanupVerified': True, + 'verificationFile': {'fileName': 'dedicated.txt', 'bytes': 32, 'sha256': 'a'*64, + 'sourceURL': 'https://connect-api.cloud.huawei.com/api/dms/domain-manage/v1/app/domain/verify-file', 'downloadHTTPStatus': 200}, + 'publicReadbacks': [{'httpStatus': 200, 'bytes': 32, 'sha256': 'a'*64, 'matchesDownloadedFile': True}], + 'steps': [{'family': 'domains', 'endpoint': 'domain-api-precheck', 'status': 'passed', 'exitCode': 0, 'httpStatus': 200, 'businessCode': 0}]} + self.assertEqual(module.collect(baseline, [('domain', ledger)])['verifiedOriginalLifecycles'], 1) + for section, key, value in [('verificationFile', 'sha256', 'b'*64), ('verificationFile', 'fileName', 'other.txt'), ('verificationFile', 'downloadHTTPStatus', 403)]: + broken=copy.deepcopy(ledger);broken[section][key]=value + self.assertEqual(module.collect(baseline, [('domain', broken)])['verifiedOriginalLifecycles'], 0) + for key,value in [('cleanupVerified',False), ('status','incomplete')]: + broken=copy.deepcopy(ledger);broken[key]=value + self.assertEqual(module.collect(baseline, [('domain', broken)])['verifiedOriginalLifecycles'], 0) + broken=copy.deepcopy(ledger);broken['steps'][0]['businessCode']=203489282 + self.assertEqual(module.collect(baseline, [('domain', broken)])['verifiedOriginalLifecycles'], 0) + for key, value in [('sha256', 'b'*64), ('bytes', 31), ('httpStatus', 403), ('matchesDownloadedFile', False)]: + broken = copy.deepcopy(ledger) + broken['publicReadbacks'][0][key] = value + self.assertEqual(module.collect(baseline, [('domain', broken)])['verifiedOriginalLifecycles'], 0) + for section, key, value in [('owned', 'hostname', 'unowned.example.test'), ('owned', 'workerName', ''), ('verificationFile', 'sourceURL', 'https://unowned.example.test/file')]: + broken = copy.deepcopy(ledger) + broken[section][key] = value + self.assertEqual(module.collect(baseline, [('domain', broken)])['verifiedOriginalLifecycles'], 0) + broken = copy.deepcopy(ledger) + broken['publicReadbacks'] = [] + self.assertEqual(module.collect(baseline, [('domain', broken)])['verifiedOriginalLifecycles'], 0) + + def test_multipart_counts_only_parts_with_independent_receipts(self): + baseline = {"originalBlocked": [{"family": "upload", "endpoint": e} for e in ("obbfile-init", "obbfile-uploadurl", "obbfile-upload", "obbfile-compose")]} + # Offline assertions use a dedicated fixture, not mutable live evidence. + ledger = { + 'flow': 'multipart-upload', 'status': 'verified-part-upload-and-compose', + 'owned': {'objectId': 'offline-object', 'nspUploadId': 'offline-session'}, + 'sourceArtifact': {'bytes': 12, 'sha256': 'a'*64}, + 'steps': [ + {'endpoint': 'obbfile-init', 'status': 'passed', 'httpStatus': 200, 'businessCode': 0}, + {'endpoint': 'obbfile-uploadurl', 'status': 'passed', 'httpStatus': 200, 'businessCode': 0}, + {'endpoint': 'obbfile-upload', 'status': 'passed', 'partCount': 2}], + 'partReceipts': { + 'part1': {'httpStatus': 200, 'bytes': 6, 'sha256': 'b'*64, 'expectedMD5': 'c'*32, 'etag': 'c'*32}, + 'part2': {'httpStatus': 200, 'bytes': 6, 'sha256': 'd'*64, 'expectedMD5': 'e'*32, 'etag': 'e'*32}}} + self.assertEqual(module.collect(baseline, [('multipart', ledger)])['verifiedOriginalLifecycles'], 3) + broken = copy.deepcopy(ledger) + next(iter(broken['partReceipts'].values()))['expectedMD5'] = '0'*32 + self.assertEqual(module.collect(baseline, [('multipart', broken)])['verifiedOriginalLifecycles'], 0) + + def test_compile_query_requires_owned_package_and_independent_state(self): + baseline = {"originalBlocked": [{"family": "publishing", "endpoint": "query-aabfile"}]} + source = {"runId": "source", "appId": "dedicated", "owned": {"pkgId": "mine"}, "steps": [{"family": "publishing", "endpoint": "package-compile-status-v3", "status": "passed", "packageId": "mine", "parseState": 2}]} + read = {"flow": "legacy-compile-readback", "status": "verified-read", "exitCode": 0, "httpStatus": 200, "businessCode": 0, "appId": "dedicated", "packageId": "mine", "sourcePackageEvidence": "source", "expectedParseState": 2, "packageStates": [{"pkgId": "mine", "successStatus": 2}]} + report = module.collect(baseline, [("source-file", source), ("read-file", read)]) + self.assertEqual(report["verifiedOriginalLifecycles"], 1) + read["packageStates"][0]["pkgId"] = "unowned" + self.assertEqual(module.collect(baseline, [("source-file", source), ("read-file", read)])["verifiedOriginalLifecycles"], 0) + + def test_retained_group_requires_ownership_and_subsequent_readback(self): + baseline = {"originalBlocked": [{"family": "pms", "endpoint": "addproductgroup-harmonyosnext"}]} + ledger = {"flow": "pms-group-create", "status": "verified-retained", "owned": {"groupId": "mine"}, "steps": [ + {"endpoint": "addproductgroup-harmonyosnext", "status": "passed", "businessCode": 0}, + {"endpoint": "getproductgroup-harmonyosnext", "status": "passed", "assertion": "dedicated empty subscription group read back"}]} + report = module.collect(baseline, [("group", ledger)]) + self.assertEqual(report["verifiedOriginalLifecycles"], 1) + self.assertFalse(report["completed"][0]["cleanupVerified"]) + ledger["steps"].reverse() + self.assertEqual(module.collect(baseline, [("group", ledger)])["verifiedOriginalLifecycles"], 0) + + def test_upload_needs_address_and_content_assertion_and_reports_retention(self): + baseline = {"originalBlocked": [{"family": "upload", "endpoint": "upload-file-new"}]} + ledger = {"flow": "signed-file-upload", "status": "verified-upload", "objectId": "test-object", "sha256": "fixture", "contentLength": 68, "retention": "retained", "steps": [ + {"endpoint": "upload-url-new", "status": "passed", "businessCode": 0}, + {"endpoint": "upload-file-new", "status": "passed", "httpStatus": 200, "etag": "md5", "assertion": "server ETag matches uploaded fixture MD5"}]} + report = module.collect(baseline, [("upload", ledger)]) + self.assertEqual(report["verifiedOriginalLifecycles"], 1) + self.assertFalse(report["completed"][0]["cleanupVerified"]) + ledger["steps"][1]["assertion"] = None + self.assertEqual(module.collect(baseline, [("upload", ledger)])["verifiedOriginalLifecycles"], 0) + + def test_helpers_duplicates_and_self_reported_success_do_not_inflate_progress(self): + baseline = {"originalBlocked": [{"family": "publishing", "endpoint": "language-info-delete"}]} + ledger = {"cleanupVerified": True, "verifiedFeatures": {"fake": {}}, "steps": [ + {"family": "publishing", "endpoint": "language-info-delete", "status": "passed"}, + {"family": "publishing", "endpoint": "app-info-query-v3", "status": "passed", "assertion": "temporary language absent after deletion"}]} + report = module.collect(baseline, [("a", ledger), ("b", ledger)]) + self.assertEqual(report["verifiedOriginalLifecycles"], 1) + self.assertEqual(report["remainingOriginal"], 0) + ledger["cleanupVerified"] = False + self.assertEqual(module.collect(baseline, [("c", ledger)])["verifiedOriginalLifecycles"], 0) + + +if __name__ == "__main__": + unittest.main() diff --git a/scripts/test_live_lifecycle.py b/scripts/test_live_lifecycle.py index 2bb28d7..4b8c74e 100644 --- a/scripts/test_live_lifecycle.py +++ b/scripts/test_live_lifecycle.py @@ -1,6 +1,9 @@ import importlib.util import pathlib import unittest +import tempfile +import types +from unittest.mock import patch spec = importlib.util.spec_from_file_location("live_lifecycle", pathlib.Path(__file__).with_name("live-lifecycle.py")) module = importlib.util.module_from_spec(spec) @@ -8,6 +11,51 @@ class LifecycleTests(unittest.TestCase): + def test_json_string_ret_preserves_code_without_embedded_private_data(self): + evidence = module.safe_evidence({"ret": '{"code":123,"msg":"PRIVATE account"}'}) + self.assertEqual(evidence["businessCode"], 123) + self.assertNotIn("PRIVATE", str(evidence)) + self.assertIsNone(module.safe_evidence({"ret": "invalid JSON"})["businessCode"]) + + def test_failure_records_code_origin_without_raw_response(self): + with tempfile.TemporaryDirectory() as tmp: + args = types.SimpleNamespace(binary=pathlib.Path("offline-cli"), profile="default", app_id="dedicated", output_dir=pathlib.Path(tmp)) + flow = module.Flow(args, "error-proof", "offline") + response = types.SimpleNamespace(returncode=1, stderr="agc endpoint returned HTTP 200 (2): denied", stdout='{"error":{"code":"2","codeField":"businessCode","resultCodes":{"rtnCode":"0","businessCode":"2"},"rawBody":{"invitationCode":"SECRET"}}}') + with patch.object(module.subprocess, "run", return_value=response): + with self.assertRaises(RuntimeError): flow.call("testing", "test-api-create-open-test-link") + step = flow.ledger["steps"][0] + self.assertEqual(step["codeField"], "businessCode") + self.assertEqual(step["resultCodes"], {"rtnCode": "0", "businessCode": "2"}) + self.assertNotIn("SECRET", flow.output.read_text()) + + def test_json_only_failure_preserves_http_status_without_private_message(self): + with tempfile.TemporaryDirectory() as tmp: + args = types.SimpleNamespace(binary=pathlib.Path("offline-cli"), profile="default", app_id="dedicated", output_dir=pathlib.Path(tmp)) + flow = module.Flow(args, "json-error-proof", "offline") + response = types.SimpleNamespace(returncode=1, stderr="", stdout='{"error":{"code":"991","message":"agc endpoint returned HTTP 408 (991): PRIVATE", "codeField":"rtnCode","resultCodes":{"rtnCode":"991"}}}') + with patch.object(module.subprocess, "run", return_value=response): + with self.assertRaises(RuntimeError): flow.call("domains", "domain-api-precheck") + step = flow.ledger["steps"][0] + self.assertEqual(step.get("httpStatus"), 408) + self.assertEqual(step["status"], "http-error") + self.assertEqual(step["businessCode"], "991") + self.assertNotIn("PRIVATE", flow.output.read_text()) + + def test_step_can_select_and_record_separate_compile_profile(self): + with tempfile.TemporaryDirectory() as tmp: + args = types.SimpleNamespace(binary=pathlib.Path("offline-cli"), profile="default", app_id="dedicated", output_dir=pathlib.Path(tmp)) + flow = module.Flow(args, "profile-proof", "offline") + response = types.SimpleNamespace(returncode=0, stderr="", stdout='{"data":{"dryRun":false,"statusCode":200,"body":{"ret":{"code":0}}}}') + with patch.object(module.subprocess, "run", return_value=response) as run: + flow.call("publishing", "query-aabfile", query={"appId": "dedicated", "pkgIds": "owned-package"}, profile="api-client") + self.assertEqual(run.call_args.args[0][2], "api-client") + self.assertEqual(flow.ledger["steps"][0]["profile"], "api-client") + self.assertEqual(args.profile, "default") + + def test_pms_success_uses_nested_error_result(self): + self.assertEqual(module.safe_evidence({"error": {"errorCode": 0}, "result": "owned-group-id"})["businessCode"], 0) + def test_cleanup_refuses_resources_not_created_by_run(self): ledger = {"owned": {"groupId": "mine"}} self.assertTrue(module.is_owned(ledger, "groupId", "mine")) diff --git a/scripts/test_live_multipart.py b/scripts/test_live_multipart.py new file mode 100644 index 0000000..3e938df --- /dev/null +++ b/scripts/test_live_multipart.py @@ -0,0 +1,47 @@ +import importlib.util +import pathlib +import json +import hashlib +import subprocess +import tempfile +import unittest +from unittest.mock import patch + +spec = importlib.util.spec_from_file_location('multipart', pathlib.Path(__file__).with_name('live-multipart.py')) +m = importlib.util.module_from_spec(spec) +spec.loader.exec_module(m) + + +class UploadTests(unittest.TestCase): + def invoke(self, data, exit_code=0): + with tempfile.TemporaryDirectory() as work: + path = pathlib.Path(work)/'part' + path.write_bytes(b'owned-part-content') + result = subprocess.CompletedProcess([], exit_code, json.dumps({'data': data}), 'signed-secret') + with patch.object(m.subprocess, 'run', return_value=result): + return m.upload_part(pathlib.Path('/fixture/agc'), 'explicit-profile', {'method': 'PUT', 'url': 'https://example.com/signed-secret', 'headers': {'Authorization': 'signed-secret'}}, path) + + def test_incomplete_address_map_rejected_before_any_part_upload(self): + valid = {'method': 'PUT', 'url': 'https://example.com/signed-secret', 'partObjectId': 'owned-part', 'headers': {}} + m.validate_addresses({'additionalProp1': valid}, {'additionalProp1'}) + for invalid in [dict(valid, partObjectId=''), dict(valid, method='GET'), dict(valid, url='http://example.com'), dict(valid, headers=[]), None]: + with self.assertRaises(RuntimeError) as caught: + m.validate_addresses({'additionalProp1': invalid}, {'additionalProp1'}) + self.assertNotIn('signed-secret', str(caught.exception)) + with self.assertRaises(RuntimeError): + m.validate_addresses({'additionalProp2': valid}, {'additionalProp1'}) + + def test_exact_part_bytes(self): + receipt = self.invoke({'dryRun': False, 'statusCode': 200, 'etag': '"'+hashlib.md5(b'owned-part-content').hexdigest()+'"'}) + self.assertEqual(receipt['sha256'], hashlib.sha256(b'owned-part-content').hexdigest()) + + def test_false_success_rejected(self): + for data in [{'dryRun': True, 'statusCode': 200, 'etag': 'wrong'}, {'dryRun': False, 'statusCode': 200, 'etag': 'wrong'}, {'dryRun': False, 'statusCode': 403, 'etag': hashlib.md5(b'owned-part-content').hexdigest()}]: + with self.assertRaises(RuntimeError): self.invoke(data) + + def test_failure_does_not_leak_signed_credentials(self): + with self.assertRaises(RuntimeError) as caught: self.invoke({}, 1) + self.assertNotIn('signed-secret', str(caught.exception)) + + +if __name__ == '__main__': unittest.main() diff --git a/scripts/test_live_package.py b/scripts/test_live_package.py new file mode 100644 index 0000000..5c91057 --- /dev/null +++ b/scripts/test_live_package.py @@ -0,0 +1,80 @@ +import importlib.util +import pathlib +import unittest +import tempfile +import hashlib +import io +import zipfile +import json +from unittest.mock import patch +from subprocess import CompletedProcess + +spec = importlib.util.spec_from_file_location("package_flow", pathlib.Path(__file__).with_name("live-package.py")) +module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(module) + + +class PackageStateTests(unittest.TestCase): + def test_inner_hap_identity_cannot_hide_behind_outer_pack_info(self): + with tempfile.TemporaryDirectory() as work: + app = pathlib.Path(work) / 'fixture.app' + for inner_bundle in ['dedicated.bundle', 'other.bundle']: + hap = io.BytesIO() + with zipfile.ZipFile(hap, 'w') as z: + z.writestr('module.json', json.dumps({'app': {'bundleName': inner_bundle, 'debug': False}, 'module': {'name': 'entry'}})) + with zipfile.ZipFile(app, 'w') as z: + z.writestr('pack.info', json.dumps({'summary': {'app': {'bundleName': 'dedicated.bundle'}}})) + z.writestr('entry.hap', hap.getvalue()) + if inner_bundle == 'dedicated.bundle': + report = module.inspect_app_modules(app, 'dedicated.bundle') + self.assertEqual(report[0]['debug'], False) + else: + with self.assertRaises(RuntimeError): module.inspect_app_modules(app, 'dedicated.bundle') + + def test_retention_copies_only_app_and_preserves_exact_bytes(self): + with tempfile.TemporaryDirectory() as work: + directory = pathlib.Path(work) + source = directory / "signed.app" + source.write_bytes(b"signed-fixture") + (directory / "private.p12").write_bytes(b"private-key") + report = module.retain_signed_artifact(source, directory / "artifacts") + self.assertEqual(report["sha256"], hashlib.sha256(b"signed-fixture").hexdigest()) + self.assertEqual(list((directory / "artifacts").iterdir()), [directory / "artifacts/signed.app"]) + self.assertEqual((directory / "artifacts/signed.app").stat().st_mode & 0o777, 0o600) + with self.assertRaises(RuntimeError): + module.retain_signed_artifact(directory / "private.p12", directory / "artifacts") + with self.assertRaises(FileExistsError): + module.retain_signed_artifact(source, directory / "artifacts") + + def test_sdk_zero_exit_with_error_is_not_success(self): + # 实测 SDK 统计工具在参数错误时退出 0,故必须检查错误标记。 + output = 'Ohos BundleTool [Error]: code:9132105 error:private-keystore-password' + with patch.object(module.subprocess, 'run', return_value=CompletedProcess([], 0, '', output)): + with self.assertRaises(RuntimeError) as caught: + module.run_sdk([], 'Package verification') + self.assertIn('9132105', str(caught.exception)) + self.assertNotIn('private-keystore-password', str(caught.exception)) + + def test_sdk_nonzero_error_is_sanitized(self): + with patch.object(module.subprocess, 'run', return_value=CompletedProcess([], 1, 'ERROR: 11011005 secret', '')): + with self.assertRaisesRegex(RuntimeError, 'SDK code 11011005') as caught: + module.run_sdk([], 'Signing') + self.assertNotIn('secret', str(caught.exception)) + + def test_sdk_success_message_is_accepted(self): + with patch.object(module.subprocess, 'run', return_value=CompletedProcess([], 0, 'Verification succeeded', '')): + module.run_sdk([], 'Signing') + + def test_state_is_for_exact_owned_package(self): + self.assertEqual(module.package_state({"pkgStateList": [{"pkgId": "mine", "successStatus": 1}]}, "mine"), 1) + with self.assertRaises(RuntimeError): + module.package_state({"pkgStateList": [{"pkgId": "other", "successStatus": 0}]}, "mine") + + def test_boolean_and_duplicate_states_are_not_success(self): + for states in [[{"pkgId": "mine", "successStatus": False}], [{"pkgId": "mine", "successStatus": 0}, {"pkgId": "mine", "successStatus": 2}]]: + with self.assertRaises(RuntimeError): + module.package_state({"pkgStateList": states}, "mine") + + +if __name__ == "__main__": + unittest.main() diff --git a/scripts/test_publishing_audit.py b/scripts/test_publishing_audit.py new file mode 100644 index 0000000..2f669ac --- /dev/null +++ b/scripts/test_publishing_audit.py @@ -0,0 +1,51 @@ +"""Independent regressions for documented table/example conflicts.""" +import importlib.util +import unittest +from pathlib import Path + +spec = importlib.util.spec_from_file_location('audit', Path(__file__).with_name('audit-publishing-contracts.py')) +audit = importlib.util.module_from_spec(spec) +spec.loader.exec_module(audit) + + +class AuditTests(unittest.TestCase): + def test_shared_transport_keeps_agreement_document_identity(self): + ref = {'checkedAt': 'fixture', 'endpoints': [{ + 'name': '查询隐私政策协议列表', 'method': 'POST', + 'path': '/api/publish/v2/agreement/list', 'sourceUrl': 'https://official/privacy', + 'parameters': [], + }]} + local = [ + {'id': 'user-agreement-list', 'method': 'POST', 'path': '/api/publish/v2/agreement/list', 'sourceUrl': 'https://official/user'}, + {'id': 'privacy-agreement-list', 'method': 'POST', 'path': '/api/publish/v2/agreement/list', 'sourceUrl': 'https://official/privacy'}, + ] + self.assertEqual(audit.audit(ref, local)['endpoints'][0]['command'], 'privacy-agreement-list') + + def check(self, endpoint, parameter, actual): + ref = {'checkedAt': 'fixture', 'endpoints': [{'name': endpoint, 'method': 'POST', 'path': '/fixture', 'parameters': [parameter]}]} + local = [{'id': 'fixture', 'method': 'POST', 'path': '/fixture', 'parameters': [actual]}] + return audit.audit(ref, local)['endpoints'][0] + + def test_identity_alternative(self): + p = {'in': 'header', 'name': 'appId', 'required': True, 'type': 'String(32)'} + result = self.check('查询应用所有版本类型的版本列表', p, {**p, 'required': False, 'type': 'string'}) + self.assertEqual(result['parameterIssues'], []) + self.assertTrue(result['reviewedExceptions']) + + def test_agreement_example_array(self): + p = {'in': 'body', 'name': 'agreementInfos', 'required': False, 'type': 'AgreementInfo'} + result = self.check('新建用户协议', p, {**p, 'type': 'array'}) + self.assertEqual(result['parameterIssues'], []) + self.assertTrue(result['reviewedExceptions']) + # A table-shaped object must still be reported as wrong. + bad = self.check('新建用户协议', p, {**p, 'type': 'object'}) + self.assertTrue(bad['parameterIssues']) + + def test_no_blanket_requiredness_exemption(self): + p = {'in': 'header', 'name': 'appId', 'required': True, 'type': 'String(32)'} + result = self.check('新建用户协议', p, {**p, 'required': False, 'type': 'string'}) + self.assertTrue(result['parameterIssues']) + + +if __name__ == '__main__': + unittest.main() diff --git a/scripts/test_publishing_models.py b/scripts/test_publishing_models.py new file mode 100644 index 0000000..71b7cd9 --- /dev/null +++ b/scripts/test_publishing_models.py @@ -0,0 +1,37 @@ +import importlib.util +from pathlib import Path +import unittest + +spec = importlib.util.spec_from_file_location('models', Path(__file__).with_name('audit-publishing-models.py')) +models = importlib.util.module_from_spec(spec) +spec.loader.exec_module(models) + + +class ModelAuditTests(unittest.TestCase): + def test_missing_nested_required_field_is_detected(self): + doc = {'sourceUrl': 'https://official/model', 'tables': [{'rows': [['tagId', 'M', 'String(64)', '标签ID']]}]} + result = models.audit_model(doc, [], 'body.tagQualInfos[]', {}, 'qualification-review-create') + self.assertEqual(result[0]['field'], 'body.tagQualInfos[].tagId') + self.assertEqual(result[0]['code'], 'missing_field') + + def test_shared_name_resolves_exact_source_link(self): + doc = {'sourceUrl': 'https://official/user-info', 'tables': [{'rows': [['baseInfo', 'O', 'AgreementBaseInfo', '基础信息']]}], 'links': [ + {'title': 'AgreementBaseInfo', 'sourceUrl': 'https://official/user-base'}, + {'title': 'AgreementBaseInfo(隐私政策协议)', 'sourceUrl': 'https://official/privacy-base'}]} + base = {'sourceUrl': 'https://official/user-base', 'tables': [{'rows': [['name', 'M', 'String(100)', '协议名称']]}]} + fields = [{'name': 'baseInfo', 'type': 'object', 'properties': [{'name': 'name', 'type': 'string', 'required': True, 'maxLength': 100}]}] + self.assertEqual(models.audit_model(doc, fields, 'body.agreementInfos[]', {'https://official/user-base': base}, 'user-agreement-create'), []) + + def test_integer_width_is_not_a_bound(self): + doc = {'sourceUrl': 'https://official/model', 'tables': [{'rows': [['size', 'M', 'Integer(64)', '大小']]}]} + self.assertEqual(models.audit_model(doc, [{'name': 'size', 'required': True, 'type': 'integer'}], 'body.file', {}, 'fixture'), []) + + def test_optional_permissions_array_retains_explicit_interval(self): + doc = {'sourceUrl': 'https://official/model', 'tables': [{'rows': [['permissions', 'O', 'List', '数组长度为1~200。']]}]} + fields = [{'name': 'permissions', 'type': 'array', 'itemsType': 'string', 'itemsMaxLength': 100, 'maxItems': 200}] + issues = models.audit_model(doc, fields, 'body.permissions[]', {}, 'fixture') + self.assertEqual([item['code'] for item in issues], ['minItems']) + + +if __name__ == '__main__': + unittest.main() diff --git a/scripts/test_serverless_verification_report.py b/scripts/test_serverless_verification_report.py new file mode 100644 index 0000000..4c0ca84 --- /dev/null +++ b/scripts/test_serverless_verification_report.py @@ -0,0 +1,13 @@ +import importlib.util,pathlib,unittest +p=pathlib.Path(__file__).with_name('serverless-verification-report.py');s=importlib.util.spec_from_file_location('slreport',p);m=importlib.util.module_from_spec(s);s.loader.exec_module(m) +class EvidenceTests(unittest.TestCase): + def test_self_reported_success_cannot_replace_real_pass_events(self): + endpoints=[{'familyId':'storage','id':'list-files','sourceUrl':'https://official'}] + r=m.matrix(endpoints,[{'Action':'output','Test':'TestEveryEndpointHTTPTransport/storage/list-files','Output':'passed'}]);self.assertFalse(r['offlineComplete']);self.assertEqual(r['liveVerified'],0) + def test_every_adapter_and_whole_package_pass_is_required(self): + endpoints=[{'familyId':'storage','id':'list-files','sourceUrl':'https://official'}] + events=[{'Action':'pass','Test':x+'/storage/list-files'} for x in ('TestEveryEndpointHTTPTransport','TestEveryServerlessOperationREST','TestEveryRegisteredEndpointCanDryRun')] + self.assertFalse(m.matrix(endpoints,events)['offlineComplete']) + events +=[{'Action':'pass','Package':'github.com/Createitv/agc-cli/'+p} for p in ('cmd/agc/command','pkg/server')] + r=m.matrix(endpoints,events);self.assertTrue(r['offlineComplete']);self.assertEqual(r['operations'][0]['live']['status'],'not-run') +if __name__=='__main__':unittest.main() diff --git a/scripts/verify-landlady-official-publishing-read.py b/scripts/verify-landlady-official-publishing-read.py new file mode 100644 index 0000000..911c5ea --- /dev/null +++ b/scripts/verify-landlady-official-publishing-read.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python3 +"""Read current official Publishing endpoints, independent of CLI registration. +Requires explicit profile. Uses fixed Landlady identity. Never invokes mutations. +""" +import argparse +import datetime +import json +from pathlib import Path +import subprocess +import urllib.error +import urllib.parse +import urllib.request + +ROOT = Path(__file__).resolve().parents[1] +APP = '6917618355927751054' +PACKAGE = 'app.landlady.www.landlady' +READ_NAMES = {'查询应用包名对应的appid', '查询团队账号下的成员角色列表', '查询应用信息', + '查询应用软件包信息', '查询软件包编译状态', '查询应用所有版本类型的版本列表', + '查询应用未处理的问题工单', '查询需要上传的资质文件信息', '查询资质审核任务详情', + '查询用户协议列表', '查询隐私政策协议列表'} + + +def collect(value, names): + found = [] + if isinstance(value, dict): + for key, item in value.items(): + if key in names and isinstance(item, (str, int)): found.append(str(item)) + elif isinstance(item, (dict, list)): found.extend(collect(item, names)) + elif isinstance(value, list): + for item in value: found.extend(collect(item, names)) + return list(dict.fromkeys(found)) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--profile', required=True) + parser.add_argument('--report', type=Path, required=True) + args = parser.parse_args() + auth = subprocess.run(['go', 'run', './cmd/agc', '--profile', args.profile, 'auth', 'token'], + cwd=ROOT, capture_output=True, text=True) + if auth.returncode: raise SystemExit('Token generation failed; raw authorization output suppressed') + token = json.loads(auth.stdout)['data']['access_token'] + refs = json.loads((ROOT/'docs/verification/publishing-browser-reference-20261007.json').read_text())['endpoints'] + refs = {e['name']: e for e in refs if e['name'] in READ_NAMES} + report = {'checkedAt': datetime.datetime.now(datetime.timezone.utc).isoformat(), + 'profile': args.profile, 'appId': APP, 'packageName': PACKAGE, + 'scope': 'Direct official HTTP read checks; success DOES NOT establish CLI support', 'results': []} + + def call(name, query=None, body=None): + ref = refs[name] + assert name in READ_NAMES and ref['method'] in ('GET', 'POST') + query = query or {} + url = 'https://connect-api.cloud.huawei.com'+ref['path'] + if query: url += '?'+urllib.parse.urlencode(query) + headers = {'Authorization': 'Bearer '+token, 'appId': APP} + data = None + if body is not None: headers['Content-Type']='application/json'; data=json.dumps(body).encode() + entry = {'name': name, 'method': ref['method'], 'path': ref['path'], 'query': query, 'body': body} + decoded = {} + try: + request = urllib.request.Request(url, data=data, headers=headers, method=ref['method']) + try: + with urllib.request.urlopen(request, timeout=25) as response: + status=response.status; raw=response.read() + except urllib.error.HTTPError as error: status=error.code; raw=error.read() + try: decoded=json.loads(raw) + except (ValueError, UnicodeError): decoded={} + ret=decoded.get('ret',{}) if isinstance(decoded,dict) else {} + code=ret.get('code',decoded.get('rtnCode',decoded.get('code'))) if isinstance(decoded,dict) else None + entry.update(httpStatus=status,businessCode=code, + status='passed' if status<400 and str(code)=='0' else 'failed', + responseKeys=list(decoded) if isinstance(decoded,dict) else []) + if name=='查询应用信息':entry['appNames']=collect(decoded,{'appName'}) + if name=='查询应用包名对应的appid': entry['expectedAppIdPresent']=APP in str(decoded.get('appids',[])) + except Exception as error:entry.update(status='transport-error',errorType=type(error).__name__) + report['results'].append(entry) + print(name,entry['status'],entry.get('httpStatus'),entry.get('businessCode'),flush=True) + return decoded + + info=call('查询应用信息',{'appId':APP}) + call('查询应用包名对应的appid',{'packageName':PACKAGE}) + versions=call('查询应用所有版本类型的版本列表',body={'packageName':PACKAGE}) + call('查询团队账号下的成员角色列表',{'fromPage':1,'pageSize':10,'languageCode':'zh_cn'}) + tags=call('查询需要上传的资质文件信息') + call('查询应用未处理的问题工单',body={'pageNo':1,'pageSize':10}) + call('查询用户协议列表',body={'name':'','type':2,'fromRecCount':0,'maxReqCount':10}) + call('查询隐私政策协议列表',body={'name':'','type':1,'fromRecCount':0,'maxReqCount':10}) + packages=collect(versions,{'pkgId','packageId'})+collect(info,{'pkgId','packageId'}) + if packages: + call('查询应用软件包信息',{'packageId':packages[0]}) + call('查询软件包编译状态',{'appId':APP,'pkgIds':','.join(packages[:5])}) + else: + for name in ('查询应用软件包信息','查询软件包编译状态'): + report['results'].append({'name':name,'status':'blocked','reason':'Version response supplied no real package ID; no invented fixture sent'}) + tagids=collect(tags,{'tagId'}) + if tagids:call('查询资质审核任务详情',{'tagIds':','.join(tagids[:3])}) + else:report['results'].append({'name':'查询资质审核任务详情','status':'blocked','reason':'No real qualification tag ID obtained'}) + args.report.write_text(json.dumps(report,ensure_ascii=False,indent=2)+'\n') + + +if __name__=='__main__':main() diff --git a/scripts/verify-landlady-publishing-read.py b/scripts/verify-landlady-publishing-read.py new file mode 100644 index 0000000..b8cef9b --- /dev/null +++ b/scripts/verify-landlady-publishing-read.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +"""Read-only live Publishing checks for the explicitly selected Landlady app. +No tokens, credential responses or full business response bodies are persisted. +""" +import argparse +import datetime +import json +import re +from pathlib import Path +import subprocess +import tempfile + +ROOT = Path(__file__).resolve().parents[1] +APP = '6917618355927751054' +PACKAGE = 'app.landlady.www.landlady' +CASES = [ + ('app-info-query-v3', ['--query', 'appId='+APP]), + ('appid-list', ['--query', 'packageName='+PACKAGE]), + ('app-version-list', ['--header', 'appId='+APP, '--field', 'packageName='+PACKAGE]), + ('obbfile-package-list', ['--query', 'appId='+APP]), + ('app-info-query', ['--query', 'appId='+APP]), +] + + +def business_code(body): + if not isinstance(body, dict): return None + ret = body.get('ret') + if isinstance(ret, dict) and 'code' in ret: return ret['code'] + for key in ('rtnCode', 'code'): + if key in body: return body[key] + return None + + +def identities(value): + out = [] + if isinstance(value, dict): + for key, item in value.items(): + if key in ('appId', 'appid', 'packageName', 'appName') and isinstance(item, (str, int)): + out.append({key: item}) + elif isinstance(item, (dict, list)): out.extend(identities(item)) + elif isinstance(value, list): + for item in value: out.extend(identities(item)) + return out + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--profile', required=True) + parser.add_argument('--report', type=Path, required=True) + args = parser.parse_args() + report = {'checkedAt': datetime.datetime.now(datetime.timezone.utc).isoformat(), + 'profile': args.profile, 'appId': APP, 'packageName': PACKAGE, + 'scope': 'Registered read-only CLI operations; no production mutations', 'results': []} + with tempfile.TemporaryDirectory(prefix='agc-publishing-read-') as work: + binary = str(Path(work) / 'agc') + subprocess.run(['go', 'build', '-o', binary, './cmd/agc'], cwd=ROOT, check=True) + for endpoint, fields in CASES: + result = subprocess.run([binary, '--profile', args.profile, '--timeout', '25s', + 'publishing', endpoint, '--invoke', '--dry-run=false', *fields], + cwd=ROOT, text=True, capture_output=True, timeout=40) + entry = {'endpoint': endpoint, 'exitCode': result.returncode} + try: + envelope = json.loads(result.stdout) + data = envelope.get('data', {}) + body = data.get('body', {}) + if isinstance(body, str): body = json.loads(body) + code = business_code(body) + entry.update(httpStatus=data.get('statusCode'), businessCode=code, + status='passed' if result.returncode == 0 and str(code) == '0' else 'failed', + responseKeys=list(body) if isinstance(body, dict) else [], + applicationIdentity=identities(body)) + if isinstance(body, dict) and 'appids' in body: + entry['expectedAppIdPresent'] = APP in str(body['appids']) + for key in ('versionList', 'packageList', 'packages', 'appIdList'): + if isinstance(body, dict) and isinstance(body.get(key), list): entry[key+'Count'] = len(body[key]) + except (ValueError, TypeError): + entry['status'] = 'failed' + match = re.search(r'HTTP (\d+)(?: \(([^)]+)\))?', result.stderr) + if match: + entry['httpStatus'] = int(match[1]) + entry['businessCode'] = match[2] + # CLI diagnostics can include upstream payloads; do not persist them. + entry['diagnostic'] = 'CLI failed without a parseable success envelope; raw output suppressed' + report['results'].append(entry) + print(endpoint, entry['status'], entry.get('httpStatus'), entry.get('businessCode'), flush=True) + args.report.write_text(json.dumps(report, ensure_ascii=False, indent=2)+'\n') + + +if __name__ == '__main__': + main() diff --git "a/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/01-\345\260\201\351\235\242.png" "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/01-\345\260\201\351\235\242.png" new file mode 100644 index 0000000..1286349 Binary files /dev/null and "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/01-\345\260\201\351\235\242.png" differ diff --git "a/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/02-\345\272\224\347\224\250\350\265\204\346\226\231\347\256\241\347\220\206.png" "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/02-\345\272\224\347\224\250\350\265\204\346\226\231\347\256\241\347\220\206.png" new file mode 100644 index 0000000..6a5b89b Binary files /dev/null and "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/02-\345\272\224\347\224\250\350\265\204\346\226\231\347\256\241\347\220\206.png" differ diff --git "a/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/03-\345\217\221\350\241\214\345\214\205\344\270\212\344\274\240\344\270\216\347\212\266\346\200\201.png" "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/03-\345\217\221\350\241\214\345\214\205\344\270\212\344\274\240\344\270\216\347\212\266\346\200\201.png" new file mode 100644 index 0000000..d778078 Binary files /dev/null and "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/03-\345\217\221\350\241\214\345\214\205\344\270\212\344\274\240\344\270\216\347\212\266\346\200\201.png" differ diff --git "a/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/README.md" "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/README.md" new file mode 100644 index 0000000..c6a202a --- /dev/null +++ "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/README.md" @@ -0,0 +1,5 @@ +# agc-cli 小红书宣传素材 + +发布时按 01、02、03 上传三张图片。`文案.md` 包含标题、正文、话题与内容依据;`正文.txt` 可直接复制。所有图片沿用黑灰、红色、青绿视觉,采用不同布局。原始参考图保留在 `docs/community/assets/agc-cli-cover.png`。 + +尚未发布。 diff --git "a/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\346\226\207\346\241\210.md" "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\346\226\207\346\241\210.md" new file mode 100644 index 0000000..7e07798 --- /dev/null +++ "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\346\226\207\346\241\210.md" @@ -0,0 +1,51 @@ +# 小红书发布文案 + +## 推荐标题 + +给鸿蒙 App 上架,我做了个开源工具 + +## 备选标题 + +- 鸿蒙应用管理,也能交给 AI 助手 +- 我的鸿蒙 App 上传实战:开源 agc-cli + +## 正文 + +我在把自己的租房记账 App 移植到鸿蒙。写完界面后发现,签名、截图、应用资料、软件包上传,还有一堆重复操作要处理。 + +于是我做了一个开源工具:agc-cli,把华为 AppGallery Connect 的操作搬进终端,也方便交给 AI 编程助手执行。 + +它可以用来做什么? + +① 管理应用资料 +更新应用介绍、简介和版本说明,上传图标截图,管理不同语言的文案;维护多个应用时,还可以通过 profile 指定凭据。 + +② 上传发行包并查询结果 +获取上传地址、上传 APP 文件、关联应用版本,再查询华为的解析与合法性结果。命令可以保存下来,接入脚本、CI 或 AI 助手。 + +今天用自己的 App 实际跑了一遍,还踩了一个坑:文件上传成功,软件包却没通过合法性检测。补齐外层 APP 签名后,重新上传和查询,才确认软件包可用。 + +所以工具里我特别看重一件事:每一步执行完,都要能核对结果。上传、解析、审核、上架,是不同阶段。 + +项目已经开源。GitHub 搜索 Createitv/agc-cli,官网是 agccli.app。 + +如果你也在做鸿蒙应用,最想自动化的是哪一步? + +## 话题 + +#鸿蒙开发 #独立开发者 #开源项目 #AI编程 #程序员 + +## 图片顺序 + +1. `01-封面.png`:品牌与主题,3:4 竖版。 +2. `02-应用资料管理.png`:四宫格功能卡片。 +3. `03-发行包上传与状态.png`:纵向三步流程。 + +## 项目链接 + +- GitHub:https://github.com/Createitv/agc-cli +- 官网:https://agccli.app/ + +## 事实依据与使用说明 + +功能依据当前项目 `docs/CLI_USAGE.md`;签名与合法性故事依据本次包租婆实际上传记录。图片为概念说明图,未伪造真实操作界面。未承诺自动完成全部合规资料或审核通过。仅准备素材,尚未发布到小红书。 diff --git "a/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\346\255\243\346\226\207.txt" "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\346\255\243\346\226\207.txt" new file mode 100644 index 0000000..c92b7c5 --- /dev/null +++ "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\346\255\243\346\226\207.txt" @@ -0,0 +1,21 @@ +我在把自己的租房记账 App 移植到鸿蒙。写完界面后发现,签名、截图、应用资料、软件包上传,还有一堆重复操作要处理。 + +于是我做了一个开源工具:agc-cli,把华为 AppGallery Connect 的操作搬进终端,也方便交给 AI 编程助手执行。 + +它可以用来做什么? + +① 管理应用资料 +更新应用介绍、简介和版本说明,上传图标截图,管理不同语言的文案;维护多个应用时,还可以通过 profile 指定凭据。 + +② 上传发行包并查询结果 +获取上传地址、上传 APP 文件、关联应用版本,再查询华为的解析与合法性结果。命令可以保存下来,接入脚本、CI 或 AI 助手。 + +今天用自己的 App 实际跑了一遍,还踩了一个坑:文件上传成功,软件包却没通过合法性检测。补齐外层 APP 签名后,重新上传和查询,才确认软件包可用。 + +所以工具里我特别看重一件事:每一步执行完,都要能核对结果。上传、解析、审核、上架,是不同阶段。 + +项目已经开源。GitHub 搜索 Createitv/agc-cli,官网是 agccli.app。 + +如果你也在做鸿蒙应用,最想自动化的是哪一步? + +#鸿蒙开发 #独立开发者 #开源项目 #AI编程 #程序员 diff --git "a/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\347\264\240\346\235\220\350\257\264\346\230\216.json" "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\347\264\240\346\235\220\350\257\264\346\230\216.json" new file mode 100644 index 0000000..cee6f26 --- /dev/null +++ "b/\345\256\243\344\274\240/\345\260\217\347\272\242\344\271\246/2026-10-07-agc-cli/\347\264\240\346\235\220\350\257\264\346\230\216.json" @@ -0,0 +1,28 @@ +{ + "reference": "docs/community/assets/agc-cli-cover.png", + "generation": "Built-in image generation tool; aiimages entry not available", + "images": [ + { + "file": "01-封面.png", + "width": 1086, + "height": 1448, + "sha256": "f38d32c64c71489165ac213a8e046bfb88b818a3082dce2bbfc4096304db0a80", + "source": "/Users/tnt/Documents/Github/项目/林逍遥/agc-cli/docs/community/assets/agc-cli-cover-zh-CN-xiaohongshu.png" + }, + { + "file": "02-应用资料管理.png", + "width": 1086, + "height": 1448, + "sha256": "84ba05638da8270407ea2576ca7120f9ff83c36458e546eb563c965c7a0fa48b", + "source": "/Users/tnt/.codex/generated_images/01a11409-6c00-7163-a665-786d8e5bc9cc/exec-9195fadd-5496-4711-84f0-cd77989f5f35.png" + }, + { + "file": "03-发行包上传与状态.png", + "width": 1086, + "height": 1448, + "sha256": "f277da0933a4c5b9391d3426c58fbd4319d7111b29549f3024a2c35139359f9e", + "source": "/Users/tnt/.codex/generated_images/01a11409-6c00-7163-a665-786d8e5bc9cc/exec-882ed30d-af9d-44a3-96c0-0aff38036e8b.png" + } + ], + "published": false +}